0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/alterations/next-1728887713-add-client-idp-initiated-auth-callback-uri-columns.ts
simeng-li 2c8343a757
feat(schemas): add idp-initiated SSO client side callback url columns (#6675)
* feat(core): consume IdP initiated session on SSO verification flow

Auto consume the IdP initiated SAML SSO session on the SSO sign-in verification flow

* test(core): add unit test cases

add unit test cases

* feat(schemas): add client idp-initiated auth callback url column

add client idp-initiated auth callback url column

* fix(test): fix ut

fix ut
2024-10-16 16:58:20 +08:00

40 lines
1.4 KiB
TypeScript

import { sql } from '@silverhand/slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
alter table sso_connector_idp_initiated_auth_configs
add column client_idp_initiated_auth_callback_uri text;
alter table sso_connector_idp_initiated_auth_configs
add column auto_send_authorization_request boolean not null default false;
alter table sso_connector_idp_initiated_auth_configs
drop constraint application_type;
alter table sso_connector_idp_initiated_auth_configs
add constraint application_type
check (check_application_type(default_application_id, 'Traditional', 'SPA'));
`);
},
down: async (pool) => {
await pool.query(sql`
alter table sso_connector_idp_initiated_auth_configs
drop constraint application_type;
alter table sso_connector_idp_initiated_auth_configs
drop column client_idp_initiated_auth_callback_uri;
alter table sso_connector_idp_initiated_auth_configs
drop column auto_send_authorization_request;
alter table sso_connector_idp_initiated_auth_configs
add constraint application_type
check (check_application_type(default_application_id, 'Traditional'));
`);
},
};
export default alteration;