2018-04-03 14:16:57 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
const { Helper, inject, observer } = Ember;
|
|
|
|
|
|
|
|
const FEATURES = [
|
|
|
|
'HSM',
|
|
|
|
'Performance Replication',
|
|
|
|
'DR Replication',
|
|
|
|
'MFA',
|
|
|
|
'Sentinel',
|
|
|
|
'AWS KMS Autounseal',
|
|
|
|
'GCP CKMS Autounseal',
|
|
|
|
'Seal Wrapping',
|
|
|
|
'Control Groups',
|
2018-08-16 17:48:24 +00:00
|
|
|
'Namespaces',
|
2018-04-03 14:16:57 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
export function hasFeature(featureName, features) {
|
|
|
|
if (!FEATURES.includes(featureName)) {
|
|
|
|
Ember.assert(`${featureName} is not one of the available values for Vault Enterprise features.`, false);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return features ? features.includes(featureName) : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Helper.extend({
|
|
|
|
version: inject.service(),
|
|
|
|
onFeaturesChange: observer('version.features.[]', function() {
|
|
|
|
this.recompute();
|
|
|
|
}),
|
|
|
|
compute([featureName]) {
|
|
|
|
return hasFeature(featureName, this.get('version.features'));
|
|
|
|
},
|
|
|
|
});
|