mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 21:21:06 +02:00
* add granularity form field to sync destinations * update mirage, shim in subkey response * fix comment * add granular updates to list view * update mirage; * update test * comment for updating test * use hds::dropdown in destinations for consistency * move banner to popup menu * add changelog * remove spans from test
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Model, { attr } from '@ember-data/model';
|
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
|
|
|
export default class SyncAssociationModel extends Model {
|
|
@attr mount;
|
|
@attr secretName;
|
|
@attr syncStatus;
|
|
@attr updatedAt;
|
|
// destination related properties that are not serialized to payload
|
|
@attr destinationName;
|
|
@attr destinationType;
|
|
@attr subKey; // this property is added if a destination has 'secret-key' granularity
|
|
|
|
@lazyCapabilities(
|
|
apiPath`sys/sync/destinations/${'destinationType'}/${'destinationName'}/associations/set`,
|
|
'destinationType',
|
|
'destinationName'
|
|
)
|
|
setAssociationPath;
|
|
|
|
@lazyCapabilities(
|
|
apiPath`sys/sync/destinations/${'destinationType'}/${'destinationName'}/associations/remove`,
|
|
'destinationType',
|
|
'destinationName'
|
|
)
|
|
removeAssociationPath;
|
|
|
|
get canSync() {
|
|
return this.setAssociationPath.get('canUpdate') !== false;
|
|
}
|
|
|
|
get canUnsync() {
|
|
return this.removeAssociationPath.get('canUpdate') !== false;
|
|
}
|
|
}
|