0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

feat: add OIDC clients table

This commit is contained in:
Gao Sun 2021-07-05 00:17:40 +08:00
parent a7d939d88f
commit ac53f7befb
No known key found for this signature in database
GPG key ID: 0F0EFA2E36639F31
4 changed files with 31 additions and 0 deletions

View file

@ -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';

View file

@ -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);

View file

@ -4,3 +4,8 @@ export type OidcModelInstancePayload = {
uid?: string;
grantId?: string;
};
export type OidcClientMetadata = {
redirect_uris: string[];
post_logout_redirect_uris: string[];
};

View file

@ -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)
);