mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-11 09:51:16 -04:00
move key mixin to the mixin dir and update imports - also use it in secret-v2 model
This commit is contained in:
parent
5c8a71b67a
commit
940b69bc07
4 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { match } from '@ember/object/computed';
|
||||
import DS from 'ember-data';
|
||||
import KeyMixin from './key-mixin';
|
||||
import KeyMixin from 'vault/mixins/key-mixin';
|
||||
const { attr } = DS;
|
||||
|
||||
/* sample response
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ import DS from 'ember-data';
|
|||
import { computed } from '@ember/object';
|
||||
import { match } from '@ember/object/computed';
|
||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||
import KeyMixin from 'vault/mixins/key-mixin';
|
||||
|
||||
const { attr, hasMany, belongsTo, Model } = DS;
|
||||
|
||||
export default Model.extend({
|
||||
export default Model.extend(KeyMixin, {
|
||||
engine: belongsTo('secret-engine'),
|
||||
versions: hasMany('secret-v2-version', { async: false, inverse: null }),
|
||||
selectedVersion: belongsTo('secret-v2-version', { async: false, inverse: 'secret' }),
|
||||
|
|
@ -23,7 +24,6 @@ export default Model.extend({
|
|||
helpText:
|
||||
'Writes will only be allowed if the key’s current version matches the version specified in the cas parameter',
|
||||
}),
|
||||
isFolder: match('id', /\/$/),
|
||||
fields: computed(function() {
|
||||
return expandAttributeMeta(this, ['maxVersions', 'casRequired']);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { computed } from '@ember/object';
|
||||
import DS from 'ember-data';
|
||||
import KeyMixin from './key-mixin';
|
||||
import KeyMixin from 'vault/mixins/key-mixin';
|
||||
const { attr } = DS;
|
||||
|
||||
export default DS.Model.extend(KeyMixin, {
|
||||
|
|
@ -21,5 +21,6 @@ export default DS.Model.extend(KeyMixin, {
|
|||
}),
|
||||
|
||||
helpText: attr('string'),
|
||||
// TODO this needs to be a relationship like `engine` on kv-v2
|
||||
backend: attr('string'),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue