forked from RocketChat/ldap-container-for-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was originally developed in the jenkins-infra/jira repository, but moved over here as it is useful outside JIRA.
- Loading branch information
0 parents
commit 7d30bf1
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nickstenning/slapd | ||
|
||
RUN apt-get -y update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ldap-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Test LDAP Container | ||
|
||
This container runs OpenLDAP, like `ldap.jenkins-ci.org`, except that it uses bogus test data instead | ||
of real production data. This is useful as a test fixture. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# | ||
# Dummy user database for testing | ||
# | ||
# User 'kohsuke' is admin, user 'alice' is a regular user. | ||
# Both has the password 'password' | ||
# | ||
|
||
#dn: dc=jenkins-ci,dc=org | ||
#objectClass: top | ||
#objectClass: dcObject | ||
#objectClass: organization | ||
#o: Jenkins users | ||
#dc: Jenkins-Ci | ||
#description: Jenkins users | ||
|
||
#dn: cn=admin,dc=jenkins-ci,dc=org | ||
#objectClass: simpleSecurityObject | ||
#objectClass: organizationalRole | ||
#cn: admin | ||
#description: LDAP administrator | ||
#userPassword: {SSHA}yI6cZwQadOA1e+/f+T+H3eCQQhRzYWx0 | ||
|
||
dn: ou=people,dc=jenkins-ci,dc=org | ||
objectClass: organizationalUnit | ||
ou: people | ||
|
||
dn: ou=groups,dc=jenkins-ci,dc=org | ||
objectClass: organizationalUnit | ||
ou: groups | ||
|
||
dn: cn=admins,ou=groups,dc=jenkins-ci,dc=org | ||
objectClass: groupOfNames | ||
cn: admins | ||
description: people with infrastructure admin access | ||
member: cn=kohsuke,ou=people,dc=jenkins-ci,dc=org | ||
|
||
dn: cn=all,ou=groups,dc=jenkins-ci,dc=org | ||
objectClass: groupOfNames | ||
cn: all | ||
member: cn=kohsuke,ou=people,dc=jenkins-ci,dc=org | ||
member: cn=kohsuke2,ou=people,dc=jenkins-ci,dc=org | ||
|
||
dn: cn=kohsuke,ou=people,dc=jenkins-ci,dc=org | ||
objectClass: inetOrgPerson | ||
cn: kohsuke | ||
mail: [email protected] | ||
givenName: Kohsuke | ||
employeeNumber: kohsuke | ||
preferredLanguage: yyy | ||
sn: Kawaguchi | ||
userPassword: {SSHA}yI6cZwQadOA1e+/f+T+H3eCQQhRzYWx0 | ||
|
||
dn: cn=alice,ou=people,dc=jenkins-ci,dc=org | ||
objectClass: inetOrgPerson | ||
cn: alice | ||
mail: [email protected] | ||
givenName: Alice | ||
sn: Ashley | ||
userPassword: {SSHA}yI6cZwQadOA1e+/f+T+H3eCQQhRzYWx0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
# Ruby script to generate SSHA (Good for LDAP) | ||
require 'digest/sha1' | ||
require 'base64' | ||
hash = "{SSHA}"+Base64.encode64(Digest::SHA1.digest('password'+'salt')+'salt').chomp! | ||
puts 'userPassword: '+hash+"\n" |