Merge pull request #1012 from helsinki-systems/fix/ldap-test

fix ldap nixos test
This commit is contained in:
Graham Christensen 2021-09-24 14:27:26 -04:00 committed by GitHub
commit 99161c7c53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -851,22 +851,21 @@
machine = { pkgs, ... }: {
imports = [ hydraServer ];
services.openldap = {
enable = true;
suffix = "dc=example";
rootdn = "cn=root,dc=example";
rootpw = "notapassword";
database = "bdb";
dataDir = "/var/lib/openldap";
extraConfig = ''
moduleload pw-sha2
'';
extraDatabaseConfig = ''
'';
services.openldap.enable = true;
services.openldap.settings.children = {
"olcDatabase={1}mdb".attrs = {
objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ];
database = "{1}mdbg";
olcSuffix = "dc=example";
olcRootDN = "cn=root,dc=example";
olcRootPW = "notapassword";
olcDbDirectory = "/var/lib/openldap";
};
};
# userPassword generated via `slappasswd -o module-load=pw-sha2 -h '{SSHA256}'`
# The admin user has the password `password and `user` has the password `foobar`.
declarativeContents = ''
# userPassword generated via `slappasswd`
# The admin user has the password `password` and `user` has the password `foobar`.
services.openldap.declarativeContents."dc=example" = ''
dn: dc=example
dc: example
o: Root
@ -898,7 +897,7 @@
sn: user
cn: user
mail: user@example
userPassword: {SSHA256}B9rfUbNgv8nIGn1Hm5qbVQdv6AIQb012ORJwegqELB0DWCzoMCY+4A==
userPassword: {SSHA}gLgBMb86/3wecoCp8gtORgIF2/qCRpqs
dn: cn=admin,ou=users,dc=example
objectClass: organizationalPerson
@ -906,10 +905,9 @@
sn: admin
cn: admin
mail: admin@example
userPassword: {SSHA256}meKP7fSWhkzXFC1f8RWRb8V8ssmN/VQJp7xJrUFFcNUDuwP1PbitMg==
userPassword: {SSHA}BsgOQcRnoiULzwLrGmuzVGH6EC5Dkwmf
'';
};
systemd.services.hdyra-server.environment.CATALYST_DEBUG = "1";
systemd.services.hydra-server.environment.CATALYST_DEBUG = "1";
systemd.services.hydra-server.environment.HYDRA_LDAP_CONFIG = pkgs.writeText "config.yaml"
# example config based on https://metacpan.org/source/ILMARI/Catalyst-Authentication-Store-LDAP-1.016/README#L103
''