2018-09-25 16:28:26 +00:00
|
|
|
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,
|
|
|
|
// We have to leave this here because the backend doesn't support the file type yet.
|
2018-04-03 14:16:57 +00:00
|
|
|
credentials: attr('string', {
|
|
|
|
editType: 'file',
|
|
|
|
}),
|
|
|
|
|
|
|
|
googleCertsEndpoint: attr('string'),
|
|
|
|
|
|
|
|
fieldGroups: computed(function() {
|
2019-02-14 18:52:34 +00:00
|
|
|
let groups = [
|
2018-04-03 14:16:57 +00:00
|
|
|
{ default: ['credentials'] },
|
|
|
|
{
|
|
|
|
'Google Cloud Options': ['googleCertsEndpoint'],
|
|
|
|
},
|
|
|
|
];
|
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);
|
|
|
|
}),
|
|
|
|
});
|