Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add token to web ACL and token routes #42734

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions web/packages/teleport/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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;
},
Expand Down
2 changes: 2 additions & 0 deletions web/packages/teleport/src/teleportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -241,6 +242,7 @@ export const disabledFeatureFlags: types.FeatureFlags = {
trustedClusters: false,
users: false,
newAccessRequest: false,
tokens: false,
accessRequests: false,
downloadCenter: false,
supportLink: false,
Expand Down
1 change: 1 addition & 0 deletions web/packages/teleport/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading