Module: Fluence::Gateway::AppCenter

Defined in:
lib/fluence/gateway/app_center.rb

Overview

Domain helpers for the AppCenter identity API.

Resolves user uids and OAuth client ids into their full records via the AppCenter REST API. Requests are signed with the same service client_credentials token as gateway calls, and multi-tenant routing (tenant: kwarg, Client.with_tenant scope) applies as usual — each tenant may override appcenter_url.

Examples:

Resolve a user uid

Fluence::Gateway::AppCenter.user('abc-123')
# → GET https://appcenter.fluence.eu/api/v1/users/abc-123
# => { 'uid' => 'abc-123', 'email' => ..., ... }

Resolve an OAuth client id

Fluence::Gateway::AppCenter.client('my-client-id')
# → GET https://appcenter.fluence.eu/api/v1/clients/my-client-id

See Also:

Class Method Summary collapse

Class Method Details

.client(client_id) ⇒ Hash

Fetches an OAuth client record from AppCenter by client id.

Parameters:

  • client_id (String, Integer) —

    the OAuth client id (URI-escaped before interpolation into the path)

  • opts (Hash) —

    options forwarded to Client#appcenter_get (e.g. tenant:, raw:)

Returns:

  • (Hash) —

    the parsed client record

Raises:

.user(uid) ⇒ Hash

Fetches a user record from AppCenter by uid.

Parameters:

  • uid (String, Integer) —

    the user uid (URI-escaped before interpolation into the path)

  • opts (Hash) —

    options forwarded to Client#appcenter_get (e.g. tenant:, raw:)

Returns:

  • (Hash) —

    the parsed user record

Raises: