Class: Himari::ItemProviders::Storage
- Inherits:
-
Object
- Object
- Himari::ItemProviders::Storage
- Includes:
- Himari::ItemProvider
- Defined in:
- lib/himari/item_providers/storage.rb
Overview
Looks up dynamically registered clients from storage and presents them to the OIDC endpoints as plain ClientRegistration objects. Lookups always carry an id hint; without one this returns nothing (there is no list operation). Expired registrations are filtered out here so backends without TTL (Memory, Filesystem) and DynamoDB’s delayed TTL both fail closed.
Instance Method Summary collapse
- #collect(id: nil, **_hint) ⇒ Object
-
#initialize(storage:, skip_consent: false, scopes: Himari::ClientRegistration::IMPLICIT_SCOPES) ⇒ Storage
constructor
A new instance of Storage.
Constructor Details
#initialize(storage:, skip_consent: false, scopes: Himari::ClientRegistration::IMPLICIT_SCOPES) ⇒ Storage
Returns a new instance of Storage.
19 20 21 22 23 |
# File 'lib/himari/item_providers/storage.rb', line 19 def initialize(storage:, skip_consent: false, scopes: Himari::ClientRegistration::IMPLICIT_SCOPES) @storage = storage @skip_consent = @scopes = scopes end |
Instance Method Details
#collect(id: nil, **_hint) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/himari/item_providers/storage.rb', line 25 def collect(id: nil, **_hint) return [] unless id client = @storage.find_dynamic_client(id) client&.active? ? [client.to_client_registration(skip_consent: @skip_consent, scopes: @scopes)] : [] end |