@logto/schemas 1.22.0 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alterations/1.23.0-1732851150-rename-saml-application-constraints.ts +34 -0
- package/alterations/1.23.0-1733212543-add-saml-application-type-to-idp-initiated-sso-application-allow-list.ts +30 -0
- package/alterations/1.23.0-1735012422-add-saml-application-sessions-table.ts +37 -0
- package/alterations/1.23.1-1735274337-add-encryption-config-to-saml-apps.ts +35 -0
- package/alterations/1.23.1-1735292380-make-saml-app-first-party-app.ts +28 -0
- package/alterations-js/1.23.0-1732851150-rename-saml-application-constraints.js +28 -0
- package/alterations-js/1.23.0-1733212543-add-saml-application-type-to-idp-initiated-sso-application-allow-list.js +24 -0
- package/alterations-js/1.23.0-1735012422-add-saml-application-sessions-table.js +32 -0
- package/alterations-js/1.23.1-1735274337-add-encryption-config-to-saml-apps.js +31 -0
- package/alterations-js/1.23.1-1735292380-make-saml-app-first-party-app.js +24 -0
- package/lib/consts/subscriptions.d.ts +16 -15
- package/lib/consts/subscriptions.js +16 -14
- package/lib/db-entries/index.d.ts +1 -0
- package/lib/db-entries/index.js +1 -0
- package/lib/db-entries/saml-application-config.d.ts +28 -1
- package/lib/db-entries/saml-application-config.js +45 -1
- package/lib/db-entries/saml-application-session.d.ts +40 -0
- package/lib/db-entries/saml-application-session.js +53 -0
- package/lib/foundations/jsonb-types/index.d.ts +1 -0
- package/lib/foundations/jsonb-types/index.js +1 -0
- package/lib/foundations/jsonb-types/saml-application-configs.d.ts +46 -5
- package/lib/foundations/jsonb-types/saml-application-configs.js +35 -4
- package/lib/foundations/jsonb-types/saml-application-configs.test.d.ts +1 -0
- package/lib/foundations/jsonb-types/saml-application-configs.test.js +49 -0
- package/lib/foundations/jsonb-types/saml-application-sessions.d.ts +45 -0
- package/lib/foundations/jsonb-types/saml-application-sessions.js +10 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +9 -1
- package/lib/foundations/jsonb-types/sign-in-experience.js +8 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/log/index.d.ts +5 -1
- package/lib/types/log/index.js +1 -0
- package/lib/types/log/saml.d.ts +7 -0
- package/lib/types/log/saml.js +6 -0
- package/lib/types/logto-config/index.d.ts +67 -67
- package/lib/types/logto-config/jwt-customizer.d.ts +117 -117
- package/lib/types/saml-application.d.ts +558 -0
- package/lib/types/saml-application.js +60 -0
- package/lib/types/system.d.ts +3 -0
- package/lib/types/system.js +1 -0
- package/lib/types/user.d.ts +7 -7
- package/package.json +6 -6
- package/tables/applications.sql +1 -4
- package/tables/saml_application_configs.sql +4 -6
- package/tables/saml_application_secrets.sql +1 -1
- package/tables/saml_application_sessions.sql +23 -0
- package/tables/sso_connector_idp_initiated_auth_configs.sql +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table saml_application_configs
|
|
9
|
+
rename constraint application_type
|
|
10
|
+
to saml_application_configs__application_type;
|
|
11
|
+
`);
|
|
12
|
+
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
alter table saml_application_secrets
|
|
15
|
+
rename constraint application_type
|
|
16
|
+
to saml_application_secrets__application_type;
|
|
17
|
+
`);
|
|
18
|
+
},
|
|
19
|
+
down: async (pool) => {
|
|
20
|
+
await pool.query(sql`
|
|
21
|
+
alter table saml_application_configs
|
|
22
|
+
rename constraint saml_application_configs__application_type
|
|
23
|
+
to application_type;
|
|
24
|
+
`);
|
|
25
|
+
|
|
26
|
+
await pool.query(sql`
|
|
27
|
+
alter table saml_application_secrets
|
|
28
|
+
rename constraint saml_application_secrets__application_type
|
|
29
|
+
to application_type;
|
|
30
|
+
`);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default alteration;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
9
|
+
drop constraint application_type;`);
|
|
10
|
+
|
|
11
|
+
await pool.query(sql`
|
|
12
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
13
|
+
add constraint application_type
|
|
14
|
+
check (check_application_type(default_application_id, 'Traditional', 'SPA', 'SAML'));
|
|
15
|
+
`);
|
|
16
|
+
},
|
|
17
|
+
down: async (pool) => {
|
|
18
|
+
await pool.query(sql`
|
|
19
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
20
|
+
drop constraint application_type;`);
|
|
21
|
+
|
|
22
|
+
await pool.query(sql`
|
|
23
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
24
|
+
add constraint application_type
|
|
25
|
+
check (check_application_type(default_application_id, 'Traditional', 'SPA'));
|
|
26
|
+
`);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default alteration;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
6
|
+
|
|
7
|
+
const alteration: AlterationScript = {
|
|
8
|
+
up: async (pool) => {
|
|
9
|
+
await pool.query(sql`
|
|
10
|
+
create table saml_application_sessions (
|
|
11
|
+
tenant_id varchar(21) not null
|
|
12
|
+
references tenants (id) on update cascade on delete cascade,
|
|
13
|
+
id varchar(32) not null,
|
|
14
|
+
application_id varchar(21) not null
|
|
15
|
+
references applications (id) on update cascade on delete cascade,
|
|
16
|
+
saml_request_id varchar(128) not null,
|
|
17
|
+
oidc_state varchar(32),
|
|
18
|
+
relay_state varchar(256),
|
|
19
|
+
raw_auth_request text not null,
|
|
20
|
+
created_at timestamptz not null default(now()),
|
|
21
|
+
expires_at timestamptz not null,
|
|
22
|
+
primary key (tenant_id, id),
|
|
23
|
+
constraint saml_application_sessions__application_type
|
|
24
|
+
check (check_application_type(application_id, 'SAML'))
|
|
25
|
+
);
|
|
26
|
+
`);
|
|
27
|
+
await applyTableRls(pool, 'saml_application_sessions');
|
|
28
|
+
},
|
|
29
|
+
down: async (pool) => {
|
|
30
|
+
await dropTableRls(pool, 'saml_application_sessions');
|
|
31
|
+
await pool.query(sql`
|
|
32
|
+
drop table if exists saml_application_sessions;
|
|
33
|
+
`);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default alteration;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
enum NameIdFormat {
|
|
6
|
+
/** Uses unique and persistent identifiers for the user. */
|
|
7
|
+
Persistent = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const alteration: AlterationScript = {
|
|
11
|
+
up: async (pool) => {
|
|
12
|
+
await pool.query(sql`
|
|
13
|
+
alter table saml_application_configs
|
|
14
|
+
add column encryption jsonb,
|
|
15
|
+
add column name_id_format varchar(128);
|
|
16
|
+
`);
|
|
17
|
+
await pool.query(sql`
|
|
18
|
+
update saml_application_configs
|
|
19
|
+
set name_id_format = ${NameIdFormat.Persistent};
|
|
20
|
+
`);
|
|
21
|
+
await pool.query(sql`
|
|
22
|
+
alter table saml_application_configs
|
|
23
|
+
alter column name_id_format set not null;
|
|
24
|
+
`);
|
|
25
|
+
},
|
|
26
|
+
down: async (pool) => {
|
|
27
|
+
await pool.query(sql`
|
|
28
|
+
alter table saml_application_configs
|
|
29
|
+
drop column encryption,
|
|
30
|
+
drop column name_id_format;
|
|
31
|
+
`);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default alteration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table applications drop constraint check_saml_app_third_party_consistency;
|
|
9
|
+
`);
|
|
10
|
+
await pool.query(sql`
|
|
11
|
+
update applications set is_third_party = false
|
|
12
|
+
where type = 'SAML';
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
down: async (pool) => {
|
|
16
|
+
await pool.query(sql`
|
|
17
|
+
update applications set is_third_party = true
|
|
18
|
+
where type = 'SAML';
|
|
19
|
+
`);
|
|
20
|
+
await pool.query(sql`
|
|
21
|
+
alter table applications
|
|
22
|
+
add constraint check_saml_app_third_party_consistency
|
|
23
|
+
check (type != 'SAML' OR (type = 'SAML' AND is_third_party = true));
|
|
24
|
+
`);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default alteration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table saml_application_configs
|
|
6
|
+
rename constraint application_type
|
|
7
|
+
to saml_application_configs__application_type;
|
|
8
|
+
`);
|
|
9
|
+
await pool.query(sql `
|
|
10
|
+
alter table saml_application_secrets
|
|
11
|
+
rename constraint application_type
|
|
12
|
+
to saml_application_secrets__application_type;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
down: async (pool) => {
|
|
16
|
+
await pool.query(sql `
|
|
17
|
+
alter table saml_application_configs
|
|
18
|
+
rename constraint saml_application_configs__application_type
|
|
19
|
+
to application_type;
|
|
20
|
+
`);
|
|
21
|
+
await pool.query(sql `
|
|
22
|
+
alter table saml_application_secrets
|
|
23
|
+
rename constraint saml_application_secrets__application_type
|
|
24
|
+
to application_type;
|
|
25
|
+
`);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export default alteration;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
6
|
+
drop constraint application_type;`);
|
|
7
|
+
await pool.query(sql `
|
|
8
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
9
|
+
add constraint application_type
|
|
10
|
+
check (check_application_type(default_application_id, 'Traditional', 'SPA', 'SAML'));
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
down: async (pool) => {
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
16
|
+
drop constraint application_type;`);
|
|
17
|
+
await pool.query(sql `
|
|
18
|
+
alter table sso_connector_idp_initiated_auth_configs
|
|
19
|
+
add constraint application_type
|
|
20
|
+
check (check_application_type(default_application_id, 'Traditional', 'SPA'));
|
|
21
|
+
`);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default alteration;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
3
|
+
const alteration = {
|
|
4
|
+
up: async (pool) => {
|
|
5
|
+
await pool.query(sql `
|
|
6
|
+
create table saml_application_sessions (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
id varchar(32) not null,
|
|
10
|
+
application_id varchar(21) not null
|
|
11
|
+
references applications (id) on update cascade on delete cascade,
|
|
12
|
+
saml_request_id varchar(128) not null,
|
|
13
|
+
oidc_state varchar(32),
|
|
14
|
+
relay_state varchar(256),
|
|
15
|
+
raw_auth_request text not null,
|
|
16
|
+
created_at timestamptz not null default(now()),
|
|
17
|
+
expires_at timestamptz not null,
|
|
18
|
+
primary key (tenant_id, id),
|
|
19
|
+
constraint saml_application_sessions__application_type
|
|
20
|
+
check (check_application_type(application_id, 'SAML'))
|
|
21
|
+
);
|
|
22
|
+
`);
|
|
23
|
+
await applyTableRls(pool, 'saml_application_sessions');
|
|
24
|
+
},
|
|
25
|
+
down: async (pool) => {
|
|
26
|
+
await dropTableRls(pool, 'saml_application_sessions');
|
|
27
|
+
await pool.query(sql `
|
|
28
|
+
drop table if exists saml_application_sessions;
|
|
29
|
+
`);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export default alteration;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
var NameIdFormat;
|
|
3
|
+
(function (NameIdFormat) {
|
|
4
|
+
/** Uses unique and persistent identifiers for the user. */
|
|
5
|
+
NameIdFormat["Persistent"] = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent";
|
|
6
|
+
})(NameIdFormat || (NameIdFormat = {}));
|
|
7
|
+
const alteration = {
|
|
8
|
+
up: async (pool) => {
|
|
9
|
+
await pool.query(sql `
|
|
10
|
+
alter table saml_application_configs
|
|
11
|
+
add column encryption jsonb,
|
|
12
|
+
add column name_id_format varchar(128);
|
|
13
|
+
`);
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
update saml_application_configs
|
|
16
|
+
set name_id_format = ${NameIdFormat.Persistent};
|
|
17
|
+
`);
|
|
18
|
+
await pool.query(sql `
|
|
19
|
+
alter table saml_application_configs
|
|
20
|
+
alter column name_id_format set not null;
|
|
21
|
+
`);
|
|
22
|
+
},
|
|
23
|
+
down: async (pool) => {
|
|
24
|
+
await pool.query(sql `
|
|
25
|
+
alter table saml_application_configs
|
|
26
|
+
drop column encryption,
|
|
27
|
+
drop column name_id_format;
|
|
28
|
+
`);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export default alteration;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table applications drop constraint check_saml_app_third_party_consistency;
|
|
6
|
+
`);
|
|
7
|
+
await pool.query(sql `
|
|
8
|
+
update applications set is_third_party = false
|
|
9
|
+
where type = 'SAML';
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql `
|
|
14
|
+
update applications set is_third_party = true
|
|
15
|
+
where type = 'SAML';
|
|
16
|
+
`);
|
|
17
|
+
await pool.query(sql `
|
|
18
|
+
alter table applications
|
|
19
|
+
add constraint check_saml_app_third_party_consistency
|
|
20
|
+
check (type != 'SAML' OR (type = 'SAML' AND is_third_party = true));
|
|
21
|
+
`);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default alteration;
|
|
@@ -8,26 +8,27 @@ export declare enum ReservedPlanId {
|
|
|
8
8
|
Free = "free",
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* This plan ID will be renamed to `pro` after legacy Stripe data is migrated by @darcyYe
|
|
14
|
-
*
|
|
15
|
-
* Todo @darcyYe:
|
|
16
|
-
* - LOG-7846: Rename `hobby` to `pro` and `pro` to `legacy-pro`
|
|
17
|
-
* - LOG-8339: Migrate legacy Stripe data
|
|
11
|
+
* Grandfathered Pro plan ID deprecated from 2024-11.
|
|
12
|
+
* Use {@link Pro202411} instead.
|
|
18
13
|
*/
|
|
19
|
-
Hobby = "hobby",
|
|
20
14
|
Pro = "pro",
|
|
21
|
-
Enterprise = "enterprise",
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated
|
|
24
|
-
* Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
|
|
25
|
-
*/
|
|
26
|
-
GrandfatheredPro = "grandfathered-pro",
|
|
27
15
|
Development = "dev",
|
|
28
16
|
/**
|
|
29
17
|
* This plan ID is reserved for Admin tenant.
|
|
30
18
|
* In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
|
|
31
19
|
*/
|
|
32
|
-
Admin = "admin"
|
|
20
|
+
Admin = "admin",
|
|
21
|
+
/**
|
|
22
|
+
* The latest Pro plan ID applied from 2024-11.
|
|
23
|
+
*/
|
|
24
|
+
Pro202411 = "pro-202411"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Tenant subscription related Redis cache keys.
|
|
28
|
+
*
|
|
29
|
+
* We use Redis to cache the tenant subscription data to reduce the number of requests to the Cloud.
|
|
30
|
+
* Both @logto/core and @logto/cloud will need to access the cache, so we define the cache keys here as the SSOT.
|
|
31
|
+
*/
|
|
32
|
+
export declare enum SubscriptionRedisCacheKey {
|
|
33
|
+
Subscription = "subscription"
|
|
33
34
|
}
|
|
@@ -9,26 +9,28 @@ export var ReservedPlanId;
|
|
|
9
9
|
ReservedPlanId["Free"] = "free";
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* This plan ID will be renamed to `pro` after legacy Stripe data is migrated by @darcyYe
|
|
15
|
-
*
|
|
16
|
-
* Todo @darcyYe:
|
|
17
|
-
* - LOG-7846: Rename `hobby` to `pro` and `pro` to `legacy-pro`
|
|
18
|
-
* - LOG-8339: Migrate legacy Stripe data
|
|
12
|
+
* Grandfathered Pro plan ID deprecated from 2024-11.
|
|
13
|
+
* Use {@link Pro202411} instead.
|
|
19
14
|
*/
|
|
20
|
-
ReservedPlanId["Hobby"] = "hobby";
|
|
21
15
|
ReservedPlanId["Pro"] = "pro";
|
|
22
|
-
ReservedPlanId["Enterprise"] = "enterprise";
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated
|
|
25
|
-
* Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
|
|
26
|
-
*/
|
|
27
|
-
ReservedPlanId["GrandfatheredPro"] = "grandfathered-pro";
|
|
28
16
|
ReservedPlanId["Development"] = "dev";
|
|
29
17
|
/**
|
|
30
18
|
* This plan ID is reserved for Admin tenant.
|
|
31
19
|
* In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
|
|
32
20
|
*/
|
|
33
21
|
ReservedPlanId["Admin"] = "admin";
|
|
22
|
+
/**
|
|
23
|
+
* The latest Pro plan ID applied from 2024-11.
|
|
24
|
+
*/
|
|
25
|
+
ReservedPlanId["Pro202411"] = "pro-202411";
|
|
34
26
|
})(ReservedPlanId || (ReservedPlanId = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Tenant subscription related Redis cache keys.
|
|
29
|
+
*
|
|
30
|
+
* We use Redis to cache the tenant subscription data to reduce the number of requests to the Cloud.
|
|
31
|
+
* Both @logto/core and @logto/cloud will need to access the cache, so we define the cache keys here as the SSOT.
|
|
32
|
+
*/
|
|
33
|
+
export var SubscriptionRedisCacheKey;
|
|
34
|
+
(function (SubscriptionRedisCacheKey) {
|
|
35
|
+
SubscriptionRedisCacheKey["Subscription"] = "subscription";
|
|
36
|
+
})(SubscriptionRedisCacheKey || (SubscriptionRedisCacheKey = {}));
|
|
@@ -44,6 +44,7 @@ export * from './role.js';
|
|
|
44
44
|
export * from './roles-scope.js';
|
|
45
45
|
export * from './saml-application-config.js';
|
|
46
46
|
export * from './saml-application-secret.js';
|
|
47
|
+
export * from './saml-application-session.js';
|
|
47
48
|
export * from './scope.js';
|
|
48
49
|
export * from './sentinel-activity.js';
|
|
49
50
|
export * from './service-log.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export * from './role.js';
|
|
|
45
45
|
export * from './roles-scope.js';
|
|
46
46
|
export * from './saml-application-config.js';
|
|
47
47
|
export * from './saml-application-secret.js';
|
|
48
|
+
export * from './saml-application-session.js';
|
|
48
49
|
export * from './scope.js';
|
|
49
50
|
export * from './sentinel-activity.js';
|
|
50
51
|
export * from './service-log.js';
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import { SamlAttributeMapping, SamlAcsUrl, SamlEncryption, NameIdFormat, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link SamlApplicationConfig} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateSamlApplicationConfig = {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
attributeMapping?: SamlAttributeMapping;
|
|
12
|
+
entityId?: string | null;
|
|
13
|
+
acsUrl?: SamlAcsUrl | null;
|
|
14
|
+
encryption?: SamlEncryption | null;
|
|
15
|
+
nameIdFormat: NameIdFormat;
|
|
16
|
+
};
|
|
17
|
+
/** The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application. */
|
|
18
|
+
export type SamlApplicationConfig = {
|
|
19
|
+
applicationId: string;
|
|
20
|
+
tenantId: string;
|
|
21
|
+
attributeMapping: SamlAttributeMapping;
|
|
22
|
+
entityId: string | null;
|
|
23
|
+
acsUrl: SamlAcsUrl | null;
|
|
24
|
+
encryption: SamlEncryption | null;
|
|
25
|
+
nameIdFormat: NameIdFormat;
|
|
26
|
+
};
|
|
27
|
+
export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl' | 'encryption' | 'nameIdFormat';
|
|
28
|
+
export declare const SamlApplicationConfigs: GeneratedSchema<SamlApplicationConfigKeys, CreateSamlApplicationConfig, SamlApplicationConfig, 'saml_application_configs', 'saml_application_config'>;
|
|
@@ -1,2 +1,46 @@
|
|
|
1
1
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
-
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { samlAttributeMappingGuard, samlAcsUrlGuard, samlEncryptionGuard, nameIdFormatGuard } from './../foundations/index.js';
|
|
4
|
+
const createGuard = z.object({
|
|
5
|
+
applicationId: z.string().min(1).max(21),
|
|
6
|
+
tenantId: z.string().max(21).optional(),
|
|
7
|
+
attributeMapping: samlAttributeMappingGuard.optional(),
|
|
8
|
+
entityId: z.string().max(128).nullable().optional(),
|
|
9
|
+
acsUrl: samlAcsUrlGuard.nullable().optional(),
|
|
10
|
+
encryption: samlEncryptionGuard.nullable().optional(),
|
|
11
|
+
nameIdFormat: nameIdFormatGuard,
|
|
12
|
+
});
|
|
13
|
+
const guard = z.object({
|
|
14
|
+
applicationId: z.string().min(1).max(21),
|
|
15
|
+
tenantId: z.string().max(21),
|
|
16
|
+
attributeMapping: samlAttributeMappingGuard,
|
|
17
|
+
entityId: z.string().max(128).nullable(),
|
|
18
|
+
acsUrl: samlAcsUrlGuard.nullable(),
|
|
19
|
+
encryption: samlEncryptionGuard.nullable(),
|
|
20
|
+
nameIdFormat: nameIdFormatGuard,
|
|
21
|
+
});
|
|
22
|
+
export const SamlApplicationConfigs = Object.freeze({
|
|
23
|
+
table: 'saml_application_configs',
|
|
24
|
+
tableSingular: 'saml_application_config',
|
|
25
|
+
fields: {
|
|
26
|
+
applicationId: 'application_id',
|
|
27
|
+
tenantId: 'tenant_id',
|
|
28
|
+
attributeMapping: 'attribute_mapping',
|
|
29
|
+
entityId: 'entity_id',
|
|
30
|
+
acsUrl: 'acs_url',
|
|
31
|
+
encryption: 'encryption',
|
|
32
|
+
nameIdFormat: 'name_id_format',
|
|
33
|
+
},
|
|
34
|
+
fieldKeys: [
|
|
35
|
+
'applicationId',
|
|
36
|
+
'tenantId',
|
|
37
|
+
'attributeMapping',
|
|
38
|
+
'entityId',
|
|
39
|
+
'acsUrl',
|
|
40
|
+
'encryption',
|
|
41
|
+
'nameIdFormat',
|
|
42
|
+
],
|
|
43
|
+
createGuard,
|
|
44
|
+
guard,
|
|
45
|
+
updateGuard: guard.partial(),
|
|
46
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link SamlApplicationSession} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateSamlApplicationSession = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
/** The globally unique identifier of the session. */
|
|
10
|
+
id: string;
|
|
11
|
+
applicationId: string;
|
|
12
|
+
/** The identifier of the SAML SSO auth request ID, SAML request ID is pretty long. */
|
|
13
|
+
samlRequestId: string;
|
|
14
|
+
/** The identifier of the OIDC auth request state. */
|
|
15
|
+
oidcState?: string | null;
|
|
16
|
+
/** The relay state of the SAML auth request. */
|
|
17
|
+
relayState?: string | null;
|
|
18
|
+
/** The raw request of the SAML auth request. */
|
|
19
|
+
rawAuthRequest: string;
|
|
20
|
+
createdAt?: number;
|
|
21
|
+
expiresAt: number;
|
|
22
|
+
};
|
|
23
|
+
export type SamlApplicationSession = {
|
|
24
|
+
tenantId: string;
|
|
25
|
+
/** The globally unique identifier of the session. */
|
|
26
|
+
id: string;
|
|
27
|
+
applicationId: string;
|
|
28
|
+
/** The identifier of the SAML SSO auth request ID, SAML request ID is pretty long. */
|
|
29
|
+
samlRequestId: string;
|
|
30
|
+
/** The identifier of the OIDC auth request state. */
|
|
31
|
+
oidcState: string | null;
|
|
32
|
+
/** The relay state of the SAML auth request. */
|
|
33
|
+
relayState: string | null;
|
|
34
|
+
/** The raw request of the SAML auth request. */
|
|
35
|
+
rawAuthRequest: string;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
expiresAt: number;
|
|
38
|
+
};
|
|
39
|
+
export type SamlApplicationSessionKeys = 'tenantId' | 'id' | 'applicationId' | 'samlRequestId' | 'oidcState' | 'relayState' | 'rawAuthRequest' | 'createdAt' | 'expiresAt';
|
|
40
|
+
export declare const SamlApplicationSessions: GeneratedSchema<SamlApplicationSessionKeys, CreateSamlApplicationSession, SamlApplicationSession, 'saml_application_sessions', 'saml_application_session'>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
id: z.string().min(1).max(32),
|
|
6
|
+
applicationId: z.string().min(1).max(21),
|
|
7
|
+
samlRequestId: z.string().min(1).max(128),
|
|
8
|
+
oidcState: z.string().max(32).nullable().optional(),
|
|
9
|
+
relayState: z.string().max(256).nullable().optional(),
|
|
10
|
+
rawAuthRequest: z.string().min(1),
|
|
11
|
+
createdAt: z.number().optional(),
|
|
12
|
+
expiresAt: z.number(),
|
|
13
|
+
});
|
|
14
|
+
const guard = z.object({
|
|
15
|
+
tenantId: z.string().max(21),
|
|
16
|
+
id: z.string().min(1).max(32),
|
|
17
|
+
applicationId: z.string().min(1).max(21),
|
|
18
|
+
samlRequestId: z.string().min(1).max(128),
|
|
19
|
+
oidcState: z.string().max(32).nullable(),
|
|
20
|
+
relayState: z.string().max(256).nullable(),
|
|
21
|
+
rawAuthRequest: z.string().min(1),
|
|
22
|
+
createdAt: z.number(),
|
|
23
|
+
expiresAt: z.number(),
|
|
24
|
+
});
|
|
25
|
+
export const SamlApplicationSessions = Object.freeze({
|
|
26
|
+
table: 'saml_application_sessions',
|
|
27
|
+
tableSingular: 'saml_application_session',
|
|
28
|
+
fields: {
|
|
29
|
+
tenantId: 'tenant_id',
|
|
30
|
+
id: 'id',
|
|
31
|
+
applicationId: 'application_id',
|
|
32
|
+
samlRequestId: 'saml_request_id',
|
|
33
|
+
oidcState: 'oidc_state',
|
|
34
|
+
relayState: 'relay_state',
|
|
35
|
+
rawAuthRequest: 'raw_auth_request',
|
|
36
|
+
createdAt: 'created_at',
|
|
37
|
+
expiresAt: 'expires_at',
|
|
38
|
+
},
|
|
39
|
+
fieldKeys: [
|
|
40
|
+
'tenantId',
|
|
41
|
+
'id',
|
|
42
|
+
'applicationId',
|
|
43
|
+
'samlRequestId',
|
|
44
|
+
'oidcState',
|
|
45
|
+
'relayState',
|
|
46
|
+
'rawAuthRequest',
|
|
47
|
+
'createdAt',
|
|
48
|
+
'expiresAt',
|
|
49
|
+
],
|
|
50
|
+
createGuard,
|
|
51
|
+
guard,
|
|
52
|
+
updateGuard: guard.partial(),
|
|
53
|
+
});
|
|
@@ -11,5 +11,6 @@ export * from './applications.js';
|
|
|
11
11
|
export * from './verification-records.js';
|
|
12
12
|
export * from './account-centers.js';
|
|
13
13
|
export * from './saml-application-configs.js';
|
|
14
|
+
export * from './saml-application-sessions.js';
|
|
14
15
|
export { configurableConnectorMetadataGuard, type ConfigurableConnectorMetadata, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
|
|
15
16
|
export type { Json, JsonObject } from '@withtyped/server';
|
|
@@ -11,4 +11,5 @@ export * from './applications.js';
|
|
|
11
11
|
export * from './verification-records.js';
|
|
12
12
|
export * from './account-centers.js';
|
|
13
13
|
export * from './saml-application-configs.js';
|
|
14
|
+
export * from './saml-application-sessions.js';
|
|
14
15
|
export { configurableConnectorMetadataGuard, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
|