Class: Arkaan::OAuth::Application

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/oauth/application.rb

Overview

An application is what is referred to in the OAuth2.0 RFC as a client, wanting to access private informations about the user.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#authorizationsArray<Arkaan::OAuth::Authorization>

Returns the authorizations linked to the accounts this application can get the data from.

Returns:



24
# File 'lib/arkaan/oauth/application.rb', line 24

has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :application

#creatorArkaan::Account

Returns the account that has created this application, considered its owner.

Returns:

  • (Arkaan::Account)

    the account that has created this application, considered its owner.



21
# File 'lib/arkaan/oauth/application.rb', line 21

belongs_to :creator, class_name: 'Arkaan::Account', inverse_of: :applications

#keyString

Returns the unique key for the application, identifying it when requesting a token for the API.

Returns:

  • (String)

    the unique key for the application, identifying it when requesting a token for the API.



14
# File 'lib/arkaan/oauth/application.rb', line 14

field :key, type: String, default: ->{ SecureRandom.hex }

#nameString

Returns the unique name of the application, mainly used to identify and display it.

Returns:

  • (String)

    the unique name of the application, mainly used to identify and display it.



11
# File 'lib/arkaan/oauth/application.rb', line 11

field :name, type: String

#premiumBoolean

Returns a value indicating whether the application should automatically receive a token when an account is created, or not.

Returns:

  • (Boolean)

    a value indicating whether the application should automatically receive a token when an account is created, or not.



17
# File 'lib/arkaan/oauth/application.rb', line 17

field :premium, type: Boolean, default: false