refactor: 💡Mirage changes to LDAP (#1770)
* refactor: 💡 refactor mirage changes Mirage changes to LDAP resource ✅ Closes: ICU-10027 * Update auth-method.js removed curly braces from values * Update addons/api/mirage/generated/factories/auth-method.js using faker to create domains for `urls` attribute Co-authored-by: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com> * Update auth-method.js update `user_filter` and `group_filter` with new example values * refactor: 💡 refactor mirage config Refactor mirage config to include state change for LDAP --------- Co-authored-by: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com>
This commit is contained in:
1 parent
56df65bf8e
commit
b6f93c45bc
2 files changed
+33
-1
No files matched your search
@@ -125,7 +125,7 @@ function routes() {
|
||||
'/auth-methods/:id',
|
||||
function ({ authMethods }, { params: { id } }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
if (attrs.type === 'oidc') {
|
||||
if (attrs.type === 'oidc' || attrs.type === 'ldap') {
|
||||
attrs.attributes.state = 'active-public';
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { faker } from '@faker-js/faker';
|
||||
import {
|
||||
TYPE_AUTH_METHOD_PASSWORD,
|
||||
TYPE_AUTH_METHOD_OIDC,
|
||||
TYPE_AUTH_METHOD_LDAP,
|
||||
} from 'api/models/auth-method';
|
||||
|
||||
/**
|
||||
@@ -43,6 +44,37 @@ export default Factory.extend({
|
||||
idp_ca_certs: ['certificate-1234', 'certificate-5678'],
|
||||
};
|
||||
break;
|
||||
case TYPE_AUTH_METHOD_LDAP:
|
||||
attrs = {
|
||||
state: 'active-public',
|
||||
urls: [`ldap://${faker.internet.domainName()}`],
|
||||
certificates: [faker.random.alphaNumeric(50)],
|
||||
client_certificate: faker.random.alphaNumeric(50),
|
||||
certificate_key: `---Begin Certificate --- ${faker.random.alphaNumeric(
|
||||
170
|
||||
)} ---End Certificate ---`,
|
||||
certificate_key_hmac: faker.random.alphaNumeric(50),
|
||||
enable_groups: true,
|
||||
start_tls: false,
|
||||
insecure_tls: false,
|
||||
bind_dn: 'cn=read-only-admin,dc=example,dc=com',
|
||||
bind_password: 'password',
|
||||
bind_password_hmac: faker.random.alphaNumeric(50),
|
||||
upn_domain: 'example.com',
|
||||
discover_dn: false,
|
||||
anon_group_search: false,
|
||||
user_dn: 'dc=example,dc=com',
|
||||
user_attr: 'uid',
|
||||
user_filter: '({{.UserAttr}}={{.Username}})',
|
||||
group_dn: 'dc=example,dc=com',
|
||||
group_attr: 'cn',
|
||||
group_filter: '(|(memberUid={{.Username}})',
|
||||
account_attribute_maps: [
|
||||
'preferredName=fullName',
|
||||
'preferredEmail=email',
|
||||
],
|
||||
};
|
||||
break;
|
||||
}
|
||||
return attrs;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user