Skip to content

Commit

Permalink
Switch context for generic oidc provider to the genericOIDCConfig type (
Browse files Browse the repository at this point in the history
  • Loading branch information
jordojordo authored Jul 2, 2024
1 parent ccc602c commit bd70d4c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ authConfig:
title: Are you sure? This update is irreversible.
body: '<p><b>You may need to make some additional changes</b>. Please ensure the Azure AD app has the Directory.Read.All <b>Application</b> permission added to Microsoft Graph.<br> If any endpoints were customized while configuring Azure AD authentication in Rancher, they will not be automatically updated. </p>'
oidc:
oidc: Configure an OIDC account
genericoidc: Configure an OIDC account
keycloakoidc: Configure a Keycloak OIDC account
rancherUrl: Rancher URL
clientId: Client ID
Expand Down Expand Up @@ -6582,7 +6582,7 @@ model:
okta: Okta
freeipa: FreeIPA
googleoauth: Google
oidc: Generic OIDC
genericoidc: Generic OIDC
keycloakoidc: Keycloak

cluster:
Expand Down
2 changes: 1 addition & 1 deletion shell/config/product/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function init(store) {
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/googleoauth`, 'auth/googleoauth');
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/azuread`, 'auth/azuread');
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/keycloakoidc`, 'auth/oidc');
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/oidc`, 'auth/oidc');
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/genericoidc`, 'auth/oidc');

basicType([
'config',
Expand Down
4 changes: 2 additions & 2 deletions shell/edit/auth/__tests__/oidc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const validScope = 'openid profile email';

const mockModel = {
enabled: false,
id: 'oidc',
id: 'genericoidc',
rancherUrl: validRancherUrl,
issuer: validIssuer,
authEndpoint: validAuthEndpoint,
scope: validScope,
clientId: validClientId,
clientSecret: validClientSecret,
type: 'oidcConfig',
type: 'genericOIDCConfig',
};

const mockedAuthConfigMixin = {
Expand Down
2 changes: 1 addition & 1 deletion shell/mixins/auth-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default {

// KeyCloakOIDCConfig --> OIDCConfig
set(this.model, 'rancherUrl', `${ serverUrl }/verify-auth`);
set(this.model, 'scope', BASE_SCOPES.oidc[0]);
set(this.model, 'scope', this.model.id === 'keycloakoidc' ? BASE_SCOPES.keycloakoidc[0] : BASE_SCOPES.genericoidc[0]);
break;
}

Expand Down
4 changes: 2 additions & 2 deletions shell/models/management.cattle.io.authconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const configType = {
local: '',
github: 'oauth',
keycloakoidc: 'oidc',
oidc: 'oidc',
genericoidc: 'oidc',
};

const imageOverrides = { keycloakoidc: 'keycloak', oidc: 'openid' };
const imageOverrides = { keycloakoidc: 'keycloak', genericoidc: 'openid' };

export default class AuthConfig extends SteveModel {
get _availableActions() {
Expand Down
2 changes: 1 addition & 1 deletion shell/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const BASE_SCOPES = {
googleoauth: ['openid profile email'],
azuread: [],
keycloakoidc: ['openid profile email'],
oidc: ['openid profile email'],
genericoidc: ['openid profile email'],
};

const KEY = 'rc_nonce';
Expand Down
2 changes: 1 addition & 1 deletion shell/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const authProvidersInfo = async(store) => {
const nonLocal = rows.filter((x) => x.name !== 'local');
const enabled = nonLocal.filter((x) => x.enabled === true );

const supportedNonLocal = nonLocal.filter((x) => x.id !== 'genericoidc');
const supportedNonLocal = nonLocal.filter((x) => x.id !== 'oidc');

const enabledLocation = enabled.length === 1 ? {
name: 'c-cluster-auth-config-id',
Expand Down

0 comments on commit bd70d4c

Please sign in to comment.