From cb309c196178e7c5c81fe543460e90d5edbc240a Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Fri, 16 Mar 2018 11:37:03 -0700 Subject: [PATCH] Load defaults for AD and Reconfig cert logic This PR makes use of a new method on the api store so this should be merged and published to npm before this pr https://github.com/rancher/ember-api-store/pull/19 rancher/rancher#11729 --- .../authentication/activedirectory/route.js | 9 +++++- .../addon/templates/-ldap-config.hbs | 29 ++++++++++++------- package.json | 2 +- translations/en-us.yaml | 3 ++ 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/lib/global-admin/addon/security/authentication/activedirectory/route.js b/lib/global-admin/addon/security/authentication/activedirectory/route.js index 42c7a4fe2..a6fda02e7 100644 --- a/lib/global-admin/addon/security/authentication/activedirectory/route.js +++ b/lib/global-admin/addon/security/authentication/activedirectory/route.js @@ -10,7 +10,14 @@ export default Route.extend({ return hash({ activeDirectory: gs.find('authconfig', 'activedirectory'), principals: gs.all('principal'), - }) + }).then((hash) => { + let defaultAd = hash.activeDirectory; + let schema = get(this, 'globalStore').getById('schema','activedirectoryconfig'); + + schema.getLoadDefaults(defaultAd); + + return hash; + }); }, setupController: function(controller, model) { diff --git a/lib/global-admin/addon/templates/-ldap-config.hbs b/lib/global-admin/addon/templates/-ldap-config.hbs index 7fce53aba..55ec0fd20 100644 --- a/lib/global-admin/addon/templates/-ldap-config.hbs +++ b/lib/global-admin/addon/templates/-ldap-config.hbs @@ -49,11 +49,11 @@

{{t 'ldap.accessEnabled.users.header'}}

-
{{t 'ldap.accessEnabled.general.searchBase'}} {{adConfig.domain}}
+
{{t 'ldap.accessEnabled.general.searchBase'}} {{adConfig.userSearchBase}}
{{t 'ldap.accessEnabled.users.objectClass'}} {{adConfig.userObjectClass}}
-
{{t 'ldap.accessEnabled.users.login'}} {{adConfig.userLoginField}}
-
{{t 'ldap.accessEnabled.users.name'}} {{adConfig.userNameField}}
-
{{t 'ldap.accessEnabled.users.search'}} {{adConfig.userSearchField}}
+
{{t 'ldap.accessEnabled.users.login'}} {{adConfig.userLoginAttribute}}
+
{{t 'ldap.accessEnabled.users.name'}} {{adConfig.userNameAttribute}}
+
{{t 'ldap.accessEnabled.users.search'}} {{adConfig.userSearchAttribute}}
{{t 'ldap.accessEnabled.users.enabled'}} {{adConfig.userEnabledAttribute}}
{{t 'ldap.accessEnabled.users.disabledBitMask'}} {{adConfig.userDisabledBitMask}}
@@ -61,8 +61,8 @@

{{t 'ldap.accessEnabled.group.header'}}

{{t 'ldap.accessEnabled.general.searchBase'}} {{adConfig.groupDomain}}
{{t 'ldap.accessEnabled.group.objectClass'}} {{adConfig.groupObjectClass}}
-
{{t 'ldap.accessEnabled.group.name'}} {{adConfig.groupNameField}}
-
{{t 'ldap.accessEnabled.group.search'}} {{adConfig.groupSearchField}}
+
{{t 'ldap.accessEnabled.group.name'}} {{adConfig.groupNameAttribute}}
+
{{t 'ldap.accessEnabled.group.search'}} {{adConfig.groupSearchAttribute}}
@@ -125,13 +125,13 @@
- {{input value=adConfig.userSearchBase classNames="form-control"}} + {{input value=adConfig.userSearchBase classNames="form-control" placeholder=(t 'ldap.accessConfig.userSearchBase.placeholder')}}

{{t 'model.openldapconfig.domain.help'}}

- + {{input value=adConfig.groupDomain classNames="form-control" placeholder=(t 'ldap.accessConfig.groupSearchBase.placeholder')}}

{{t 'ldap.accessConfig.groupSearchBase.helpText'}}

@@ -200,11 +200,18 @@
-
-
+
+
- {{input value=adConfig.certificate classNames="form-control" placeholder=(t 'ldap.customizeSchema.groups.groupDN.placeholder')}}
+ {{input-text-file + value=adConfig.certificate + canChangeName=false + accept="text/plain,.pem,.pkey,.key" + minHeight=60 + placeholder="newCertificate.key.placeholder" + shouldChangeName=false + }}
diff --git a/package.json b/package.json index c7434b328..5d23dadc4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "ansi_up": "^2.0.2", "broccoli-asset-rev": "^2.6.0", "dotenv": "^4.0.0", - "ember-api-store": "2.6.1", + "ember-api-store": "2.6.2", "ember-browserify": "^1.2.0", "ember-cli": "~2.16.2", "ember-cli-app-version": "^3.0.0", diff --git a/translations/en-us.yaml b/translations/en-us.yaml index ce38d0524..2d330babc 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -1478,6 +1478,9 @@ ldap: labelText: Group Search Base placeholder: "e.g. ou=Groups,dc=mycompany,dc=com" helpText: "If set, groups will be searched for only under this base instead of under the User Search Base." + userSearchBase: + labelText: User Search Base + placeholder: "e.g. ou=users,dc=mycompany,dc=com" defaultDomain: helpText: "This domain will be used if a user logs in without specifing one." labelText: Default Login Domain