2018-09-25 16:28:26 +00:00
|
|
|
import { computed } from '@ember/object';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2020-03-17 15:49:47 +00:00
|
|
|
import DS from 'ember-data';
|
2018-04-03 14:16:57 +00:00
|
|
|
import AuthConfig from '../auth-config';
|
|
|
|
import fieldToAttrs from 'vault/utils/field-to-attrs';
|
2019-02-14 18:52:34 +00:00
|
|
|
import { combineFieldGroups } from 'vault/utils/openapi-to-attrs';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2020-03-17 15:49:47 +00:00
|
|
|
const { attr } = DS;
|
|
|
|
|
2018-04-03 14:16:57 +00:00
|
|
|
export default AuthConfig.extend({
|
2019-02-14 18:52:34 +00:00
|
|
|
useOpenAPI: true,
|
2020-03-17 15:49:47 +00:00
|
|
|
certificate: attr({
|
|
|
|
label: 'Certificate',
|
|
|
|
editType: 'textarea',
|
|
|
|
}),
|
2018-04-03 14:16:57 +00:00
|
|
|
fieldGroups: computed(function() {
|
2019-02-14 18:52:34 +00:00
|
|
|
let groups = [
|
2018-04-03 14:16:57 +00:00
|
|
|
{
|
|
|
|
default: ['url'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'LDAP Options': [
|
|
|
|
'starttls',
|
|
|
|
'insecureTls',
|
|
|
|
'discoverdn',
|
|
|
|
'denyNullBind',
|
|
|
|
'tlsMinVersion',
|
|
|
|
'tlsMaxVersion',
|
|
|
|
'certificate',
|
2020-03-06 18:27:09 +00:00
|
|
|
'clientTlsCert',
|
|
|
|
'clientTlsKey',
|
2018-04-03 14:16:57 +00:00
|
|
|
'userattr',
|
|
|
|
'upndomain',
|
2020-03-06 18:27:09 +00:00
|
|
|
'anonymousGroupSearch',
|
2018-04-03 14:16:57 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'Customize User Search': ['binddn', 'userdn', 'bindpass'],
|
|
|
|
},
|
|
|
|
{
|
2018-08-13 21:57:10 +00:00
|
|
|
'Customize Group Membership Search': ['groupfilter', 'groupattr', 'groupdn', 'useTokenGroups'],
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
];
|
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);
|
|
|
|
}),
|
|
|
|
});
|