Skip to content

Commit

Permalink
feat: Backend/type changes for Okta Integration enrolment improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kiosion committed Feb 4, 2025
1 parent 7ceae1b commit c34e938
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ func (h *Handler) bindDefaultEndpoints() {
h.GET("/webapi/scripts/integrations/configure/gcp-workforce-saml.sh", h.WithLimiter(h.gcpWorkforceConfigScript))

// Okta integration endpoints.
h.GET("/.well-known/jwks-okta", h.WithLimiter(h.jwksOkta))
h.GET(OktaJWKSURI, h.WithLimiter(h.jwksOkta))

// Azure OIDC integration endpoints
h.GET("/webapi/scripts/integrations/configure/azureoidc.sh", h.WithLimiter(h.azureOIDCConfigure))
Expand Down
2 changes: 2 additions & 0 deletions lib/web/oidcidp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
const (
// OIDCJWKWURI is the relative path where the OIDC IdP JWKS is located
OIDCJWKWURI = "/.well-known/jwks-oidc"
// OktaJWKSURI is the relative path where the Okta JWKS is located
OktaJWKSURI = "/.well-known/jwks-okta"
)

// openidConfiguration returns the openid-configuration for setting up the AWS OIDC Integration
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Notifications/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function Notification({
if (view === 'Unread' && notification.clicked) {
// If this is a text content notification, the dialog should still be renderable. This is to prevent the text content dialog immediately disappearing
// when trying to open an unread text notification, since clicking on the notification instantly marks it as read.
if (content.kind == 'text') {
if (content.kind === 'text') {
return (
<Dialog open={showTextContentDialog} className={IGNORE_CLICK_CLASSNAME}>
<DialogHeader>
Expand Down
16 changes: 10 additions & 6 deletions web/packages/teleport/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ const cfg = {
kubernetes: '/web/cluster/:clusterId/kubernetes',
headlessSso: `/web/headless/:requestId`,
integrations: '/web/integrations',
integrationStatus: '/web/integrations/status/:type/:name',
integrationEnroll: '/web/integrations/new/:type?',
integrationStatus: '/web/integrations/status/:type/:name/:page?',
integrationEnroll: '/web/integrations/new/:type?/:page?',
locks: '/web/locks',
newLock: '/web/locks/new',
requests: '/web/requests/:requestId?',
Expand Down Expand Up @@ -558,12 +558,16 @@ const cfg = {
return generatePath(cfg.routes.audit, { clusterId });
},

getIntegrationEnrollRoute(type?: string) {
return generatePath(cfg.routes.integrationEnroll, { type });
getIntegrationEnrollRoute(type?: string, page?: string) {
return generatePath(cfg.routes.integrationEnroll, { type, page });
},

getIntegrationStatusRoute(type: PluginKind | IntegrationKind, name: string) {
return generatePath(cfg.routes.integrationStatus, { type, name });
getIntegrationStatusRoute(
type: PluginKind | IntegrationKind,
name: string,
page?: string
) {
return generatePath(cfg.routes.integrationStatus, { type, name, page });
},

getMsTeamsAppZipRoute(clusterId: string, plugin: string) {
Expand Down
39 changes: 31 additions & 8 deletions web/packages/teleport/src/services/integrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { PluginStatusOkta } from 'teleport/services/integrations/oktaStatusTypes';
import { Label } from 'teleport/types';

import { ResourceLabel } from '../agents';
Expand Down Expand Up @@ -185,14 +186,21 @@ export type PluginStatus<D = any> = {
details?: D;
};

export type PluginSpec =
| PluginOktaSpec
| PluginSlackSpec
| PluginMattermostSpec
| PluginOpsgenieSpec
| PluginDatadogSpec
| PluginEmailSpec
| PluginMsTeamsSpec;
export type PluginNameToSpec = {
okta: PluginOktaSpec;
slack: PluginSlackSpec;
mattermost: PluginMattermostSpec;
opsgenie: PluginOpsgenieSpec;
datadog: PluginDatadogSpec;
email: PluginEmailSpec;
msteams: PluginMsTeamsSpec;
[key: string]: any;
};

export type PluginNameToDetails = {
okta: PluginStatusOkta;
[key: string]: any;
};

// PluginKind represents the type of the plugin
// and should be the same value as defined in the backend (check master branch for the latest):
Expand Down Expand Up @@ -240,6 +248,21 @@ export type PluginOktaSpec = {
* the Okta org's base URL
*/
orgUrl: string;

enableUserSync?: boolean;
enableAccessListSync?: boolean;
enableAppGroupSync?: boolean;

/**
* contains currently configured credentials for the plugin
*/
credentialsInfo?: CredentialsInfo;
};

export type CredentialsInfo = {
hasSSMSToken?: boolean;
hasConfiguredOauthCredentials?: boolean;
hasSCIMToken?: boolean;
};

export type PluginSlackSpec = {
Expand Down

0 comments on commit c34e938

Please sign in to comment.