-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to run user_provider integration test with LDAP driver (#2584)
* Allow to run user_provider integration test with LDAP driver The test are skipped by default for now, as they require an LDAP Server to be setup. To run you can e.g. use OpenLDAP in docker use e.g.: ``` docker run --name openldap \ --volume ./tests/integration/grpc/fixtures/ldap/:/container/service/slapd/assets/config/bootstrap/ldif/custom \ -e LDAP_DOMAIN="owncloud.com" \ -e LDAP_TLS_VERIFY_CLIENT=never \ -e LDAP_ORGANISATION=ownCloud \ -e LDAP_ADMIN_PASSWORD=admin \ -e LDAP_REMOVE_CONFIG_AFTER_SETUP=false \ osixia/openldap ``` run the test suite with: ``` cd tests/integration/ RUN_LDAP_TESTS=1 ~/go/bin/ginkgo [--focus "ldap"] ./... ``` * LDAP GetUser/GetGroup take IDP attribute into account If GetUser/GetGroup is called with the IDP attribute set to a non-empty string we only return results if the IDP setting configured for the user/groupprovider matches the IDP from the request. This aligns the LDAP providers' behaviour with what the demo and json providers implement. * Address ginkgo v2 deprecation warnings CurrentGinkgoTestDescription() is deprecated in V2 and should be replaced with CurrentSpecReport().
- Loading branch information
Showing
10 changed files
with
228 additions
and
3 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,6 @@ | ||
Enhancement: Allow running userprovider integration tests for the LDAP driver | ||
|
||
We extended the integration test suite for the userprovider to allow running it | ||
with an LDAP server. | ||
|
||
https://github.com/cs3org/reva/pull/2584 |
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
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
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,9 @@ | ||
# This LDIF files describes the ownCloud schema and can be used to | ||
# add two optional attributes: ownCloudQuota and ownCloudUUID | ||
# The ownCloudUUID is used to store a unique, non-reassignable, persistent identifier for users and groups | ||
dn: cn=owncloud,cn=schema,cn=config | ||
objectClass: olcSchemaConfig | ||
cn: owncloud | ||
olcAttributeTypes: ( 1.3.6.1.4.1.39430.1.1.1 NAME 'ownCloudQuota' DESC 'User Quota (e.g. 2 GB)' EQUALITY caseExactMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.39430.1.1.2 NAME 'ownCloudUUID' DESC 'A non-reassignable and persistent account ID)' EQUALITY uuidMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.1.16.1 SINGLE-VALUE ) | ||
olcObjectClasses: ( 1.3.6.1.4.1.39430.1.2.1 NAME 'ownCloud' DESC 'ownCloud LDAP Schema' AUXILIARY MAY ( ownCloudQuota $ ownCloudUUID ) ) |
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,84 @@ | ||
dn: ou=users,dc=owncloud,dc=com | ||
objectClass: organizationalUnit | ||
ou: users | ||
|
||
# Start dn with uid (user identifier / login), not cn (Firstname + Surname) | ||
dn: uid=einstein,ou=users,dc=owncloud,dc=com | ||
objectClass: inetOrgPerson | ||
objectClass: organizationalPerson | ||
objectClass: ownCloud | ||
objectClass: person | ||
objectClass: posixAccount | ||
objectClass: top | ||
uid: einstein | ||
givenName: Albert | ||
sn: Einstein | ||
cn: einstein | ||
displayName: Albert Einstein | ||
description: A German-born theoretical physicist who developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics). | ||
mail: [email protected] | ||
uidNumber: 123 | ||
gidNumber: 30000 | ||
homeDirectory: /home/einstein | ||
ownCloudUUID:: NGM1MTBhZGEtYzg2Yi00ODE1LTg4MjAtNDJjZGY4MmMzZDUx | ||
userPassword:: e1NTSEF9TXJEcXpFNGdKbXZxbVRVTGhvWEZ1VzJBbkV3NWFLK3J3WTIvbHc9PQ== | ||
|
||
dn: uid=marie,ou=users,dc=owncloud,dc=com | ||
objectClass: inetOrgPerson | ||
objectClass: organizationalPerson | ||
objectClass: ownCloud | ||
objectClass: person | ||
objectClass: posixAccount | ||
objectClass: top | ||
uid: marie | ||
givenName: Marie | ||
sn: Curie | ||
cn: marie | ||
displayName: Marie Curie | ||
description: A Polish and naturalized-French physicist and chemist who conducted pioneering research on radioactivity. | ||
mail: [email protected] | ||
uidNumber: 20001 | ||
gidNumber: 30000 | ||
homeDirectory: /home/marie | ||
ownCloudUUID:: ZjdmYmY4YzgtMTM5Yi00Mzc2LWIzMDctY2YwYThjMmQwZDlj | ||
userPassword:: e1NTSEF9UmFvQWs3TU9jRHBIUWY3bXN3MGhHNnVraFZQWnRIRlhOSUNNZEE9PQ== | ||
|
||
dn: uid=richard,ou=users,dc=owncloud,dc=com | ||
objectClass: inetOrgPerson | ||
objectClass: organizationalPerson | ||
objectClass: ownCloud | ||
objectClass: person | ||
objectClass: posixAccount | ||
objectClass: top | ||
uid: richard | ||
givenName: Richard | ||
sn: Feynman | ||
cn: richard | ||
displayName: Richard Phillips Feynman | ||
description: An American theoretical physicist, known for his work in the path integral formulation of quantum mechanics, the theory of quantum electrodynamics, the physics of the superfluidity of supercooled liquid helium, as well as his work in particle physics for which he proposed the parton model. | ||
mail: [email protected] | ||
uidNumber: 20002 | ||
gidNumber: 30000 | ||
homeDirectory: /home/richard | ||
ownCloudUUID:: OTMyYjQ1NDAtOGQxNi00ODFlLThlZjQtNTg4ZTRiNmIxNTFj | ||
userPassword:: e1NTSEF9Z05LZTRreHdmOGRUREY5eHlhSmpySTZ3MGxSVUM1d1RGcWROTVE9PQ== | ||
|
||
dn: uid=moss,ou=users,dc=owncloud,dc=com | ||
objectClass: inetOrgPerson | ||
objectClass: organizationalPerson | ||
objectClass: ownCloud | ||
objectClass: person | ||
objectClass: posixAccount | ||
objectClass: top | ||
uid: moss | ||
givenName: Maurice | ||
sn: Moss | ||
cn: moss | ||
displayName: Maurice Moss | ||
description: A worker in the IT Department of Reynholm Industries. Of all the working staff in the IT Department, he is the most hard-working, the most experienced, and the most capable of doing his job well. He puts a lot of effort into his work, however he does not get the credit he deserves. | ||
mail: [email protected] | ||
uidNumber: 20003 | ||
gidNumber: 30000 | ||
homeDirectory: /home/moss | ||
ownCloudUUID:: MDU4YmZmOTUtNjcwOC00ZmU1LTkxZTQtOWVhM2QzNzc1ODhi | ||
userPassword:: e1NTSEF9N0hEdTRoMkFDVExFWWt4U0RtSDZVQjhmUlpKRExDZDc= |
75 changes: 75 additions & 0 deletions
75
tests/integration/grpc/fixtures/ldap/30_groups_rfc2307.ldif
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,75 @@ | ||
dn: ou=groups,dc=owncloud,dc=com | ||
objectClass: organizationalUnit | ||
ou: groups | ||
|
||
dn: cn=sailing-lovers,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: sailing-lovers | ||
description: Sailing lovers | ||
gidNumber: 30001 | ||
ownCloudUUID:: NjA0MGFhMTctOWM2NC00ZmVmLTliZDAtNzcyMzRkNzFiYWQw | ||
memberUid: einstein | ||
|
||
dn: cn=violin-haters,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: violin-haters | ||
description: Violin haters | ||
gidNumber: 30002 | ||
ownCloudUUID:: ZGQ1OGU1ZWMtODQyZS00OThiLTg4MDAtNjFmMmVjNmY5MTFm | ||
memberUid: einstein | ||
|
||
dn: cn=radium-lovers,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: radium-lovers | ||
description: Radium lovers | ||
gidNumber: 30003 | ||
ownCloudUUID:: N2I4N2ZkNDktMjg2ZS00YTVmLWJhZmQtYzUzNWQ1ZGQ5OTdh | ||
memberUid: marie | ||
|
||
dn: cn=polonium-lovers,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: polonium-lovers | ||
description: Polonium lovers | ||
gidNumber: 30004 | ||
ownCloudUUID:: Y2VkYzIxYWEtNDA3Mi00NjE0LTg2NzYtZmE5MTY1ZjU5OGZm | ||
memberUid: marie | ||
|
||
dn: cn=quantum-lovers,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: quantum-lovers | ||
description: Quantum lovers | ||
gidNumber: 30005 | ||
ownCloudUUID:: YTE3MjYxMDgtMDFmOC00YzMwLTg4ZGYtMmIxYTlkMWNiYTFh | ||
memberUid: richard | ||
|
||
dn: cn=philosophy-haters,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: philosophy-haters | ||
description: Philosophy haters | ||
gidNumber: 30006 | ||
ownCloudUUID:: MTY3Y2JlZTItMDUxOC00NTVhLWJmYjItMDMxZmUwNjIxZTVk | ||
memberUid: richard | ||
|
||
dn: cn=physics-lovers,ou=groups,dc=owncloud,dc=com | ||
objectClass: posixGroup | ||
objectClass: ownCloud | ||
objectClass: top | ||
cn: physics-lovers | ||
description: Physics lovers | ||
gidNumber: 30007 | ||
ownCloudUUID:: MjYyOTgyYzEtMjM2Mi00YWZhLWJmZGYtOGNiZmVmNjRhMDZl | ||
memberUid: einstein | ||
memberUid: marie | ||
memberUid: richard |
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,25 @@ | ||
[grpc] | ||
address = "{{grpc_address}}" | ||
|
||
[grpc.services.userprovider] | ||
driver = "ldap" | ||
|
||
[grpc.services.userprovider.drivers.ldap] | ||
hostname="localhost" | ||
port=10389 | ||
insecure=true | ||
base_dn="dc=owncloud,dc=com" | ||
userfilter="(&(objectclass=posixAccount)(ownclouduuid={{.OpaqueId}}))" | ||
findfilter="(&(objectclass=posixAccount)(|(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)(ownclouduuid={{query}})))" | ||
attributefilter="(&(objectclass=posixAccount)({{attr}}={{value}}))" | ||
groupfilter="(&(objectclass=posixGroup)(cn=*)(memberuid={{query}}))" | ||
bind_username="cn=admin,dc=owncloud,dc=com" | ||
bind_password="admin" | ||
idp="http://localhost:20080" | ||
|
||
[grpc.services.userprovider.drivers.ldap.schema] | ||
uid="ownclouduuid" | ||
displayName="displayName" | ||
dn="dn" | ||
cn="cn" | ||
gid="cn" |
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
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
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