Class: Doorkeeper::DeviceAuthorizationGrant::Config
- Inherits:
-
Object
- Object
- Doorkeeper::DeviceAuthorizationGrant::Config
- Extended by:
- Config::Option
- Defined in:
- lib/doorkeeper/device_authorization_grant/config.rb
Overview
Configuration model for Doorkeeper DeviceAuthorizationGrant
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#device_code_expires_in ⇒ Integer
readonly
Device code expiration time, in seconds.
-
#device_code_polling_interval ⇒ Integer
readonly
Minimum device code polling interval expected from the client, expressed in seconds.
-
#device_grant_class ⇒ String
readonly
Customizable reference to the DeviceGrant model.
-
#user_code_generator ⇒ String
readonly
Reference to a model (or class) for user code generation.
-
#verification_uri ⇒ Proc
readonly
A Proc returning the end-user verification URI on the authorization server.
-
#verification_uri_complete ⇒ Proc
readonly
A Proc returning the verification URI that includes the “user_code” (or other information with the same function as the “user_code”), which is designed for non-textual transmission.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#device_code_expires_in ⇒ Integer (readonly)
Device code expiration time, in seconds.
50 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 50 option :device_code_expires_in, default: 300 |
#device_code_polling_interval ⇒ Integer (readonly)
Minimum device code polling interval expected from the client, expressed in seconds.
45 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 45 option :device_code_polling_interval, default: 5 |
#device_grant_class ⇒ String (readonly)
Customizable reference to the DeviceGrant model.
55 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 55 option :device_grant_class, default: 'Doorkeeper::DeviceAuthorizationGrant::DeviceGrant' |
#user_code_generator ⇒ String (readonly)
Reference to a model (or class) for user code generation.
It must implement a ‘.generate` method, which can be invoked without arguments, to obtain a String user code value.
63 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 63 option :user_code_generator, default: 'Doorkeeper::DeviceAuthorizationGrant::OAuth::Helpers::UserCode' |
#verification_uri ⇒ Proc (readonly)
A Proc returning the end-user verification URI on the authorization server.
68 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 68 option :verification_uri, default: ->(host_name) { "#{host_name}/oauth/device" } |
#verification_uri_complete ⇒ Proc (readonly)
A Proc returning the verification URI that includes the “user_code” (or other information with the same function as the “user_code”), which is designed for non-textual transmission. This is optional, so the Proc can also return ‘nil`.
76 77 78 79 80 81 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 76 option( :verification_uri_complete, default: lambda do |verification_uri, _host_name, device_grant| "#{verification_uri}?user_code=#{CGI.escape(device_grant.user_code)}" end ) |
Class Method Details
Instance Method Details
#device_grant_model ⇒ Class
84 85 86 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 84 def device_grant_model @device_grant_model ||= device_grant_class.constantize end |
#user_code_generator_class ⇒ Class, Module
89 90 91 |
# File 'lib/doorkeeper/device_authorization_grant/config.rb', line 89 def user_code_generator_class @user_code_generator_class ||= user_code_generator.constantize end |