mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* updates api client vars to snake_case for custom messages * updates api client vars to snake_case for tools * updates api client vars to snake_case for sync * updates api client vars to snake_case for secrets engine * updates api client vars to snake_case for auth * updates api client vars to snake_case for usage * updates api client dep to point to gh repo * fixes custom-messages service unit tests * fixes configure-ssh test * fixes configure-ssh test...again
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { toLabel } from 'core/helpers/to-label';
|
|
import { get } from '@ember/object';
|
|
|
|
import type AuthMethodResource from 'vault/resources/auth/method';
|
|
|
|
interface Args {
|
|
method: AuthMethodResource;
|
|
}
|
|
export default class AuthMethodConfigurationComponent extends Component<Args> {
|
|
displayFields = [
|
|
'type',
|
|
'path',
|
|
'description',
|
|
'accessor',
|
|
'local',
|
|
'seal_wrap',
|
|
'config.listing_visibility',
|
|
'config.default_lease_ttl',
|
|
'config.max_lease_ttl',
|
|
'config.token_type',
|
|
'config.audit_non_hmac_request_keys',
|
|
'config.audit_non_hmac_response_keys',
|
|
'config.passthrough_request_headers',
|
|
'config.allowed_response_headers',
|
|
'config.plugin_version',
|
|
];
|
|
|
|
label = (field: string) => {
|
|
const key = field.replace('config.', '');
|
|
const label = toLabel([key]);
|
|
// map specific fields to custom labels
|
|
return (
|
|
{
|
|
listing_visibility: 'Use as preferred UI login method',
|
|
default_lease_ttl: 'Default Lease TTL',
|
|
max_lease_ttl: 'Max Lease TTL',
|
|
audit_non_hmac_request_keys: 'Request keys excluded from HMACing in audit',
|
|
audit_non_hmac_response_keys: 'Response keys excluded from HMACing in audit',
|
|
passthrough_request_headers: 'Allowed passthrough request headers',
|
|
}[key] || label
|
|
);
|
|
};
|
|
value = (field: string) => {
|
|
const { method } = this.args;
|
|
if (field === 'config.listing_visibility') {
|
|
return method.config.listing_visibility === 'unauth';
|
|
}
|
|
return get(method, field);
|
|
};
|
|
|
|
isTtl = (field: string) => {
|
|
return ['config.default_lease_ttl', 'config.max_lease_ttl'].includes(field);
|
|
};
|
|
}
|