Class: Aspera::OAuth::UrlJson
Overview
This class is used to create a token using a JSON body and a URL
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #create_token ⇒ Object
-
#initialize(url:, json:, **generic_params) ⇒ UrlJson
constructor
A new instance of UrlJson.
Methods inherited from Base
#authorization, #base_params, #create_token_call, #token
Constructor Details
#initialize(url:, json:, **generic_params) ⇒ UrlJson
Returns a new instance of UrlJson.
12 13 14 15 16 17 18 19 20 |
# File 'lib/aspera/oauth/url_json.rb', line 12 def initialize( url:, json:, **generic_params ) super(**generic_params, cache_ids: [json[:url_token]]) @body = json @query = url end |
Instance Method Details
#create_token ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/aspera/oauth/url_json.rb', line 22 def create_token api.call( operation: 'POST', subpath: path_token, query: @query.merge(scope: params[:scope]), # scope is here because it may change over time (node) content_type: Rest::MIME_JSON, body: @body, headers: {'Accept' => Rest::MIME_JSON}, ret: :resp ) end |