lib/aptible/auth/token.rb
def authenticate_impersonate(subject_token, subject_token_type, options)
        actor_token = token_as_string(options.delete(:token)) || bearer_token

        # TODO: Do we want to check whether the token is non-nil at this stage?
        options[:scope] ||= 'manage'
        oauth_token = oauth.token_exchange.get_token(
          actor_token, 'urn:ietf:params:oauth:token-type:jwt',
          subject_token, subject_token_type, options
        )

        apply_oauth_response(oauth_token)
      end
# Unlike other resources, tokens aren't created in a REST fashion.
# Instead, they're created via OAuth grants. This means we need to
# override the way HyperResource / aptible-resource normally do things
# and plug in an OAuth library.
#
# To do so, we take control of the creation arguments and feed them into
# the OAuth2 library (in Token.create!), and then feed the response back
# to HyperResource (in Token#apply_oauth_response).
Unlike other resources, tokens aren't created in a REST fashion.
Instead, they're created via OAuth grants. This means we need to
override the way HyperResource / aptible-resource normally do things
and plug in an OAuth library.

To do so, we take control of the creation arguments and feed them into
the OAuth2 library (in Token.create!), and then feed the response back
to HyperResource (in Token#apply_oauth_response).
Unlike other resources tokens aren ' t created in a REST fashion . Instead they ' re created via OAuth grants . This means we need to override the way HyperResource / aptible - resource normally do things and plug in an OAuth library . To do so we take control of the creation arguments and feed them into the OAuth2 library ( in Token . create! ) and then feed the response back to HyperResource ( in Token#apply_oauth_response ) .
def authenticate_impersonate(subject_token, subject_token_type, options)
        actor_token = token_as_string(options.delete(:token)) || bearer_token
        options[:scope] ||= 'manage'
        oauth_token = oauth.token_exchange.get_token(
          actor_token, 'urn:ietf:params:oauth:token-type:jwt',
          subject_token, subject_token_type, options
        )
        apply_oauth_response(oauth_token)
      end
def authenticate_impersonate ( subject_token , subject_token_type , options ) actor_token = token_as_string ( options . delete ( :token ) ) || bearer_token options [ :scope ] ||= 'manage' oauth_token = oauth . token_exchange . get_token ( actor_token , 'urn:ietf:params:oauth:token-type:jwt' , subject_token , subject_token_type , options ) apply_oauth_response ( oauth_token ) end
Unlike other resources, tokens aren't created in a REST fashion.
Unlike other resources tokens aren ' t created in a REST fashion .
# TODO: Do we want to check whether the token is non-nil at this stage?
subject_token
subject_token_type
options