open-vault/ui/app/models/identity/entity-alias.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

46 lines
1.1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { belongsTo, attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import IdentityModel from './_base';
import identityCapabilities from 'vault/macros/identity-capabilities';
export default IdentityModel.extend({
parentType: 'entity',
formFields: computed(function () {
return ['name', 'mountAccessor'];
}),
entity: belongsTo('identity/entity', { readOnly: true, async: false }),
name: attr('string'),
canonicalId: attr('string'),
mountAccessor: attr('string', {
label: 'Auth Backend',
editType: 'mountAccessor',
}),
metadata: attr({
editType: 'kv',
}),
mountPath: attr('string', {
readOnly: true,
}),
mountType: attr('string', {
readOnly: true,
}),
creationTime: attr('string', {
readOnly: true,
}),
lastUpdateTime: attr('string', {
readOnly: true,
}),
mergedFromCanonicalIds: attr(),
updatePath: identityCapabilities(),
canDelete: alias('updatePath.canDelete'),
canEdit: alias('updatePath.canUpdate'),
});