Class: Drillbit::Configuration
- Inherits:
-
Object
- Object
- Drillbit::Configuration
- Defined in:
- lib/drillbit/configuration.rb
Instance Attribute Summary collapse
- #allowed_api_subdomains ⇒ Object
- #allowed_subdomains ⇒ Object
-
#application_name ⇒ Object
Returns the value of attribute application_name.
- #available_token_roles ⇒ Object
- #default_api_version ⇒ Object
- #default_token_audience ⇒ Object
- #default_token_expiration_in_minutes ⇒ Object
- #default_token_issuer ⇒ Object
- #default_token_roles ⇒ Object
- #default_token_subject ⇒ Object
- #token_private_key ⇒ Object
- #token_type ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#allowed_api_subdomains ⇒ Object
35 36 37 |
# File 'lib/drillbit/configuration.rb', line 35 def allowed_api_subdomains @allowed_api_subdomains || ['api'] end |
#allowed_subdomains ⇒ Object
31 32 33 |
# File 'lib/drillbit/configuration.rb', line 31 def allowed_subdomains @allowed_subdomains || ['api'] end |
#application_name ⇒ Object
Returns the value of attribute application_name.
17 18 19 |
# File 'lib/drillbit/configuration.rb', line 17 def application_name @application_name end |
#available_token_roles ⇒ Object
43 44 45 |
# File 'lib/drillbit/configuration.rb', line 43 def available_token_roles @available_token_roles || %w{standard admin password_reset email_verification} end |
#default_api_version ⇒ Object
47 48 49 |
# File 'lib/drillbit/configuration.rb', line 47 def default_api_version @default_api_version || '1' end |
#default_token_audience ⇒ Object
39 40 41 |
# File 'lib/drillbit/configuration.rb', line 39 def default_token_audience @default_token_audience || 'public' end |
#default_token_expiration_in_minutes ⇒ Object
63 64 65 |
# File 'lib/drillbit/configuration.rb', line 63 def default_token_expiration_in_minutes @default_token_expiration_in_minutes || (7 * 24 * 60) end |
#default_token_issuer ⇒ Object
55 56 57 |
# File 'lib/drillbit/configuration.rb', line 55 def default_token_issuer @default_token_issuer || 'drillbit' end |
#default_token_roles ⇒ Object
51 52 53 |
# File 'lib/drillbit/configuration.rb', line 51 def default_token_roles @default_token_roles || %w{standard} end |
#default_token_subject ⇒ Object
59 60 61 |
# File 'lib/drillbit/configuration.rb', line 59 def default_token_subject @default_token_subject || 'User' end |
#token_private_key ⇒ Object
67 68 69 70 71 72 |
# File 'lib/drillbit/configuration.rb', line 67 def token_private_key return unless @token_private_key return @token_private_key if @token_private_key.respond_to?(:sign) OpenSSL::PKey::RSA.new(@token_private_key) end |
#token_type ⇒ Object
74 75 76 |
# File 'lib/drillbit/configuration.rb', line 74 def token_type @token_type || 'JWE' end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/drillbit/configuration.rb', line 19 def to_h { allowed_api_subdomains: allowed_api_subdomains, allowed_subdomains: allowed_subdomains, application_name: application_name, default_api_version: default_api_version, default_token_issuer: default_token_issuer, default_token_subject: default_token_subject, default_token_expiration_in_minutes: token_expiration_in_minutes, } end |