mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-16 11:37:04 +02:00
* Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License. Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUS-1.1 * Fix test that expected exact offset on hcl file --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Sarah Thompson <sthompson@hashicorp.com> Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
118 lines
3.0 KiB
JavaScript
118 lines
3.0 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { helper as buildHelper } from '@ember/component/helper';
|
|
import { pluralize } from 'ember-inflector';
|
|
import { capitalize } from '@ember/string';
|
|
|
|
const TABS_FOR_SETTINGS = {
|
|
aws: [
|
|
{
|
|
label: 'Client',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'client'],
|
|
},
|
|
{
|
|
label: 'Identity Allow List Tidy',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'identity-accesslist'],
|
|
},
|
|
{
|
|
label: 'Role Tag Deny List Tidy',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'roletag-denylist'],
|
|
},
|
|
],
|
|
azure: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
github: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
gcp: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
jwt: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
oidc: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
kubernetes: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
ldap: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
okta: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
radius: [
|
|
{
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
|
},
|
|
],
|
|
};
|
|
|
|
const TABS_FOR_SHOW = {};
|
|
|
|
export function tabsForAuthSection([model, sectionType = 'authSettings', paths]) {
|
|
let tabs;
|
|
if (sectionType === 'authSettings') {
|
|
tabs = (TABS_FOR_SETTINGS[model.type] || []).slice();
|
|
tabs.push({
|
|
label: 'Method Options',
|
|
routeParams: ['vault.cluster.settings.auth.configure.section', 'options'],
|
|
});
|
|
return tabs;
|
|
}
|
|
if (paths || model.paths) {
|
|
if (model.paths) {
|
|
paths = model.paths.paths.filter((path) => path.navigation);
|
|
}
|
|
|
|
// TODO: we're unsure if we actually need compact here
|
|
// but are leaving it just in case OpenAPI ever returns an empty thing
|
|
tabs = paths.compact().map((path) => {
|
|
return {
|
|
label: capitalize(pluralize(path.itemName)),
|
|
routeParams: ['vault.cluster.access.method.item.list', path.itemType],
|
|
};
|
|
});
|
|
} else {
|
|
tabs = (TABS_FOR_SHOW[model.type] || []).slice();
|
|
}
|
|
tabs.push({
|
|
label: 'Configuration',
|
|
routeParams: ['vault.cluster.access.method.section', 'configuration'],
|
|
});
|
|
|
|
return tabs;
|
|
}
|
|
|
|
export default buildHelper(tabsForAuthSection);
|