import { type Maybe } from '@dereekb/util'; import { type OidcEntryClientId, type OidcRedirectUri } from '../../common'; /** * Corresponds with readable content from a OidcEntry's payload. */ export interface OidcEntryOAuthClientPayloadData { readonly client_id: OidcEntryClientId; readonly client_name?: Maybe; readonly redirect_uris: OidcRedirectUri[]; readonly grant_types: string[]; readonly response_types?: Maybe; readonly token_endpoint_auth_method?: Maybe; readonly logo_uri?: Maybe; readonly client_uri?: Maybe; readonly created_at?: string; /** * Optional per-client maximum login duration (seconds). * * Custom oidc-provider client metadata (registered via `extraClientMetadata`). * Caps how long a client may request via the `dbx_session_ttl` auth-URL param. */ readonly dbx_max_session_ttl?: Maybe; /** * Optional OIDC provider profile keys assigned to this client. * * Custom oidc-provider client metadata (registered via `extraClientMetadata`). Each key references * an {@link OidcProviderProfile} that unlocks (and optionally force-requires) otherwise-restricted * scopes for this client. Admin-only: stripped from non-admin create/update requests. */ readonly dbx_provider_profiles?: Maybe; } /** * Subset of an oidc-provider Grant adapter payload that is safe to expose to the * granting user when they manage their issued tokens. * * Mirrors the relevant fields of oidc-provider's `lib/models/grant.js` payload. */ export interface OidcEntryGrantPayloadData { readonly accountId?: Maybe; readonly clientId?: Maybe; readonly exp?: Maybe; readonly iat?: Maybe; /** * Space-delimited string of scopes that apply across all resources, e.g. `'openid email offline_access'`. */ readonly openid?: Maybe<{ readonly scope?: Maybe; readonly claims?: Maybe; }>; }