From f1f346ebc9357d4add9f2394b7d8017aa9478da3 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 10 Sep 2024 05:54:37 -0400 Subject: [PATCH 1/3] Improve no summary attributes --- components/ldap-summary.js | 6 ------ templates/ldap-summary.hbs | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/ldap-summary.js b/components/ldap-summary.js index 36d84bd..9510ceb 100644 --- a/components/ldap-summary.js +++ b/components/ldap-summary.js @@ -30,12 +30,6 @@ polarity.export = PolarityComponent.extend({ } }); - if (values.length === 0) { - values.push({ - value: 'User Found' - }); - } - return values; } ) diff --git a/templates/ldap-summary.hbs b/templates/ldap-summary.hbs index 9b3dad1..45d9a55 100644 --- a/templates/ldap-summary.hbs +++ b/templates/ldap-summary.hbs @@ -19,3 +19,12 @@ {{/each}} + +{{#if (eq summaryAttributes.length 0)}} + + {{block.acronym}} + + User found + + +{{/if}} From 3cb023d3c9a833d80c67baab6b47a5a0f48f226f Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 10 Sep 2024 06:11:39 -0400 Subject: [PATCH 2/3] Don't show empty emails --- templates/ldap-block.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ldap-block.hbs b/templates/ldap-block.hbs index ca42a17..d532e90 100644 --- a/templates/ldap-block.hbs +++ b/templates/ldap-block.hbs @@ -35,7 +35,7 @@ {{#if group.isExpanded}}
{{#each group.users as |user|}} -
{{user.name}} <{{user.mail}}>
+
{{user.name}} {{#if user.mail}}<{{user.mail}}>{{/if}}
{{/each}}
{{#if (eq group.users.length 25)}} From b7757fd481aca1010261ec1be0fad12851d211a1 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 10 Sep 2024 06:48:46 -0400 Subject: [PATCH 3/3] Add all attributes to default details and make options admin only --- config/config.js | 85 ++++++++++++++++++++++++++++++++++++---------- config/config.json | 76 ++++++++++++++++++++++++++++++++++------- 2 files changed, 131 insertions(+), 30 deletions(-) diff --git a/config/config.js b/config/config.js index 7e242e7..76eec80 100644 --- a/config/config.js +++ b/config/config.js @@ -77,7 +77,7 @@ module.exports = { ca: '', // An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for // the url parameter (by embedding the auth info in the uri) - proxy: "" + proxy: '' }, /** * Options that are displayed to the user/admin in the Polarity integration user-interface. Should be structured @@ -250,8 +250,8 @@ module.exports = { } ], multiple: true, - userCanEdit: true, - adminOnly: false + userCanEdit: false, + adminOnly: true }, { key: 'summaryCustomUserAttributes', @@ -260,8 +260,8 @@ module.exports = { 'Custom user attributes you would like to display in the summary portion of the integration as tags. Provide a comma delimited list. Attributes are case sensitive.', default: '', type: 'text', - userCanEdit: true, - adminOnly: false + userCanEdit: false, + adminOnly: true }, { key: 'detailedUserAttributes', @@ -270,20 +270,72 @@ module.exports = { 'Select user attributes you would like to display in the details portion of the integration', default: [ { - value: 'displayName', - display: 'Display Name' + value: 'cn', + display: 'CN' + }, + { + value: 'comment', + display: 'Comment' + }, + { + value: 'description', + display: 'Description' }, { value: 'distinguishedName', display: 'Distinguished Name' }, { - value: 'userAccountControl', - display: 'User Account Control' + value: 'displayName', + display: 'Display Name' + }, + { + value: 'employeeID', + display: 'Employee Id' + }, + { + value: 'givenName', + display: 'Given Name' + }, + { + value: 'initials', + display: 'Initials' + }, + { + value: 'lockoutTime', + display: 'Lockout Time' + }, + { + value: 'mail', + display: 'Mail' }, { value: 'memberOf', display: 'Member Of' + }, + { + value: 'pwdLastSet', + display: 'Pwd Last Set' + }, + { + value: 'sAMAccountName', + display: 'SAM Account Name' + }, + { + value: 'sn', + display: 'SN' + }, + { + value: 'userAccountControl', + display: 'User Account Control' + }, + { + value: 'userPrincipalName', + display: 'User Principal Name' + }, + { + value: 'whenCreated', + display: 'When Created' } ], type: 'select', @@ -358,8 +410,8 @@ module.exports = { } ], multiple: true, - userCanEdit: true, - adminOnly: false + userCanEdit: false, + adminOnly: true }, { key: 'detailedCustomUserAttributes', @@ -368,16 +420,14 @@ module.exports = { 'Custom user attributes you would like to display in the details portion of the integration. Provide a comma delimited list. Attributes are case sensitive.', default: '', type: 'text', - userCanEdit: true, - adminOnly: false + userCanEdit: false, + adminOnly: true }, { key: 'attributeDisplayMappings', name: 'Attribute Display Name Mappings', description: - 'A comma delimited list of attribute display name mappings which let you change the display name of an attribute in the integration. This can be used to provide human-readable ' + - 'attributes. Each mapping should be the original attribute name followed by a colon and then the desired display name. For example, if the attribute is "flm" and you want that to display as "front line manager", ' + - 'you would enter "flm:Front line manager". Attribute names are case-sensitive.', + 'A comma delimited list of attribute display name mappings which let you change the display name of an attribute in the integration. This can be used to provide human-readable attributes. Each mapping should be the original attribute name followed by a colon and then the desired display name. For example, if the attribute is "flm" and you want that to display as "front line manager", you would enter "flm:Front line manager". Attribute names are case-sensitive.', default: 'cn:Common name,dc:Domain component', type: 'text', userCanEdit: false, @@ -387,8 +437,7 @@ module.exports = { key: 'simplifiedGroupNames', name: 'Display Simplified Group Names', description: - 'If checked, group names will only show the leaf entry of the fully qualified group name. For example, if the full group name is "CN=PolarityUsers,CN=Users,DC=polarity,DC=io", when this option is checked ' + - 'the group name would be displayed as "PolarityUsers". Group names are only shown if your LDAP implementation includes a "memberOf" attribute.', + 'If checked, group names will only show the leaf entry of the fully qualified group name. For example, if the full group name is "CN=PolarityUsers,CN=Users,DC=polarity,DC=io", when this option is checked the group name would be displayed as "PolarityUsers". Group names are only shown if your LDAP implementation includes a "memberOf" attribute.', default: false, type: 'boolean', userCanEdit: false, diff --git a/config/config.json b/config/config.json index d516eac..cb6ddbf 100644 --- a/config/config.json +++ b/config/config.json @@ -187,8 +187,8 @@ } ], "multiple": true, - "userCanEdit": true, - "adminOnly": false + "userCanEdit": false, + "adminOnly": true }, { "key": "summaryCustomUserAttributes", @@ -196,8 +196,8 @@ "description": "Custom user attributes you would like to display in the summary portion of the integration as tags. Provide a comma delimited list. Attributes are case sensitive.", "default": "", "type": "text", - "userCanEdit": true, - "adminOnly": false + "userCanEdit": false, + "adminOnly": true }, { "key": "detailedUserAttributes", @@ -205,20 +205,72 @@ "description": "Select user attributes you would like to display in the details portion of the integration", "default": [ { - "value": "displayName", - "display": "Display Name" + "value": "cn", + "display": "CN" + }, + { + "value": "comment", + "display": "Comment" + }, + { + "value": "description", + "display": "Description" }, { "value": "distinguishedName", "display": "Distinguished Name" }, { - "value": "userAccountControl", - "display": "User Account Control" + "value": "displayName", + "display": "Display Name" + }, + { + "value": "employeeID", + "display": "Employee Id" + }, + { + "value": "givenName", + "display": "Given Name" + }, + { + "value": "initials", + "display": "Initials" + }, + { + "value": "lockoutTime", + "display": "Lockout Time" + }, + { + "value": "mail", + "display": "Mail" }, { "value": "memberOf", "display": "Member Of" + }, + { + "value": "pwdLastSet", + "display": "Pwd Last Set" + }, + { + "value": "sAMAccountName", + "display": "SAM Account Name" + }, + { + "value": "sn", + "display": "SN" + }, + { + "value": "userAccountControl", + "display": "User Account Control" + }, + { + "value": "userPrincipalName", + "display": "User Principal Name" + }, + { + "value": "whenCreated", + "display": "When Created" } ], "type": "select", @@ -293,8 +345,8 @@ } ], "multiple": true, - "userCanEdit": true, - "adminOnly": false + "userCanEdit": false, + "adminOnly": true }, { "key": "detailedCustomUserAttributes", @@ -302,8 +354,8 @@ "description": "Custom user attributes you would like to display in the details portion of the integration. Provide a comma delimited list. Attributes are case sensitive.", "default": "", "type": "text", - "userCanEdit": true, - "adminOnly": false + "userCanEdit": false, + "adminOnly": true }, { "key": "attributeDisplayMappings",