Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions src/datasets/identity/interface-client.dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ import { SYSTEM_REALM_ID } from "../../constants";
const CREATED_AT = new Date("2026-01-01T00:00:00.000Z");

const GRANT_TYPES = `{${TokenGrantType.AUTHORIZATION_CODE},${TokenGrantType.REFRESH_TOKEN}}`;
const WEB_AUTH_ADDRESS = "http://localhost:3000/auth/login";
const IDENTITY_PORT = 4002;

const DOCS_ROUTE = "/docs/";
const DOCS_PORTS = [4001, IDENTITY_PORT, 4003, 4004, 4005];
const DOCS_AUTH_ANCHOR = "#identity/tag/authn/POST/api/v1/authn/password";
const DOCS_AUTH_ADDRESS = `http://localhost:${IDENTITY_PORT}${DOCS_ROUTE}${DOCS_AUTH_ANCHOR}`;
const DOCS_REDIRECT_URIS = `{${DOCS_PORTS.map((port) => `http://localhost:${port}${DOCS_ROUTE}`).join(",")}}`;
const DOCS_AUTH_PATH = "/docs/#identity/tag/authn/POST/api/v1/authn/password";
const WEB_REDIRECT_URIS: string[] = JSON.parse(process.env.WEB_OAUTH_REDIRECT_URIS!);
const DOCS_REDIRECT_URIS: string[] = JSON.parse(process.env.DOCS_OAUTH_REDIRECT_URIS!);

export const WEB_INTERFACE_CLIENT_ID = "00000003-0000-4000-8000-130000000001";
export const DOCS_INTERFACE_CLIENT_ID = "00000003-0000-4000-8000-130000000002";
Expand All @@ -21,9 +16,9 @@ const dataset = [
id: WEB_INTERFACE_CLIENT_ID,
realm: SYSTEM_REALM_ID,
name: "MonadIAM Web App",
description: "Local development web client.",
auth_address: WEB_AUTH_ADDRESS,
redirect_uris: "{http://localhost:3000/main}",
description: "Web application client.",
auth_address: process.env.WEB_OAUTH_AUTH_ADDRESS!,
redirect_uris: `{${WEB_REDIRECT_URIS.map((url) => JSON.stringify(url)).join(",")}}`,
grant_types: GRANT_TYPES,
realm_version: 0,
is_system_managed: true,
Expand All @@ -38,8 +33,8 @@ const dataset = [
realm: SYSTEM_REALM_ID,
name: "MonadIAM API Docs",
description: "API reference client shared by the per-service Scalar pages.",
auth_address: DOCS_AUTH_ADDRESS,
redirect_uris: DOCS_REDIRECT_URIS,
auth_address: new URL(DOCS_AUTH_PATH, process.env.IDENTITY_SERVICE_URL!).href,
redirect_uris: `{${DOCS_REDIRECT_URIS.map((url) => JSON.stringify(url)).join(",")}}`,
grant_types: GRANT_TYPES,
realm_version: 0,
is_system_managed: true,
Expand Down