vault/ui/app/helpers/mountable-auth-methods.js
Austin Gebauer 21bd134ad2
ui: adds a new auth form option (#22640)
* ui: adds a new auth form option

* add warning if nonsecure context, cleanup

* more ember-y

* Only show saml auth method for enterprise, plus tests

* Use error message helper

* Dont include saml on community auth list

* Add allSupportedAuthBackends method

* change token request from GET to PUT to match backend change

* Fetch role on sign in, cancel login after timeout

* saml acceptance test

* Add changelog

* saml test only on enterprise

* set the acs_url according to which cluster the UI is served from

* prepare namespace in addition to path with a helper func

---------

Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com>
2023-09-08 08:53:26 -07:00

123 lines
2.1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { helper as buildHelper } from '@ember/component/helper';
const ENTERPRISE_AUTH_METHODS = [
{
displayName: 'SAML',
value: 'saml',
type: 'saml',
category: 'generic',
},
];
const MOUNTABLE_AUTH_METHODS = [
{
displayName: 'AliCloud',
value: 'alicloud',
type: 'alicloud',
category: 'cloud',
},
{
displayName: 'AppRole',
value: 'approle',
type: 'approle',
category: 'generic',
},
{
displayName: 'AWS',
value: 'aws',
type: 'aws',
category: 'cloud',
glyph: 'aws-color',
},
{
displayName: 'Azure',
value: 'azure',
type: 'azure',
category: 'cloud',
glyph: 'azure-color',
},
{
displayName: 'Google Cloud',
value: 'gcp',
type: 'gcp',
category: 'cloud',
glyph: 'gcp-color',
},
{
displayName: 'GitHub',
value: 'github',
type: 'github',
category: 'cloud',
glyph: 'github-color',
},
{
displayName: 'JWT',
value: 'jwt',
type: 'jwt',
glyph: 'auth',
category: 'generic',
},
{
displayName: 'OIDC',
value: 'oidc',
type: 'oidc',
glyph: 'auth',
category: 'generic',
},
{
displayName: 'Kubernetes',
value: 'kubernetes',
type: 'kubernetes',
category: 'infra',
glyph: 'kubernetes-color',
},
{
displayName: 'LDAP',
value: 'ldap',
type: 'ldap',
glyph: 'auth',
category: 'infra',
},
{
displayName: 'Okta',
value: 'okta',
type: 'okta',
category: 'infra',
glyph: 'okta-color',
},
{
displayName: 'RADIUS',
value: 'radius',
type: 'radius',
glyph: 'auth',
category: 'infra',
},
{
displayName: 'TLS Certificates',
value: 'cert',
type: 'cert',
category: 'generic',
},
{
displayName: 'Username & Password',
value: 'userpass',
type: 'userpass',
category: 'generic',
},
];
export function methods() {
return MOUNTABLE_AUTH_METHODS.slice();
}
export function allMethods() {
return [...MOUNTABLE_AUTH_METHODS, ...ENTERPRISE_AUTH_METHODS];
}
export default buildHelper(methods);