lib/aptible/auth/token.rb
def process_options(options)
        options = options.dup
        if (email = options.delete(:email)) &&
           (password = options.delete(:password))
          authenticate_user(email, password, options)
        elsif (client_id = options.delete(:client_id)) &&
              (client_secret = options.delete(:client_secret)) &&
              (subject = options.delete(:subject))
          authenticate_client(client_id, client_secret, subject, options)
        elsif (href = options.delete(:user_href))
          authenticate_impersonate(href, 'aptible:user:href', options)
        elsif (href = options.delete(:organization_href))
          authenticate_impersonate(href, 'aptible:organization:href', options)
        elsif (email = options.delete(:user_email))
          authenticate_impersonate(email, 'aptible:user:email', options)
        elsif (user_token = options.delete(:user_token))
          authenticate_impersonate(
            token_as_string(user_token), 'aptible:token', options
          )
        else
          raise 'Unrecognized options'
        end
      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 process_options(options)
        options = options.dup
        if (email = options.delete(:email)) &&
           (password = options.delete(:password))
          authenticate_user(email, password, options)
        elsif (client_id = options.delete(:client_id)) &&
              (client_secret = options.delete(:client_secret)) &&
              (subject = options.delete(:subject))
          authenticate_client(client_id, client_secret, subject, options)
        elsif (href = options.delete(:user_href))
          authenticate_impersonate(href, 'aptible:user:href', options)
        elsif (href = options.delete(:organization_href))
          authenticate_impersonate(href, 'aptible:organization:href', options)
        elsif (email = options.delete(:user_email))
          authenticate_impersonate(email, 'aptible:user:email', options)
        elsif (user_token = options.delete(:user_token))
          authenticate_impersonate(
            token_as_string(user_token), 'aptible:token', options
          )
        else
          raise 'Unrecognized options'
        end
      end
def process_options ( options ) options = options . dup if ( email = options . delete ( :email ) ) && ( password = options . delete ( :password ) ) authenticate_user ( email , password , options ) elsif ( client_id = options . delete ( :client_id ) ) && ( client_secret = options . delete ( :client_secret ) ) && ( subject = options . delete ( :subject ) ) authenticate_client ( client_id , client_secret , subject , options ) elsif ( href = options . delete ( :user_href ) ) authenticate_impersonate ( href , 'aptible:user:href' , options ) elsif ( href = options . delete ( :organization_href ) ) authenticate_impersonate ( href , 'aptible:organization:href' , options ) elsif ( email = options . delete ( :user_email ) ) authenticate_impersonate ( email , 'aptible:user:email' , options ) elsif ( user_token = options . delete ( :user_token ) ) authenticate_impersonate ( token_as_string ( user_token ) , 'aptible:token' , options ) else raise 'Unrecognized options' end end
Unlike other resources, tokens aren't created in a REST fashion.
Unlike other resources tokens aren ' t created in a REST fashion .
options