diff --git a/web/packages/teleport/src/config.ts b/web/packages/teleport/src/config.ts index 4069284503963..72d5388c2d055 100644 --- a/web/packages/teleport/src/config.ts +++ b/web/packages/teleport/src/config.ts @@ -138,6 +138,7 @@ const cfg = { accountPassword: '/web/account/password', accountMfaDevices: '/web/account/twofactor', roles: '/web/roles', + joinTokens: '/web/tokens', deviceTrust: `/web/devices`, deviceTrustAuthorize: '/web/device/authorize/:id?/:token?', sso: '/web/sso', @@ -256,6 +257,7 @@ const cfg = { connectMyComputerLoginsPath: '/v1/webapi/connectmycomputer/logins', joinTokenPath: '/v1/webapi/token', + joinTokensPath: '/v1/webapi/tokens', dbScriptPath: '/scripts/:token/install-database.sh', nodeScriptPath: '/scripts/:token/install-node.sh', appNodeScriptPath: '/scripts/:token/install-app.sh?name=:name&uri=:uri', @@ -487,6 +489,14 @@ const cfg = { return generatePath(cfg.routes.desktops, { clusterId }); }, + getJoinTokensRoute() { + return cfg.routes.joinTokens; + }, + + getJoinTokensUrl() { + return cfg.api.joinTokensPath; + }, + getJoinTokenUrl() { return cfg.api.joinTokenPath; }, diff --git a/web/packages/teleport/src/teleportContext.tsx b/web/packages/teleport/src/teleportContext.tsx index 6405a9a5e1305..3b2e4dbed2d57 100644 --- a/web/packages/teleport/src/teleportContext.tsx +++ b/web/packages/teleport/src/teleportContext.tsx @@ -217,6 +217,7 @@ class TeleportContext implements types.Context { accessMonitoring: hasAccessMonitoringAccess(), managementSection: hasManagementSectionAccess(), accessGraph: userContext.getAccessGraphAccess().list, + tokens: userContext.getTokenAccess().create, externalAuditStorage: userContext.getExternalAuditStorageAccess().list, listBots: userContext.getBotsAccess().list, addBots: userContext.getBotsAccess().create, @@ -241,6 +242,7 @@ export const disabledFeatureFlags: types.FeatureFlags = { trustedClusters: false, users: false, newAccessRequest: false, + tokens: false, accessRequests: false, downloadCenter: false, supportLink: false, diff --git a/web/packages/teleport/src/types.ts b/web/packages/teleport/src/types.ts index 48579bafa17da..6d7bbbab0c8b7 100644 --- a/web/packages/teleport/src/types.ts +++ b/web/packages/teleport/src/types.ts @@ -180,6 +180,7 @@ export interface FeatureFlags { deviceTrust: boolean; locks: boolean; newLocks: boolean; + tokens: boolean; accessMonitoring: boolean; // Whether or not the management section should be available. managementSection: boolean;