0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

Merge pull request #71 from logto-io/gao--refactor-applications

refactor(schemas): oidc_clients -> applications
This commit is contained in:
Gao Sun 2021-08-10 21:00:29 +08:00 committed by GitHub
commit 1b6a755376
6 changed files with 49 additions and 26 deletions

View file

@ -0,0 +1,27 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import { OidcClientMetadata } from '../foundations';
import { ApplicationType } from './custom-types';
export type ApplicationDBEntry = {
id: string;
name: string;
type: ApplicationType;
oidcClientId: string;
oidcClientMetadata: OidcClientMetadata;
createdAt: number;
};
export const Applications = Object.freeze({
table: 'applications',
fields: {
id: 'id',
name: 'name',
type: 'type',
oidcClientId: 'oidc_client_id',
oidcClientMetadata: 'oidc_client_metadata',
createdAt: 'created_at',
},
fieldKeys: ['id', 'name', 'type', 'oidcClientId', 'oidcClientMetadata', 'createdAt'],
} as const);

View file

@ -1,5 +1,10 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export enum ApplicationType {
Native = 'Native',
SPA = 'SPA',
Traditional = 'Traditional',
}
export enum PasswordEncryptionMethod {
SaltAndPepper = 'SaltAndPepper',
}

View file

@ -1,6 +1,6 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export * from './custom-types';
export * from './oidc-client';
export * from './application';
export * from './oidc-model-instance';
export * from './user';

View file

@ -1,19 +0,0 @@
// 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

@ -0,0 +1,16 @@
create type application_type as enum ('Native', 'SPA', 'Traditional');
create table applications (
id varchar(128) not null,
name varchar(256) not null,
type application_type not null,
oidc_client_id varchar(128) not null,
oidc_client_metadata jsonb /* @use OidcClientMetadata */ not null,
created_at bigint not null default(extract(epoch from now())),
primary key (id)
);
create index applications__oidc_client_id
on applications (
oidc_client_id
);

View file

@ -1,6 +0,0 @@
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)
);