Class: Basecamp::Oauth::Config
- Inherits:
-
Data
- Object
- Data
- Basecamp::Oauth::Config
- Defined in:
- lib/basecamp/oauth/config.rb
Overview
OAuth 2 server configuration from an Authorization Server Metadata document (RFC 8414).
As of BC5 resource-first discovery, authorization_endpoint is OPTIONAL:
device-only authorization servers omit it, so authorization-code consumers
MUST assert its presence before use. token_endpoint stays required.
NOTE: device_authorization_endpoint is APPENDED after the pre-existing
members. Data.define's member order is the positional/deconstruct order, so
inserting a new field mid-list would shift positional callers (and pattern
matches). Keep new fields last for positional compatibility.
Instance Attribute Summary collapse
-
#authorization_endpoint ⇒ String?
readonly
URL of the authorization endpoint (optional).
-
#device_authorization_endpoint ⇒ String?
readonly
URL of the RFC 8628 device authorization endpoint.
-
#grant_types_supported ⇒ Array<String>?
readonly
OAuth 2 grant types the server supports.
-
#issuer ⇒ String
readonly
The authorization server's issuer identifier.
-
#registration_endpoint ⇒ String?
readonly
URL of the dynamic client registration endpoint.
-
#scopes_supported ⇒ Array<String>?
readonly
List of OAuth 2 scopes supported.
-
#token_endpoint ⇒ String
readonly
URL of the token endpoint.
Instance Method Summary collapse
-
#initialize(issuer:, token_endpoint:, authorization_endpoint: nil, registration_endpoint: nil, scopes_supported: nil, grant_types_supported: nil, device_authorization_endpoint: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(issuer:, token_endpoint:, authorization_endpoint: nil, registration_endpoint: nil, scopes_supported: nil, grant_types_supported: nil, device_authorization_endpoint: nil) ⇒ Config
Returns a new instance of Config.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/basecamp/oauth/config.rb', line 32 def initialize( issuer:, token_endpoint:, authorization_endpoint: nil, registration_endpoint: nil, scopes_supported: nil, grant_types_supported: nil, device_authorization_endpoint: nil ) super end |
Instance Attribute Details
#authorization_endpoint ⇒ String? (readonly)
URL of the authorization endpoint (optional)
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def @authorization_endpoint end |
#device_authorization_endpoint ⇒ String? (readonly)
URL of the RFC 8628 device authorization endpoint
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def @device_authorization_endpoint end |
#grant_types_supported ⇒ Array<String>? (readonly)
OAuth 2 grant types the server supports
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def grant_types_supported @grant_types_supported end |
#issuer ⇒ String (readonly)
The authorization server's issuer identifier
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def issuer @issuer end |
#registration_endpoint ⇒ String? (readonly)
URL of the dynamic client registration endpoint
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def registration_endpoint @registration_endpoint end |
#scopes_supported ⇒ Array<String>? (readonly)
List of OAuth 2 scopes supported
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def scopes_supported @scopes_supported end |
#token_endpoint ⇒ String (readonly)
URL of the token endpoint
23 24 25 |
# File 'lib/basecamp/oauth/config.rb', line 23 def token_endpoint @token_endpoint end |