|
@@ -103,31 +103,58 @@ App.KDCCredentialsControllerMixin = Em.Mixin.create({
|
|
|
return credentialsUtils.updateCredentials(App.get('clusterName'), this.get('credentialAlias'), resource);
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * initialize additional properties regarding KDC credential storage
|
|
|
+ * @method initializeKDCStoreProperties
|
|
|
+ * @param {App.ServiceConfigProperty[]} configs list of configs
|
|
|
+ */
|
|
|
+ initializeKDCStoreProperties: function(configs) {
|
|
|
+ this.generateKDCStoreProperties().forEach(function(configObject) {
|
|
|
+ var configProperty = configs.findProperty('name', configObject.name);
|
|
|
+ if (!Em.isNone(configProperty)) {
|
|
|
+ Em.setProperties(configProperty, configObject);
|
|
|
+ } else {
|
|
|
+ configs.pushObject(configObject);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* Generate additional properties regarding KDC credential storage
|
|
|
- *
|
|
|
+ * @method updateKDCStoreProperties
|
|
|
* @param {App.ServiceConfigProperty[]} configs list of configs
|
|
|
*/
|
|
|
- initilizeKDCStoreProperties: function(configs) {
|
|
|
- var self = this;
|
|
|
+ updateKDCStoreProperties: function(configs) {
|
|
|
+ this.generateKDCStoreProperties().forEach(function(configObject) {
|
|
|
+ var configProperty = configs.findProperty('name', configObject.name);
|
|
|
+ if (!Em.isNone(configProperty)) {
|
|
|
+ Em.setProperties(configProperty, configObject);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * generate additional properties regarding KDC credential storage
|
|
|
+ * @method generateKDCStoreProperties
|
|
|
+ * @returns {Array} properties
|
|
|
+ */
|
|
|
+ generateKDCStoreProperties: function() {
|
|
|
+ var properties = [];
|
|
|
+
|
|
|
this.get('credentialsStoreConfigs').forEach(function(item) {
|
|
|
var configObject = App.config.createDefaultConfig(item.name, 'krb5-conf.xml', false);
|
|
|
$.extend(configObject, item);
|
|
|
if (item.name === 'persist_credentials') {
|
|
|
- if (self.get('isStorePersisted')) {
|
|
|
+ if (this.get('isStorePersisted')) {
|
|
|
configObject.hintMessage = Em.I18n.t('admin.kerberos.credentials.store.hint.supported');
|
|
|
} else {
|
|
|
configObject.hintMessage = Em.I18n.t('admin.kerberos.credentials.store.hint.not.supported');
|
|
|
configObject.isEditable = false;
|
|
|
}
|
|
|
}
|
|
|
- var configProperty = configs.findProperty('name', configObject.name);
|
|
|
- if (!Em.isNone(configProperty)) {
|
|
|
- Em.setProperties(configProperty, configObject);
|
|
|
- } else {
|
|
|
- configs.pushObject(configObject);
|
|
|
- }
|
|
|
- });
|
|
|
+ properties.push(configObject);
|
|
|
+ }, this);
|
|
|
+ return properties;
|
|
|
},
|
|
|
|
|
|
/**
|