diff --git a/packages/schemas/src/db-entries/index.ts b/packages/schemas/src/db-entries/index.ts index d3678596b..9bb526909 100644 --- a/packages/schemas/src/db-entries/index.ts +++ b/packages/schemas/src/db-entries/index.ts @@ -1,5 +1,6 @@ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. export * from './custom-types'; +export * from './oidc-client'; export * from './oidc-model-instance'; export * from './user'; diff --git a/packages/schemas/src/db-entries/oidc-client.ts b/packages/schemas/src/db-entries/oidc-client.ts new file mode 100644 index 000000000..34d0aad6a --- /dev/null +++ b/packages/schemas/src/db-entries/oidc-client.ts @@ -0,0 +1,19 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { OidcClientMetadata } from '../foundations'; + +export type OidcClientDBEntry = { + clientId: string; + metadata: OidcClientMetadata; + createdAt: number; +}; + +export const OidcClients = Object.freeze({ + table: 'oidc_clients', + fields: { + clientId: 'client_id', + metadata: 'metadata', + createdAt: 'created_at', + }, + fieldKeys: ['clientId', 'metadata', 'createdAt'], +} as const); diff --git a/packages/schemas/src/foundations.ts b/packages/schemas/src/foundations.ts index 4ba0d569c..fff2b7000 100644 --- a/packages/schemas/src/foundations.ts +++ b/packages/schemas/src/foundations.ts @@ -4,3 +4,8 @@ export type OidcModelInstancePayload = { uid?: string; grantId?: string; }; + +export type OidcClientMetadata = { + redirect_uris: string[]; + post_logout_redirect_uris: string[]; +}; diff --git a/packages/schemas/tables/oidc_clients.sql b/packages/schemas/tables/oidc_clients.sql new file mode 100644 index 000000000..e6ab8da8e --- /dev/null +++ b/packages/schemas/tables/oidc_clients.sql @@ -0,0 +1,6 @@ +create table oidc_clients ( + client_id varchar(128) not null, + metadata jsonb /* @use OidcClientMetadata */ not null, + created_at bigint not null default(extract(epoch from now())), + primary key (client_id) +);