@wtfalch/foundry 0.50.1 → 0.51.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/dist/migrations/0061_org_signin_in_app_nullable.sql +20 -0
- package/dist/org.d.ts +2 -2
- package/dist/plan/platform-providers.js +2 -2
- package/dist/plan/sign-in.d.ts +1 -1
- package/dist/plan/sign-in.js +2 -2
- package/dist/store/postgres.js +3 -3
- package/dist/store/schema.d.ts +2 -2
- package/dist/store/schema.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- @wtfalch/foundry: `signin_in_app` says "absent" again. In-app sign-in is on by default, so NULL
|
|
2
|
+
-- (the field is not declared) means on, false is a declared off, true a declared on. Every stored
|
|
3
|
+
-- false so far was the old column default, never a choice: it becomes NULL. Runs once: a later run
|
|
4
|
+
-- finds the column already nullable and leaves the declared values alone.
|
|
5
|
+
-- Mirrors src/store/schema.ts's `declaredOrgs`.
|
|
6
|
+
|
|
7
|
+
do $$
|
|
8
|
+
begin
|
|
9
|
+
if exists (
|
|
10
|
+
select 1 from information_schema.columns
|
|
11
|
+
where table_schema = current_schema()
|
|
12
|
+
and table_name = 'foundry_declared_orgs'
|
|
13
|
+
and column_name = 'signin_in_app'
|
|
14
|
+
and is_nullable = 'NO'
|
|
15
|
+
) then
|
|
16
|
+
alter table foundry_declared_orgs alter column signin_in_app drop not null;
|
|
17
|
+
alter table foundry_declared_orgs alter column signin_in_app drop default;
|
|
18
|
+
update foundry_declared_orgs set signin_in_app = null where signin_in_app = false;
|
|
19
|
+
end if;
|
|
20
|
+
end $$;
|
package/dist/org.d.ts
CHANGED
|
@@ -725,7 +725,7 @@ export interface ServicesConfig {
|
|
|
725
725
|
}
|
|
726
726
|
export declare const SFU_SLOT_MAX = 20;
|
|
727
727
|
/**
|
|
728
|
-
* Per-company sign-in placement. `inApp` (default off) moves the people's sign-in from the
|
|
728
|
+
* Per-company sign-in placement. `inApp` (default on: absent means on, `false` turns it off) moves the people's sign-in from the
|
|
729
729
|
* company's login host onto each app's own address (`/sign-in` on agora.<domain>, boule.<domain>),
|
|
730
730
|
* through the login that serves that path. Read through `plan/sign-in.ts`'s `inAppSignIn`.
|
|
731
731
|
*/
|
|
@@ -1053,7 +1053,7 @@ export interface DeclaredOrg {
|
|
|
1053
1053
|
hosting: HostingConfig;
|
|
1054
1054
|
/** Absent means `{ own: false }`. Optional so every existing literal and test fixture compiles unchanged, as `calls.versionPin` and `MailConfig.mailApps` do. */
|
|
1055
1055
|
services?: ServicesConfig;
|
|
1056
|
-
/** Absent means `{ inApp:
|
|
1056
|
+
/** Absent means `{ inApp: true }`. Optional so every existing literal and fixture compiles unchanged. */
|
|
1057
1057
|
signIn?: SignInConfig;
|
|
1058
1058
|
/** The company's Boule. Absent means no blue/green. */
|
|
1059
1059
|
boule?: OrgBuiltinApp;
|
|
@@ -4006,7 +4006,7 @@ async function switchOnArchonIdTokenUserinfo(context, deps) {
|
|
|
4006
4006
|
// The planner plans nothing without the method; a stale plan does nothing.
|
|
4007
4007
|
if (!ownerSignIn || !zitadel?.updateOidcAppIdTokenUserinfoAssertion)
|
|
4008
4008
|
return {};
|
|
4009
|
-
const orgId = ownerSignIn.organisationId;
|
|
4009
|
+
const orgId = recorded[PLATFORM_ARCHON_CLIENT_ORG_SCOPE_KEY] ?? ownerSignIn.organisationId;
|
|
4010
4010
|
const projectId = recorded[PLATFORM_ARCHON_ZITADEL_PROJECT_SCOPE_KEY];
|
|
4011
4011
|
const appId = recorded[PLATFORM_ARCHON_ZITADEL_APP_SCOPE_KEY];
|
|
4012
4012
|
if (!orgId || !projectId || !appId) {
|
|
@@ -4091,7 +4091,7 @@ async function registerArchonDesktopCallback(context, deps) {
|
|
|
4091
4091
|
if (!ownerSignIn || !zitadel?.getOidcAppRedirectUris || !zitadel.updateOidcAppRedirectUris) {
|
|
4092
4092
|
return {};
|
|
4093
4093
|
}
|
|
4094
|
-
const orgId = ownerSignIn.organisationId;
|
|
4094
|
+
const orgId = recorded[PLATFORM_ARCHON_CLIENT_ORG_SCOPE_KEY] ?? ownerSignIn.organisationId;
|
|
4095
4095
|
const projectId = recorded[PLATFORM_ARCHON_ZITADEL_PROJECT_SCOPE_KEY];
|
|
4096
4096
|
const appId = recorded[PLATFORM_ARCHON_ZITADEL_APP_SCOPE_KEY];
|
|
4097
4097
|
const hostname = recorded[PLATFORM_ARCHON_CLIENT_HOSTNAME_SCOPE_KEY];
|
package/dist/plan/sign-in.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare const SIGN_IN_RATE_LIMIT_SCOPE_KEY = "ratelimit_in_app";
|
|
|
68
68
|
export declare const SIGN_IN_RATE_LIMIT_DESCRIPTION = "foundry: rate limit sign-in paths (in-app)";
|
|
69
69
|
export declare const SIGN_IN_RATE_LIMIT_EXPRESSION = "(starts_with(http.request.uri.path, \"/auth/\")) or (starts_with(http.request.uri.path, \"/sign-in/\") and not starts_with(http.request.uri.path, \"/sign-in/_next/\"))";
|
|
70
70
|
/**
|
|
71
|
-
* True when the company has the switch on and it applies: a company domain whose login host is
|
|
71
|
+
* True when the company has the switch on (absent counts as on; only `inApp: false` turns it off) and it applies: a company domain whose login host is
|
|
72
72
|
* `auth.<domain>` (`issuer.usesDomain`) and the shared sign-in. A tier 1 company on `oikos.host` keeps
|
|
73
73
|
* today's flow even when the switch is set (the declaration is refused: `org.ts`'s `validateSignIn`).
|
|
74
74
|
*/
|
package/dist/plan/sign-in.js
CHANGED
|
@@ -72,12 +72,12 @@ export const SIGN_IN_RATE_LIMIT_SCOPE_KEY = 'ratelimit_in_app';
|
|
|
72
72
|
export const SIGN_IN_RATE_LIMIT_DESCRIPTION = 'foundry: rate limit sign-in paths (in-app)';
|
|
73
73
|
export const SIGN_IN_RATE_LIMIT_EXPRESSION = '(starts_with(http.request.uri.path, "/auth/")) or (starts_with(http.request.uri.path, "/sign-in/") and not starts_with(http.request.uri.path, "/sign-in/_next/"))';
|
|
74
74
|
/**
|
|
75
|
-
* True when the company has the switch on and it applies: a company domain whose login host is
|
|
75
|
+
* True when the company has the switch on (absent counts as on; only `inApp: false` turns it off) and it applies: a company domain whose login host is
|
|
76
76
|
* `auth.<domain>` (`issuer.usesDomain`) and the shared sign-in. A tier 1 company on `oikos.host` keeps
|
|
77
77
|
* today's flow even when the switch is set (the declaration is refused: `org.ts`'s `validateSignIn`).
|
|
78
78
|
*/
|
|
79
79
|
export function inAppSignIn(org) {
|
|
80
|
-
return org.signIn?.inApp
|
|
80
|
+
return org.signIn?.inApp !== false && Boolean(org.domain) && org.issuer.usesDomain;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* True when an app's live env holds `SIGNIN_UPSTREAM` and the desired env does not: it is to be removed.
|
package/dist/store/postgres.js
CHANGED
|
@@ -154,8 +154,8 @@ function rowToOrg(row) {
|
|
|
154
154
|
},
|
|
155
155
|
}
|
|
156
156
|
: {}),
|
|
157
|
-
//
|
|
158
|
-
...(row.signInInApp ? { signIn: { inApp:
|
|
157
|
+
// NULL is an absent field (on by default); false and true are declared.
|
|
158
|
+
...(row.signInInApp === null ? {} : { signIn: { inApp: row.signInInApp } }),
|
|
159
159
|
// Omitted while off.
|
|
160
160
|
...(row.customersEnabled || row.customersSignUp
|
|
161
161
|
? { customers: { enabled: row.customersEnabled, signUp: row.customersSignUp } }
|
|
@@ -226,7 +226,7 @@ function orgToRow(org) {
|
|
|
226
226
|
callsVersionPinSynapse: org.calls.versionPin?.synapse ?? null,
|
|
227
227
|
callsVersionPinMas: org.calls.versionPin?.mas ?? null,
|
|
228
228
|
issuerUsesDomain: org.issuer.usesDomain,
|
|
229
|
-
signInInApp: org.signIn?.inApp ??
|
|
229
|
+
signInInApp: org.signIn?.inApp ?? null,
|
|
230
230
|
customersEnabled: org.customers?.enabled ?? false,
|
|
231
231
|
customersSignUp: org.customers?.signUp ?? false,
|
|
232
232
|
bouleBlueGreen: org.boule?.blueGreen ?? null,
|
package/dist/store/schema.d.ts
CHANGED
|
@@ -362,8 +362,8 @@ export declare const declaredOrgs: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
362
362
|
columnType: "PgBoolean";
|
|
363
363
|
data: boolean;
|
|
364
364
|
driverParam: boolean;
|
|
365
|
-
notNull:
|
|
366
|
-
hasDefault:
|
|
365
|
+
notNull: false;
|
|
366
|
+
hasDefault: false;
|
|
367
367
|
isPrimaryKey: false;
|
|
368
368
|
isAutoincrement: false;
|
|
369
369
|
hasRuntimeDefault: false;
|
package/dist/store/schema.js
CHANGED
|
@@ -38,8 +38,8 @@ export const declaredOrgs = pgTable('foundry_declared_orgs', {
|
|
|
38
38
|
// ServicesConfig (org.ts): false and null are the platform's shared services.
|
|
39
39
|
servicesOwn: boolean('services_own').notNull().default(false),
|
|
40
40
|
servicesSfuSlot: integer('services_sfu_slot'),
|
|
41
|
-
// SignInConfig.inApp (org.ts); migrations/0054.
|
|
42
|
-
signInInApp: boolean('signin_in_app')
|
|
41
|
+
// SignInConfig.inApp (org.ts); migrations/0054, nullable in 0061: NULL is an absent field (on).
|
|
42
|
+
signInInApp: boolean('signin_in_app'),
|
|
43
43
|
// CustomersConfig (org.ts); migrations/0057.
|
|
44
44
|
customersEnabled: boolean('customers_enabled').notNull().default(false),
|
|
45
45
|
customersSignUp: boolean('customers_sign_up').notNull().default(false),
|