vault/ui/app/helpers/supported-auth-backends.js
Dan Rivera 008835ba36
UI: Surface plugin version & cleanup utils (#31001)
* surface plugin version & removing mountable-auth-methods.js

* UI: Removing mountable-secret-engines.js (#30950)

* first pass, removing all related imports

* fix usage

* fix category

* fix typos

* fix more tests

* fix more tests pt2

* attempting WIF const removal

* fix wif tests, removing config consts

* fixing tests

* please

* removing fallback

* cleanup

* fix type ent test

* remove isaddon

* Revert "remove isaddon"

This reverts commit ee114197b7299711e35e3c8e5aca9694063726eb.

* adding tab click

* update case

* fix case, rename to isOnlyMountable

* fix backend form

* more test fix

* adding changelog

* pr comments

* renaming params, adding requiresADP

* updates

* updates and pr comments

* perhaps update the test
2025-06-19 15:10:09 -04:00

99 lines
2.5 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { helper as buildHelper } from '@ember/component/helper';
/**
* These are all the auth methods with which a user can log into the UI.
*/
const SUPPORTED_AUTH_BACKENDS = [
{
type: 'token',
typeDisplay: 'Token',
description: 'Token authentication.',
tokenPath: 'id',
displayNamePath: 'display_name',
formAttributes: ['token'],
},
{
type: 'userpass',
typeDisplay: 'Username',
description: 'A simple username and password backend.',
tokenPath: 'client_token',
displayNamePath: 'metadata.username',
formAttributes: ['username', 'password'],
},
{
type: 'ldap',
typeDisplay: 'LDAP',
description: 'LDAP authentication.',
tokenPath: 'client_token',
displayNamePath: 'metadata.username',
formAttributes: ['username', 'password'],
},
{
type: 'okta',
typeDisplay: 'Okta',
description: 'Authenticate with your Okta username and password.',
tokenPath: 'client_token',
displayNamePath: 'metadata.username',
formAttributes: ['username', 'password'],
},
{
type: 'jwt',
typeDisplay: 'JWT',
description: 'Authenticate using JWT or OIDC provider.',
tokenPath: 'client_token',
displayNamePath: 'display_name',
formAttributes: ['role', 'jwt'],
},
{
type: 'oidc',
typeDisplay: 'OIDC',
description: 'Authenticate using JWT or OIDC provider.',
tokenPath: 'client_token',
displayNamePath: 'display_name',
formAttributes: ['role', 'jwt'],
},
{
type: 'radius',
typeDisplay: 'RADIUS',
description: 'Authenticate with your RADIUS username and password.',
tokenPath: 'client_token',
displayNamePath: 'metadata.username',
formAttributes: ['username', 'password'],
},
{
type: 'github',
typeDisplay: 'GitHub',
description: 'GitHub authentication.',
tokenPath: 'client_token',
displayNamePath: ['metadata.org', 'metadata.username'],
formAttributes: ['token'],
},
];
const ENTERPRISE_AUTH_METHODS = [
{
type: 'saml',
typeDisplay: 'SAML',
description: 'Authenticate using SAML provider.',
tokenPath: 'client_token',
displayNamePath: 'display_name',
formAttributes: ['role'],
},
];
export function supportedAuthBackends() {
return [...SUPPORTED_AUTH_BACKENDS];
}
export function allSupportedAuthBackends() {
return [...SUPPORTED_AUTH_BACKENDS, ...ENTERPRISE_AUTH_METHODS];
}
export default buildHelper(supportedAuthBackends);