open-vault/ui/app/models/auth-config/kubernetes.js

47 lines
1.3 KiB
JavaScript
Raw Normal View History

import { computed } from '@ember/object';
2018-04-03 14:16:57 +00:00
import DS from 'ember-data';
import AuthConfig from '../auth-config';
2019-02-14 18:52:34 +00:00
import { combineFieldGroups } from 'vault/utils/openapi-to-attrs';
2018-04-03 14:16:57 +00:00
import fieldToAttrs from 'vault/utils/field-to-attrs';
const { attr } = DS;
export default AuthConfig.extend({
2019-02-14 18:52:34 +00:00
useOpenAPI: true,
2018-04-03 14:16:57 +00:00
kubernetesHost: attr('string', {
helpText:
'Host must be a host string, a host:port pair, or a URL to the base of the Kubernetes API server',
}),
kubernetesCaCert: attr('string', {
editType: 'file',
helpText: 'PEM encoded CA cert for use by the TLS client used to talk with the Kubernetes API',
}),
tokenReviewerJwt: attr('string', {
helpText:
'A service account JWT used to access the TokenReview API to validate other JWTs during login. If not set the JWT used for login will be used to access the API',
}),
pemKeys: attr({
editType: 'stringArray',
}),
fieldGroups: computed(function() {
2019-02-14 18:52:34 +00:00
let groups = [
2018-04-03 14:16:57 +00:00
{
default: ['kubernetesHost', 'kubernetesCaCert'],
},
{
'Kubernetes Options': ['tokenReviewerJwt', 'pemKeys'],
},
];
2019-02-14 18:52:34 +00:00
if (this.newFields) {
groups = combineFieldGroups(groups, this.newFields, []);
}
2018-04-03 14:16:57 +00:00
return fieldToAttrs(this, groups);
}),
});