@spotto/contract 1.0.69-alpha.24 → 1.0.69-alpha.25

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.
@@ -1,12 +1,22 @@
1
1
  import { SsoConfig } from '../../organisations/sso';
2
+ import { SamlIdpSetup } from '../idp-setup';
2
3
  /**
3
- * Response shape for `GET /sso/orgs/:id`. Always returns a discriminated
4
- * `SsoConfig` — for orgs without SSO, the response is `{ enabled: false }`
5
- * rather than 404, so the FE can drive its UI from the discriminator
6
- * without separate "exists" handling.
4
+ * Response shape for `GET /sso/orgs/:id`.
5
+ *
6
+ * `config` is the persisted SSO config always a discriminated `SsoConfig`,
7
+ * with `{ enabled: false }` for orgs that don't have SSO (rather than 404),
8
+ * so the FE can drive its UI from the discriminator without separate
9
+ * "exists" handling.
10
+ *
11
+ * `samlSetup` is populated only when `config.mode === 'saml'`. Carries the
12
+ * values the operator needs to paste into their IdP's SAML config dialog.
13
+ * Absent for OIDC and disabled orgs.
7
14
  *
8
15
  * Scoped to super-users only (via `sso:admin` + cross-account ancestry).
9
16
  * The customer-facing `GET /organisations/:id` deliberately does NOT
10
17
  * include this — SSO config is super-user-only data in the short term.
11
18
  */
12
- export declare type GetSsoOrgResponse = SsoConfig;
19
+ export interface GetSsoOrgResponse {
20
+ config: SsoConfig;
21
+ samlSetup?: SamlIdpSetup;
22
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * IdP-side configuration values an operator needs to plug into their IdP
3
+ * (e.g. Auth0's SAML2 Web App "Settings" JSON) to complete the SSO setup.
4
+ *
5
+ * Returned on the onboard and GET-org-SSO responses so the super-user UI
6
+ * can render copy-paste blocks. Generic-shaped — the FE renders them in
7
+ * the IdP-specific format the operator's tool expects (Auth0, Entra,
8
+ * Okta, etc., all take similar values in slightly different containers).
9
+ *
10
+ * The `acsUrl` (where the IdP POSTs the SAML response) is not in this
11
+ * payload because the FE already knows its Cognito hosted UI domain and
12
+ * can compose `${domain}/saml2/idpresponse` itself — keeps the backend
13
+ * free of an extra hosted-UI-domain config knob.
14
+ */
15
+ export interface SamlIdpSetup {
16
+ /**
17
+ * The Cognito SP audience URN. For Auth0 SAML2 Web App, paste into the
18
+ * "audience" field. For Entra / Okta, the equivalent "Entity ID" /
19
+ * "Audience" field.
20
+ */
21
+ audience: string;
22
+ /**
23
+ * SAML attribute name mappings. Key is the Cognito-side user attribute
24
+ * name; value is the SAML attribute Name the IdP must emit. Auth0
25
+ * SAML2 Web App's "mappings" field takes this shape directly.
26
+ */
27
+ mappings: Record<string, string>;
28
+ /**
29
+ * NameID format Cognito expects from the IdP.
30
+ */
31
+ nameIdentifierFormat: string;
32
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=idp-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idp-setup.js","sourceRoot":"","sources":["../../src/sso/idp-setup.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
1
  export * from './discover';
2
2
  export * from './get';
3
+ export * from './idp-setup';
3
4
  export * from './onboard';
4
5
  export * from './offboard';
5
6
  export * from './revert';
package/dist/sso/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./discover"), exports);
18
18
  __exportStar(require("./get"), exports);
19
+ __exportStar(require("./idp-setup"), exports);
19
20
  __exportStar(require("./onboard"), exports);
20
21
  __exportStar(require("./offboard"), exports);
21
22
  __exportStar(require("./revert"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sso/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,wCAAqB;AACrB,4CAAyB;AACzB,6CAA0B;AAC1B,2CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sso/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,wCAAqB;AACrB,8CAA2B;AAC3B,4CAAyB;AACzB,6CAA0B;AAC1B,2CAAwB"}
@@ -1,3 +1,4 @@
1
+ import { SamlIdpSetup } from '../idp-setup';
1
2
  /**
2
3
  * Response shape for `POST /sso/orgs/:id/onboard`. Returned on the success
3
4
  * path; on failure the standard ValidationError / DatabaseError envelope
@@ -10,9 +11,15 @@
10
11
  *
11
12
  * `correlationId` threads through every audit log entry for this onboard
12
13
  * — useful to surface in the UI for ops to copy-paste when investigating.
14
+ *
15
+ * `samlSetup` is populated only on SAML onboards. It carries the values
16
+ * the operator needs to plug into their IdP's SAML config dialog (Auth0
17
+ * SAML2 Web App, Entra Enterprise Application, Okta SAML app, etc.).
18
+ * Absent for OIDC onboards.
13
19
  */
14
20
  export interface OnboardSsoOrgResponse {
15
21
  cognitoProviderName: string;
16
22
  cognitoClientId: string;
17
23
  correlationId: string;
24
+ samlSetup?: SamlIdpSetup;
18
25
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "1.0.69-alpha.24",
4
+ "version": "1.0.69-alpha.25",
5
5
  "description": "Spotto's API Contract type definitions",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -18,5 +18,5 @@
18
18
  "@types/geojson": "^7946.0.11",
19
19
  "shx": "^0.3.4"
20
20
  },
21
- "gitHead": "892aa327162a98a8547b9e5142afabbe3a814ccd"
21
+ "gitHead": "2ab8570d50d19b2f98dc4da3708762a2d40eb66a"
22
22
  }