Class: Basecamp::Oauth::ProtectedResourceMetadata

Inherits:
Data
  • Object
show all
Defined in:
lib/basecamp/oauth/protected_resource_metadata.rb

Overview

RFC 9728 protected-resource metadata (hop 1 of resource-first discovery).

authorization_servers preserves "key absent" and "present but empty []" distinctly: BC5 omits the key while dark, per RFC 9728 ยง3.2. Both select Launchpad, but the distinction is meaningful to callers inspecting metadata directly (absent => nil, empty => []).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource:, authorization_servers: nil) ⇒ ProtectedResourceMetadata

Returns a new instance of ProtectedResourceMetadata.



17
18
19
# File 'lib/basecamp/oauth/protected_resource_metadata.rb', line 17

def initialize(resource:, authorization_servers: nil)
  super
end

Instance Attribute Details

#authorization_serversArray<String>? (readonly)

Advertised authorization servers; nil when the key is absent, [] when present but empty.

Returns:

  • (Array<String>, nil)

    the current value of authorization_servers



16
17
18
# File 'lib/basecamp/oauth/protected_resource_metadata.rb', line 16

def authorization_servers
  @authorization_servers
end

#resourceString (readonly)

The resource identifier; equals the requested resource origin by code-point.

Returns:

  • (String)

    the current value of resource



16
17
18
# File 'lib/basecamp/oauth/protected_resource_metadata.rb', line 16

def resource
  @resource
end