From 983873eaf37a25dadf9456549a2e54940b24cbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 20 Oct 2021 12:28:10 +0200 Subject: [PATCH] demo run fix --- demo/ldap-server.py | 8 +++++++- .../{bootstrap.ldif => bootstrap-data.ldif} | 8 -------- demo/ldif/bootstrap-tree.ldif | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) rename demo/ldif/{bootstrap.ldif => bootstrap-data.ldif} (94%) create mode 100644 demo/ldif/bootstrap-tree.ldif diff --git a/demo/ldap-server.py b/demo/ldap-server.py index c239fde8..1121a95e 100644 --- a/demo/ldap-server.py +++ b/demo/ldap-server.py @@ -38,7 +38,13 @@ try: + "\n" ) - with open("ldif/bootstrap.ldif") as fd: + with open("ldif/bootstrap-tree.ldif") as fd: + try: + slapd.ldapadd(fd.read()) + except RuntimeError: + pass + + with open("ldif/bootstrap-data.ldif") as fd: try: slapd.ldapadd(fd.read()) except RuntimeError: diff --git a/demo/ldif/bootstrap.ldif b/demo/ldif/bootstrap-data.ldif similarity index 94% rename from demo/ldif/bootstrap.ldif rename to demo/ldif/bootstrap-data.ldif index ceaef211..7297acdd 100644 --- a/demo/ldif/bootstrap.ldif +++ b/demo/ldif/bootstrap-data.ldif @@ -73,14 +73,6 @@ mail: james@mydomain.tld telephoneNumber: 555-000-003 memberof: cn=users,ou=groups,dc=mydomain,dc=tld -dn: ou=oauth,dc=mydomain,dc=tld -objectclass: organizationalUnit -ou: oauth - -dn: ou=clients,ou=oauth,dc=mydomain,dc=tld -objectclass: organizationalUnit -ou: clients - dn: oauthClientID=1JGkkzCbeHpGtlqgI5EENByf,ou=clients,ou=oauth,dc=mydomain,dc=tld objectclass: oauthClient oauthClientID: 1JGkkzCbeHpGtlqgI5EENByf diff --git a/demo/ldif/bootstrap-tree.ldif b/demo/ldif/bootstrap-tree.ldif new file mode 100644 index 00000000..c88e91c7 --- /dev/null +++ b/demo/ldif/bootstrap-tree.ldif @@ -0,0 +1,19 @@ +dn: ou=oauth,dc=mydomain,dc=tld +objectclass: organizationalUnit +ou: oauth + +dn: ou=clients,ou=oauth,dc=mydomain,dc=tld +objectclass: organizationalUnit +ou: clients + +dn: ou=tokens,ou=oauth,dc=mydomain,dc=tld +objectclass: organizationalUnit +ou: tokens + +dn: ou=consents,ou=oauth,dc=mydomain,dc=tld +objectclass: organizationalUnit +ou: consents + +dn: ou=codes,ou=oauth,dc=mydomain,dc=tld +objectclass: organizationalUnit +ou: codes