@fabrika/installation-init 0.9.0-dev.12 → 0.9.0-dev.14
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/package.json +6 -6
- package/src/admin.ts +17 -8
- package/src/auth-methods.ts +90 -0
- package/src/index.ts +15 -0
- package/src/service-environment.ts +32 -7
- package/types/src/admin.d.ts +6 -1
- package/types/src/auth-methods.d.ts +34 -0
- package/types/src/index.d.ts +2 -1
- package/types/src/service-environment.d.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/installation-init",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"zod": "^3.25.76",
|
|
31
|
-
"@fabrika/app": "0.9.0-dev.
|
|
32
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
33
|
-
"@fabrika/email": "0.9.0-dev.
|
|
34
|
-
"@fabrika/iam-contract": "0.9.0-dev.
|
|
35
|
-
"@fabrika/proxy-core": "0.9.0-dev.
|
|
31
|
+
"@fabrika/app": "0.9.0-dev.14",
|
|
32
|
+
"@fabrika/auth-core": "0.9.0-dev.14",
|
|
33
|
+
"@fabrika/email": "0.9.0-dev.14",
|
|
34
|
+
"@fabrika/iam-contract": "0.9.0-dev.14",
|
|
35
|
+
"@fabrika/proxy-core": "0.9.0-dev.14"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/admin.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { createRpcClient, type InferRpcClient, RpcError, type RpcFetch } from '@fabrika/app'
|
|
20
|
-
import type { GrantDto, IamAdminRpcContract, PrincipalListItem } from '@fabrika/iam-contract'
|
|
20
|
+
import type { GrantDto, IamAdminRpcContract, PrincipalDetail, PrincipalListItem } from '@fabrika/iam-contract'
|
|
21
21
|
|
|
22
22
|
/** The built-in cross-app role. It is the one role that carries `iam.admin`, which the Access plane checks. */
|
|
23
23
|
export const ADMIN_ROLE_KEY = 'admin'
|
|
@@ -77,12 +77,16 @@ export interface FirstAdministratorRequest {
|
|
|
77
77
|
readonly reissueEnrollment?: boolean
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* What happened to the password enrollment. Only `issued` carries a URL, and only once. `single-sign-on`: the
|
|
82
|
+
* installation offers no password, so none was issued, and the administrator signs in through the identity provider.
|
|
83
|
+
*/
|
|
81
84
|
export type EnrollmentOutcome =
|
|
82
85
|
| { readonly state: 'issued'; readonly url: string; readonly expiresAt: number }
|
|
83
86
|
| { readonly state: 'emailed'; readonly email: string; readonly expiresAt: number }
|
|
84
87
|
| { readonly state: 'outstanding' }
|
|
85
88
|
| { readonly state: 'already-set' }
|
|
89
|
+
| { readonly state: 'single-sign-on' }
|
|
86
90
|
|
|
87
91
|
export interface FirstAdministratorResult {
|
|
88
92
|
readonly principalId: string
|
|
@@ -256,29 +260,34 @@ export const ensureFirstAdministrator = async (
|
|
|
256
260
|
email,
|
|
257
261
|
principal: admitted.state,
|
|
258
262
|
grant: granted ? 'present' : 'created',
|
|
259
|
-
enrollment: await ensureEnrollment(client, principal.id, detail.authentication
|
|
263
|
+
enrollment: await ensureEnrollment(client, principal.id, detail.authentication, request.reissueEnrollment === true),
|
|
260
264
|
}
|
|
261
265
|
}
|
|
262
266
|
|
|
263
267
|
/**
|
|
264
268
|
* Issue the password enrollment EXACTLY ONCE.
|
|
265
269
|
*
|
|
266
|
-
* `enabled` means a password is already set
|
|
270
|
+
* `enabled` means a password is already set: IAM answers 409 and there is nothing to admit. `pending`
|
|
267
271
|
* means an enrollment was already issued and never completed; a second URL is not issued for it,
|
|
268
272
|
* because "print the URL once" is the property a re-run has to keep, and `reissue` is the explicit way
|
|
269
273
|
* out when the first one expired unopened. `unavailable` means the installation offers no password
|
|
270
|
-
* method
|
|
274
|
+
* method: with single sign-on on, the principal and its grant are all an administrator needs, since an invited
|
|
275
|
+
* address signs in through the identity provider; with neither method IAM would not be serving, so that fails.
|
|
271
276
|
*/
|
|
272
277
|
const ensureEnrollment = async (
|
|
273
278
|
client: FirstAdministratorApi,
|
|
274
279
|
principalId: string,
|
|
275
|
-
|
|
280
|
+
authentication: PrincipalDetail['authentication'],
|
|
276
281
|
reissue: boolean,
|
|
277
282
|
): Promise<EnrollmentOutcome> => {
|
|
283
|
+
const state = authentication.password.state
|
|
278
284
|
if (state === 'unavailable') {
|
|
285
|
+
if (authentication.oidc.state !== 'unavailable') {
|
|
286
|
+
return { state: 'single-sign-on' }
|
|
287
|
+
}
|
|
279
288
|
throw new Error(
|
|
280
|
-
'this installation offers
|
|
281
|
-
+
|
|
289
|
+
'this installation offers neither password nor single sign-on, so the administrator has no way to sign in. The '
|
|
290
|
+
+ "principal and its cross-app admin grant are in place; fix IAM's FABRIKA_IAM_OIDC_ENABLED and FABRIKA_IAM_PASSWORD_ENABLED",
|
|
282
291
|
)
|
|
283
292
|
}
|
|
284
293
|
if (state === 'enabled') {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// IAM's human authentication methods as both installers take them: `--auth-methods`, or the pair of switches beside
|
|
2
|
+
// it, and the OIDC client's coordinates. What a provider writes for them, and what it defaults to when the operator
|
|
3
|
+
// names none, is the provider's own.
|
|
4
|
+
|
|
5
|
+
import { type CommandEnv, readEnv, readFlag } from './options'
|
|
6
|
+
|
|
7
|
+
export const AUTH_METHODS_FLAG = '--auth-methods'
|
|
8
|
+
export const OIDC_ISSUER_FLAG = '--oidc-issuer'
|
|
9
|
+
export const OIDC_CLIENT_ID_FLAG = '--oidc-client-id'
|
|
10
|
+
|
|
11
|
+
/** The installer's input names. IAM's own names differ per runtime; the provider maps them. */
|
|
12
|
+
export const OIDC_ISSUER_INPUT = 'FABRIKA_IAM_OIDC_ISSUER'
|
|
13
|
+
export const OIDC_CLIENT_ID_INPUT = 'FABRIKA_IAM_OIDC_CLIENT_ID'
|
|
14
|
+
/** A credential: environment only, and no flag. */
|
|
15
|
+
export const OIDC_CLIENT_SECRET_INPUT = 'FABRIKA_IAM_OIDC_CLIENT_SECRET'
|
|
16
|
+
|
|
17
|
+
const OIDC_ENABLED_VARIABLE = 'FABRIKA_IAM_OIDC_ENABLED'
|
|
18
|
+
const PASSWORD_ENABLED_VARIABLE = 'FABRIKA_IAM_PASSWORD_ENABLED'
|
|
19
|
+
|
|
20
|
+
const AUTH_METHODS = ['oidc', 'password'] as const
|
|
21
|
+
|
|
22
|
+
/** At least one method: IAM refuses to boot with neither, so neither is not a value. */
|
|
23
|
+
export type AuthMethods =
|
|
24
|
+
| { readonly oidcEnabled: true; readonly passwordEnabled: boolean }
|
|
25
|
+
| { readonly oidcEnabled: false; readonly passwordEnabled: true }
|
|
26
|
+
|
|
27
|
+
/** The OIDC client IAM signs people in with. */
|
|
28
|
+
export interface OidcClient {
|
|
29
|
+
readonly issuer: string
|
|
30
|
+
readonly clientId: string
|
|
31
|
+
/** Never logged, never printed. */
|
|
32
|
+
readonly clientSecret: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const authMethods = (oidcEnabled: boolean, passwordEnabled: boolean): AuthMethods => {
|
|
36
|
+
if (oidcEnabled) return { oidcEnabled: true, passwordEnabled }
|
|
37
|
+
if (passwordEnabled) return { oidcEnabled: false, passwordEnabled: true }
|
|
38
|
+
throw new Error('At least one IAM authentication method must be enabled')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const parseBoolean = (value: string, name: string): boolean => {
|
|
42
|
+
if (value === 'true') return true
|
|
43
|
+
if (value === 'false') return false
|
|
44
|
+
throw new Error(`${name} must be true or false`)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* `--auth-methods`, or the pair of switches the environment carries.
|
|
49
|
+
*
|
|
50
|
+
* With neither, `fallback` when the provider has one, and an error naming both ways in when it has none.
|
|
51
|
+
*/
|
|
52
|
+
export const readAuthMethods = (argv: readonly string[], env: CommandEnv, fallback?: AuthMethods): AuthMethods => {
|
|
53
|
+
const flag = readFlag(argv, AUTH_METHODS_FLAG)
|
|
54
|
+
if (flag !== undefined) {
|
|
55
|
+
const methods = flag.split(',').map((item) => item.trim())
|
|
56
|
+
const unknown = methods.find((method) => !AUTH_METHODS.some((known) => known === method))
|
|
57
|
+
if (unknown !== undefined || methods.length > AUTH_METHODS.length) {
|
|
58
|
+
throw new Error(`${AUTH_METHODS_FLAG} takes oidc, password, or oidc,password, not \`${flag}\``)
|
|
59
|
+
}
|
|
60
|
+
return authMethods(methods.includes('oidc'), methods.includes('password'))
|
|
61
|
+
}
|
|
62
|
+
const oidc = readEnv(env, OIDC_ENABLED_VARIABLE)
|
|
63
|
+
const password = readEnv(env, PASSWORD_ENABLED_VARIABLE)
|
|
64
|
+
if (oidc === undefined && password === undefined) {
|
|
65
|
+
if (fallback !== undefined) return fallback
|
|
66
|
+
throw new Error(
|
|
67
|
+
`${AUTH_METHODS_FLAG}=<oidc|password|oidc,password> or ${OIDC_ENABLED_VARIABLE} + ${PASSWORD_ENABLED_VARIABLE} is required`,
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
if (oidc === undefined || password === undefined) {
|
|
71
|
+
throw new Error(`${OIDC_ENABLED_VARIABLE} and ${PASSWORD_ENABLED_VARIABLE} must be configured together`)
|
|
72
|
+
}
|
|
73
|
+
return authMethods(parseBoolean(oidc, OIDC_ENABLED_VARIABLE), parseBoolean(password, PASSWORD_ENABLED_VARIABLE))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** An issuer IAM can discover `/.well-known/openid-configuration` under. The value is a public URL, so it is quoted. */
|
|
77
|
+
export const checkedOidcIssuer = (issuer: string): string => {
|
|
78
|
+
if (!URL.canParse(issuer)) {
|
|
79
|
+
throw new Error(`${OIDC_ISSUER_FLAG} / ${OIDC_ISSUER_INPUT} is not a URL: \`${issuer}\``)
|
|
80
|
+
}
|
|
81
|
+
return issuer
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A flag that only means something under a selection the run did not make is refused, not ignored. */
|
|
85
|
+
export const refuseFlags = (argv: readonly string[], flags: readonly string[], why: string): void => {
|
|
86
|
+
const given = flags.find((flag) => readFlag(argv, flag) !== undefined)
|
|
87
|
+
if (given !== undefined) {
|
|
88
|
+
throw new Error(`${given} was given, but ${why}`)
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,19 @@ export {
|
|
|
9
9
|
type IamAdminClient,
|
|
10
10
|
type IamAdminConnection,
|
|
11
11
|
} from './admin'
|
|
12
|
+
export {
|
|
13
|
+
AUTH_METHODS_FLAG,
|
|
14
|
+
type AuthMethods,
|
|
15
|
+
checkedOidcIssuer,
|
|
16
|
+
OIDC_CLIENT_ID_FLAG,
|
|
17
|
+
OIDC_CLIENT_ID_INPUT,
|
|
18
|
+
OIDC_CLIENT_SECRET_INPUT,
|
|
19
|
+
OIDC_ISSUER_FLAG,
|
|
20
|
+
OIDC_ISSUER_INPUT,
|
|
21
|
+
type OidcClient,
|
|
22
|
+
readAuthMethods,
|
|
23
|
+
refuseFlags,
|
|
24
|
+
} from './auth-methods'
|
|
12
25
|
export { CHECKOUT_FLAG, sidecarCheckoutDir } from './checkout'
|
|
13
26
|
export { type Confirmations, confirmations, UNATTENDED_FLAG } from './confirmations'
|
|
14
27
|
export { EMAIL_FLAGS, type InstallationEmail, readInstallationEmail } from './email'
|
|
@@ -68,7 +81,9 @@ export {
|
|
|
68
81
|
type DeployedServiceInput,
|
|
69
82
|
deriveIamProxySecret,
|
|
70
83
|
IAM_OAUTH_CONFIG_VARIABLE,
|
|
84
|
+
IAM_OIDC_CLIENT_SECRET_VARIABLE,
|
|
71
85
|
INSTALLATION_SECRET_VARIABLES,
|
|
86
|
+
type InstallationAuthentication,
|
|
72
87
|
installationServiceEnvironment,
|
|
73
88
|
type InstallationServiceInput,
|
|
74
89
|
type PlatformData,
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
// is where a service's data lives — a DSN or the cloud's reference to one — and where the proxy dials IAM
|
|
6
6
|
// privately; it adds the variables of its own cloud beside these and writes the result.
|
|
7
7
|
//
|
|
8
|
-
// IAM's Bun runtime reads `ISSUER` and `
|
|
9
|
-
// `FABRIKA_IAM_` prefix. Both spellings below are the ones it
|
|
8
|
+
// IAM's Bun runtime reads `ISSUER`, `ENVIRONMENT` and the OIDC client's `OIDC_*` UNPREFIXED and everything else
|
|
9
|
+
// with the `FABRIKA_IAM_` prefix (`packages/iam/src/node/runtime.ts`). Both spellings below are the ones it reads.
|
|
10
10
|
|
|
11
11
|
import { FABRIKA_SERVICE_TABLE_DIGEST, IAM_PROXY_SECRET_VARIABLE } from '@fabrika/auth-core'
|
|
12
12
|
import { createHmac } from 'node:crypto'
|
|
13
|
+
import type { OidcClient } from './auth-methods'
|
|
13
14
|
import type { InstallationEmail } from './email'
|
|
14
15
|
import type { IamOAuthConfig } from './mcp'
|
|
15
16
|
import { type PlatformHosts, platformOrigin } from './proxy-manifest'
|
|
@@ -24,6 +25,17 @@ export type PlatformServiceEnvironment = Readonly<Record<PlatformService, Readon
|
|
|
24
25
|
/** IAM's OAuth configuration for MCP clients (ADR-0049): written only when the installation enables MCP authoring. */
|
|
25
26
|
export const IAM_OAUTH_CONFIG_VARIABLE = 'FABRIKA_IAM_OAUTH_CONFIG'
|
|
26
27
|
|
|
28
|
+
/** IAM's OIDC client secret, as IAM's Bun runtime reads it. The operator's credential: written sensitive, never generated. */
|
|
29
|
+
export const IAM_OIDC_CLIENT_SECRET_VARIABLE = 'OIDC_CLIENT_SECRET'
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* How people sign in to IAM; `oidc` absent means OIDC is off. Neither method is not a value, as IAM refuses to boot
|
|
33
|
+
* with neither.
|
|
34
|
+
*/
|
|
35
|
+
export type InstallationAuthentication =
|
|
36
|
+
| { readonly passwordEnabled: true; readonly oidc?: OidcClient }
|
|
37
|
+
| { readonly passwordEnabled: false; readonly oidc: OidcClient }
|
|
38
|
+
|
|
27
39
|
/** An object store's coordinates, in the provider's own spelling (values or references to them). */
|
|
28
40
|
export interface PlatformStorage {
|
|
29
41
|
readonly bucket: string
|
|
@@ -58,6 +70,23 @@ export interface InstallationServiceInput extends PlatformPlacementInput {
|
|
|
58
70
|
readonly data: PlatformData
|
|
59
71
|
/** IAM sends its own mail with it, and Control hands it to applications whose job declares `mailer: 'installation'`. */
|
|
60
72
|
readonly email: InstallationEmail
|
|
73
|
+
readonly authentication: InstallationAuthentication
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* IAM's sign-in switches and, with OIDC on, its client. Both switches are STATED because IAM's own defaults are OIDC on
|
|
78
|
+
* and password off, and it refuses to boot with neither.
|
|
79
|
+
*
|
|
80
|
+
* Only the bring-up writes these. A deploy writes none of them and removes none, so a sign-in method an operator set
|
|
81
|
+
* by hand on an existing installation survives every later `platform deploy` and `platform upgrade`.
|
|
82
|
+
*/
|
|
83
|
+
const iamAuthentication = ({ passwordEnabled, oidc }: InstallationAuthentication): Array<[string, string]> => {
|
|
84
|
+
const switches: Array<[string, string]> = [
|
|
85
|
+
['FABRIKA_IAM_OIDC_ENABLED', String(oidc !== undefined)],
|
|
86
|
+
['FABRIKA_IAM_PASSWORD_ENABLED', String(passwordEnabled)],
|
|
87
|
+
]
|
|
88
|
+
if (oidc === undefined) return switches
|
|
89
|
+
return [...switches, ['OIDC_ISSUER', oidc.issuer], ['OIDC_CLIENT_ID', oidc.clientId], [IAM_OIDC_CLIENT_SECRET_VARIABLE, oidc.clientSecret]]
|
|
61
90
|
}
|
|
62
91
|
|
|
63
92
|
/** Compared byte-for-byte against a token's `iss`, so it is the PUBLIC issuer, never the private upstream. */
|
|
@@ -80,11 +109,7 @@ export const installationServiceEnvironment = (input: InstallationServiceInput):
|
|
|
80
109
|
['FABRIKA_IAM_DATABASE_URL', data.iamDatabase],
|
|
81
110
|
['ENVIRONMENT', input.environment],
|
|
82
111
|
['ISSUER', iamOrigin],
|
|
83
|
-
|
|
84
|
-
// asked for. Both are STATED because IAM's own defaults are the other way round — OIDC on,
|
|
85
|
-
// password off — and it refuses to boot with neither.
|
|
86
|
-
['FABRIKA_IAM_OIDC_ENABLED', 'false'],
|
|
87
|
-
['FABRIKA_IAM_PASSWORD_ENABLED', 'true'],
|
|
112
|
+
...iamAuthentication(input.authentication),
|
|
88
113
|
['FABRIKA_IAM_SIGNING_KEYS', secrets.signingKeys],
|
|
89
114
|
['FABRIKA_IAM_RPC_KEY', secrets.rpcKey],
|
|
90
115
|
['FABRIKA_IAM_PROXY_KEY', secrets.proxyKey],
|
package/types/src/admin.d.ts
CHANGED
|
@@ -58,7 +58,10 @@ export interface FirstAdministratorRequest {
|
|
|
58
58
|
*/
|
|
59
59
|
readonly reissueEnrollment?: boolean;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* What happened to the password enrollment. Only `issued` carries a URL, and only once. `single-sign-on`: the
|
|
63
|
+
* installation offers no password, so none was issued, and the administrator signs in through the identity provider.
|
|
64
|
+
*/
|
|
62
65
|
export type EnrollmentOutcome = {
|
|
63
66
|
readonly state: 'issued';
|
|
64
67
|
readonly url: string;
|
|
@@ -71,6 +74,8 @@ export type EnrollmentOutcome = {
|
|
|
71
74
|
readonly state: 'outstanding';
|
|
72
75
|
} | {
|
|
73
76
|
readonly state: 'already-set';
|
|
77
|
+
} | {
|
|
78
|
+
readonly state: 'single-sign-on';
|
|
74
79
|
};
|
|
75
80
|
export interface FirstAdministratorResult {
|
|
76
81
|
readonly principalId: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CommandEnv } from './options';
|
|
2
|
+
export declare const AUTH_METHODS_FLAG = "--auth-methods";
|
|
3
|
+
export declare const OIDC_ISSUER_FLAG = "--oidc-issuer";
|
|
4
|
+
export declare const OIDC_CLIENT_ID_FLAG = "--oidc-client-id";
|
|
5
|
+
/** The installer's input names. IAM's own names differ per runtime; the provider maps them. */
|
|
6
|
+
export declare const OIDC_ISSUER_INPUT = "FABRIKA_IAM_OIDC_ISSUER";
|
|
7
|
+
export declare const OIDC_CLIENT_ID_INPUT = "FABRIKA_IAM_OIDC_CLIENT_ID";
|
|
8
|
+
/** A credential: environment only, and no flag. */
|
|
9
|
+
export declare const OIDC_CLIENT_SECRET_INPUT = "FABRIKA_IAM_OIDC_CLIENT_SECRET";
|
|
10
|
+
/** At least one method: IAM refuses to boot with neither, so neither is not a value. */
|
|
11
|
+
export type AuthMethods = {
|
|
12
|
+
readonly oidcEnabled: true;
|
|
13
|
+
readonly passwordEnabled: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
readonly oidcEnabled: false;
|
|
16
|
+
readonly passwordEnabled: true;
|
|
17
|
+
};
|
|
18
|
+
/** The OIDC client IAM signs people in with. */
|
|
19
|
+
export interface OidcClient {
|
|
20
|
+
readonly issuer: string;
|
|
21
|
+
readonly clientId: string;
|
|
22
|
+
/** Never logged, never printed. */
|
|
23
|
+
readonly clientSecret: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `--auth-methods`, or the pair of switches the environment carries.
|
|
27
|
+
*
|
|
28
|
+
* With neither, `fallback` when the provider has one, and an error naming both ways in when it has none.
|
|
29
|
+
*/
|
|
30
|
+
export declare const readAuthMethods: (argv: readonly string[], env: CommandEnv, fallback?: AuthMethods) => AuthMethods;
|
|
31
|
+
/** An issuer IAM can discover `/.well-known/openid-configuration` under. The value is a public URL, so it is quoted. */
|
|
32
|
+
export declare const checkedOidcIssuer: (issuer: string) => string;
|
|
33
|
+
/** A flag that only means something under a selection the run did not make is refused, not ignored. */
|
|
34
|
+
export declare const refuseFlags: (argv: readonly string[], flags: readonly string[], why: string) => void;
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ADMIN_ROLE_KEY, createIamAdminClient, type EnrollmentOutcome, ensureFirstAdministrator, type FirstAdministratorApi, type FirstAdministratorRequest, type FirstAdministratorResult, type IamAdminClient, type IamAdminConnection, } from './admin';
|
|
2
|
+
export { AUTH_METHODS_FLAG, type AuthMethods, checkedOidcIssuer, OIDC_CLIENT_ID_FLAG, OIDC_CLIENT_ID_INPUT, OIDC_CLIENT_SECRET_INPUT, OIDC_ISSUER_FLAG, OIDC_ISSUER_INPUT, type OidcClient, readAuthMethods, refuseFlags, } from './auth-methods';
|
|
2
3
|
export { CHECKOUT_FLAG, sidecarCheckoutDir } from './checkout';
|
|
3
4
|
export { type Confirmations, confirmations, UNATTENDED_FLAG } from './confirmations';
|
|
4
5
|
export { EMAIL_FLAGS, type InstallationEmail, readInstallationEmail } from './email';
|
|
@@ -14,5 +15,5 @@ export { type PlatformHosts, type PlatformOAuthResourceTemplate, type PlatformOA
|
|
|
14
15
|
export { INITIAL_SCAFFOLD_COMMIT_MESSAGE, REFRESH_SCAFFOLD_COMMIT_MESSAGE, scaffoldSidecarRepository, type SidecarScaffoldEffects, type SidecarScaffoldInput, type SidecarScaffoldResult, } from './scaffold';
|
|
15
16
|
export { generateInstallationSecrets, generateSigningKeys, generateVaultKey, type InstallationSecrets, randomPxKey, randomSecret } from './secrets';
|
|
16
17
|
export { checkedSecretsFilePath, renderSecretsFile, SECRETS_FILE_FLAG, SECRETS_FILE_VARIABLE, writeSecretsFile } from './secrets-file';
|
|
17
|
-
export { deployedServiceEnvironment, type DeployedServiceInput, deriveIamProxySecret, IAM_OAUTH_CONFIG_VARIABLE, INSTALLATION_SECRET_VARIABLES, installationServiceEnvironment, type InstallationServiceInput, type PlatformData, type PlatformPlacementInput, type PlatformService, type PlatformServiceEnvironment, type PlatformStorage, } from './service-environment';
|
|
18
|
+
export { deployedServiceEnvironment, type DeployedServiceInput, deriveIamProxySecret, IAM_OAUTH_CONFIG_VARIABLE, IAM_OIDC_CLIENT_SECRET_VARIABLE, INSTALLATION_SECRET_VARIABLES, type InstallationAuthentication, installationServiceEnvironment, type InstallationServiceInput, type PlatformData, type PlatformPlacementInput, type PlatformService, type PlatformServiceEnvironment, type PlatformStorage, } from './service-environment';
|
|
18
19
|
export { attempt, capture, probe, run, type ShellAttempt, type ShellStep } from './shell';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OidcClient } from './auth-methods';
|
|
1
2
|
import type { InstallationEmail } from './email';
|
|
2
3
|
import type { IamOAuthConfig } from './mcp';
|
|
3
4
|
import { type PlatformHosts } from './proxy-manifest';
|
|
@@ -8,6 +9,19 @@ export type PlatformService = 'iam' | 'operations' | 'control' | 'proxy';
|
|
|
8
9
|
export type PlatformServiceEnvironment = Readonly<Record<PlatformService, ReadonlyMap<string, string>>>;
|
|
9
10
|
/** IAM's OAuth configuration for MCP clients (ADR-0049): written only when the installation enables MCP authoring. */
|
|
10
11
|
export declare const IAM_OAUTH_CONFIG_VARIABLE = "FABRIKA_IAM_OAUTH_CONFIG";
|
|
12
|
+
/** IAM's OIDC client secret, as IAM's Bun runtime reads it. The operator's credential: written sensitive, never generated. */
|
|
13
|
+
export declare const IAM_OIDC_CLIENT_SECRET_VARIABLE = "OIDC_CLIENT_SECRET";
|
|
14
|
+
/**
|
|
15
|
+
* How people sign in to IAM; `oidc` absent means OIDC is off. Neither method is not a value, as IAM refuses to boot
|
|
16
|
+
* with neither.
|
|
17
|
+
*/
|
|
18
|
+
export type InstallationAuthentication = {
|
|
19
|
+
readonly passwordEnabled: true;
|
|
20
|
+
readonly oidc?: OidcClient;
|
|
21
|
+
} | {
|
|
22
|
+
readonly passwordEnabled: false;
|
|
23
|
+
readonly oidc: OidcClient;
|
|
24
|
+
};
|
|
11
25
|
/** An object store's coordinates, in the provider's own spelling (values or references to them). */
|
|
12
26
|
export interface PlatformStorage {
|
|
13
27
|
readonly bucket: string;
|
|
@@ -39,6 +53,7 @@ export interface InstallationServiceInput extends PlatformPlacementInput {
|
|
|
39
53
|
readonly data: PlatformData;
|
|
40
54
|
/** IAM sends its own mail with it, and Control hands it to applications whose job declares `mailer: 'installation'`. */
|
|
41
55
|
readonly email: InstallationEmail;
|
|
56
|
+
readonly authentication: InstallationAuthentication;
|
|
42
57
|
}
|
|
43
58
|
/**
|
|
44
59
|
* EVERY fabrika variable a bring-up places, per service.
|