module SwiftypeAppSearch::Client::SignedSearchOptions::ClassMethods

Public Instance Methods

create_signed_search_key(api_key, api_key_name, options = {}) click to toggle source

Build a JWT for authentication

@param [String] api_key the API Key to sign the request with @param [String] api_key_name the unique name for the API Key @option options see the App Search API for supported search options.

@return [String] the JWT to use for authentication

# File lib/swiftype-app-search/client.rb, line 47
def create_signed_search_key(api_key, api_key_name, options = {})
  payload = Utils.symbolize_keys(options).merge(:api_key_name => api_key_name)
  JWT.encode(payload, api_key, ALGORITHM)
end