Class: MoneyKit::AccessTokenApi
- Inherits:
-
Object
- Object
- MoneyKit::AccessTokenApi
- Defined in:
- lib/moneykit/api/access_token_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_access_token(opts = {}) ⇒ CreateAccessTokenResponse
/auth/token Create a new short-lived access token by validating your ‘client_id` and `client_secret`.
-
#create_access_token_with_http_info(opts = {}) ⇒ Array<(CreateAccessTokenResponse, Integer, Hash)>
/auth/token Create a new short-lived access token by validating your `client_id` and `client_secret`.
-
#get_well_known_jwks(opts = {}) ⇒ JWKSet
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify JWTs in webhooks sent by MoneyKit.
-
#get_well_known_jwks_with_http_info(opts = {}) ⇒ Array<(JWKSet, Integer, Hash)>
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify JWTs in webhooks sent by MoneyKit.
-
#initialize(api_client = ApiClient.default) ⇒ AccessTokenApi
constructor
A new instance of AccessTokenApi.
-
#instrospect_client(opts = {}) ⇒ AppClientResponse
/auth/introspect Get details about the client and application associated with your ‘access_token`.
-
#instrospect_client_with_http_info(opts = {}) ⇒ Array<(AppClientResponse, Integer, Hash)>
/auth/introspect Get details about the client and application associated with your `access_token`.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AccessTokenApi
Returns a new instance of AccessTokenApi.
19 20 21 |
# File 'lib/moneykit/api/access_token_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/moneykit/api/access_token_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_access_token(opts = {}) ⇒ CreateAccessTokenResponse
/auth/token Create a new short-lived access token by validating your ‘client_id` and `client_secret`. The `access_token` is to be forwarded with all subsequent requests as `Authorization: Bearer access_token` HTTP header. When the token expires you must regenerate your `access_token`. The `client_id` and `client_secret` can be supplied as POST body parameters, or as a HTTP basic auth header.
30 31 32 33 |
# File 'lib/moneykit/api/access_token_api.rb', line 30 def create_access_token(opts = {}) data, _status_code, _headers = create_access_token_with_http_info(opts) data end |
#create_access_token_with_http_info(opts = {}) ⇒ Array<(CreateAccessTokenResponse, Integer, Hash)>
/auth/token Create a new short-lived access token by validating your `client_id` and `client_secret`. The `access_token` is to be forwarded with all subsequent requests as `Authorization: Bearer access_token` HTTP header. When the token expires you must regenerate your `access_token`. The `client_id` and `client_secret` can be supplied as POST body parameters, or as a HTTP basic auth header.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/moneykit/api/access_token_api.rb', line 43 def create_access_token_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.create_access_token ...' end pattern = Regexp.new(/^(client_credentials|refresh_token)$/) if @api_client.config.client_side_validation && !opts[:'grant_type'].nil? && opts[:'grant_type'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"grant_type\"]' when calling AccessTokenApi.create_access_token, must conform to the pattern #{pattern}." end # resource path local_var_path = '/auth/token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['grant_type'] = opts[:'grant_type'] if !opts[:'grant_type'].nil? form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil? form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil? form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateAccessTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBasic'] = opts.merge( :operation => :"AccessTokenApi.create_access_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#create_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_well_known_jwks(opts = {}) ⇒ JWKSet
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify JWTs in webhooks sent by MoneyKit. The JWKS should be cached, but MoneyKit rotates its webhook keys periodically, so if an incoming webhook’s JWT has a key ID (‘kid`) not contained in the cached JWKS, you should fetch and cache the updated JWKS using this endpoint.
107 108 109 110 |
# File 'lib/moneykit/api/access_token_api.rb', line 107 def get_well_known_jwks(opts = {}) data, _status_code, _headers = get_well_known_jwks_with_http_info(opts) data end |
#get_well_known_jwks_with_http_info(opts = {}) ⇒ Array<(JWKSet, Integer, Hash)>
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify JWTs in webhooks sent by MoneyKit. The JWKS should be cached, but MoneyKit rotates its webhook keys periodically, so if an incoming webhook's JWT has a key ID (`kid`) not contained in the cached JWKS, you should fetch and cache the updated JWKS using this endpoint.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/moneykit/api/access_token_api.rb', line 118 def get_well_known_jwks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.get_well_known_jwks ...' end # resource path local_var_path = '/.well-known/jwks.json' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Client-Id'] = opts[:'x_client_id'] if !opts[:'x_client_id'].nil? header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'JWKSet' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"AccessTokenApi.get_well_known_jwks", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#get_well_known_jwks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#instrospect_client(opts = {}) ⇒ AppClientResponse
/auth/introspect Get details about the client and application associated with your ‘access_token`.
168 169 170 171 |
# File 'lib/moneykit/api/access_token_api.rb', line 168 def instrospect_client(opts = {}) data, _status_code, _headers = instrospect_client_with_http_info(opts) data end |
#instrospect_client_with_http_info(opts = {}) ⇒ Array<(AppClientResponse, Integer, Hash)>
/auth/introspect Get details about the client and application associated with your `access_token`.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/moneykit/api/access_token_api.rb', line 177 def instrospect_client_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.instrospect_client ...' end # resource path local_var_path = '/auth/introspect' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AppClientResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials'] = opts.merge( :operation => :"AccessTokenApi.instrospect_client", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#instrospect_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |