harbor/tests/ldap_test.ldif
stonezdj edcb2fbf05 Add Harbor API Test based on python API
Correct swagger.yaml format
Add make task swagger_client to gen and install python client.
Add LDAP related Test
2018-08-01 10:43:23 +08:00

740 lines
17 KiB
Plaintext

# User entry doesn't belong to harbor_users, it should fail to login
dn: uid=test,dc=example,dc=com
uid: test
cn: test
sn: 3
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/test
uidNumber: 1001
gidNumber: 1001
userPassword: 123456
mail: test@example.com
gecos: test
# OU for People
dn: ou=people,dc=example,dc=com
objectClass: organizationalUnit
ou: People
# OU for Groups
dn: ou=groups,dc=example,dc=com
objectClass: organizationalUnit
ou: Groups
# Group Entry harbor_users
dn: cn=harbor_users,ou=groups,dc=example,dc=com
cn: harbor_users
description: All users
member: cn=mike,ou=people,dc=example,dc=com
member: cn=mike02,ou=people,dc=example,dc=com
member: cn=mike03,ou=people,dc=example,dc=com
member: cn=mike04,ou=people,dc=example,dc=com
member: cn=mike05,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_group
dn: cn=harbor_group,ou=groups,dc=example,dc=com
cn: harbor_group
description: harbor group
member: cn=mike,ou=people,dc=example,dc=com
member: cn=mike02,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_group2
dn: cn=harbor_group2,ou=groups,dc=example,dc=com
cn: harbor_group2
description: harbor group2
member: cn=mike,ou=people,dc=example,dc=com
member: cn=mike02,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_group3
dn: cn=harbor_group3,ou=groups,dc=example,dc=com
cn: harbor_group3
description: harbor group3
member: cn=user001,ou=people,dc=example,dc=com
member: cn=user002,ou=people,dc=example,dc=com
member: cn=user003,ou=people,dc=example,dc=com
member: cn=user004,ou=people,dc=example,dc=com
member: cn=user005,ou=people,dc=example,dc=com
member: cn=user006,ou=people,dc=example,dc=com
member: cn=user007,ou=people,dc=example,dc=com
member: cn=user008,ou=people,dc=example,dc=com
member: cn=user009,ou=people,dc=example,dc=com
member: cn=user010,ou=people,dc=example,dc=com
member: cn=user011,ou=people,dc=example,dc=com
member: cn=user012,ou=people,dc=example,dc=com
member: cn=user013,ou=people,dc=example,dc=com
member: cn=user014,ou=people,dc=example,dc=com
member: cn=user015,ou=people,dc=example,dc=com
member: cn=user016,ou=people,dc=example,dc=com
member: cn=user017,ou=people,dc=example,dc=com
member: cn=user018,ou=people,dc=example,dc=com
member: cn=user019,ou=people,dc=example,dc=com
member: cn=user020,ou=people,dc=example,dc=com
member: cn=user021,ou=people,dc=example,dc=com
member: cn=user022,ou=people,dc=example,dc=com
member: cn=user023,ou=people,dc=example,dc=com
member: cn=user024,ou=people,dc=example,dc=com
member: cn=user025,ou=people,dc=example,dc=com
member: cn=user026,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_guest
dn: cn=harbor_guest,ou=groups,dc=example,dc=com
cn: harbor_guest
description: harbor guest
member: cn=guest_user,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_dev
dn: cn=harbor_dev,ou=groups,dc=example,dc=com
cn: harbor_dev
description: harbor developers
member: cn=dev_user,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# Group Entry harbor_admin
dn: cn=harbor_admin,ou=groups,dc=example,dc=com
cn: harbor_admin
description: harbor developers
member: cn=admin_user,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
# User belongs to harbor_user
dn: cn=mike,ou=people,dc=example,dc=com
cn: mike
gidnumber: 10000
givenname: mike
homedirectory: /home/mike
loginshell: /bin/bash
mail: mike@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: Joe
uid: mike
uidnumber: 5000
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_users,ou=groups,dc=example,dc=com
# User entry to add project member testcase
dn: cn=mike02,ou=people,dc=example,dc=com
cn: mike02
gidnumber: 10000
givenname: mike02
homedirectory: /home/mike02
loginshell: /bin/bash
mail: mike02@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: Mike02
uid: mike02
uidnumber: 5001
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_users,ou=groups,dc=example,dc=com
dn: cn=mike03,ou=people,dc=example,dc=com
cn: mike03
gidnumber: 10000
givenname: mike03
homedirectory: /home/mike03
loginshell: /bin/bash
mail: mike03@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: Mike03
uid: mike03
uidnumber: 5002
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_users,ou=groups,dc=example,dc=com
dn: cn=mike04,ou=people,dc=example,dc=com
cn: mike04
gidnumber: 10000
givenname: mike04
homedirectory: /home/mike04
loginshell: /bin/bash
mail: mike04@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: Mike04
uid: mike04
uidnumber: 5003
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_users,ou=groups,dc=example,dc=com
dn: cn=mike05,ou=people,dc=example,dc=com
cn: mike05
gidnumber: 10000
givenname: mike05
homedirectory: /home/mike05
loginshell: /bin/bash
mail: mike05@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: Mike05
uid: mike05
uidnumber: 5004
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_users,ou=groups,dc=example,dc=com
#user entry for harbor group3
dn: cn=user001,ou=people,dc=example,dc=com
cn: user001
gidnumber: 10000
givenname: user001
homedirectory: /home/user001
loginshell: /bin/bash
mail: user001@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user001
uid: user001
uidnumber: 5005
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user002,ou=people,dc=example,dc=com
cn: user002
gidnumber: 10000
givenname: user002
homedirectory: /home/user002
loginshell: /bin/bash
mail: user002@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user002
uid: user002
uidnumber: 5006
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user003,ou=people,dc=example,dc=com
cn: user003
gidnumber: 10000
givenname: user003
homedirectory: /home/user003
loginshell: /bin/bash
mail: user003@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user003
uid: user003
uidnumber: 5007
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user004,ou=people,dc=example,dc=com
cn: user004
gidnumber: 10000
givenname: user004
homedirectory: /home/user004
loginshell: /bin/bash
mail: user004@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user004
uid: user004
uidnumber: 5008
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user005,ou=people,dc=example,dc=com
cn: user005
gidnumber: 10000
givenname: user005
homedirectory: /home/user005
loginshell: /bin/bash
mail: user005@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user005
uid: user005
uidnumber: 5009
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user006,ou=people,dc=example,dc=com
cn: user006
gidnumber: 10000
givenname: user006
homedirectory: /home/user006
loginshell: /bin/bash
mail: user006@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user006
uid: user006
uidnumber: 5010
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user007,ou=people,dc=example,dc=com
cn: user007
gidnumber: 10000
givenname: user007
homedirectory: /home/user007
loginshell: /bin/bash
mail: user007@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user007
uid: user007
uidnumber: 5011
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user008,ou=people,dc=example,dc=com
cn: user008
gidnumber: 10000
givenname: user008
homedirectory: /home/user008
loginshell: /bin/bash
mail: user008@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user008
uid: user008
uidnumber: 5012
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user009,ou=people,dc=example,dc=com
cn: user009
gidnumber: 10000
givenname: user009
homedirectory: /home/user009
loginshell: /bin/bash
mail: user009@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user009
uid: user009
uidnumber: 5013
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user010,ou=people,dc=example,dc=com
cn: user010
gidnumber: 10000
givenname: user010
homedirectory: /home/user010
loginshell: /bin/bash
mail: user010@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user010
uid: user010
uidnumber: 5014
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user011,ou=people,dc=example,dc=com
cn: user011
gidnumber: 10000
givenname: user011
homedirectory: /home/user011
loginshell: /bin/bash
mail: user011@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user011
uid: user011
uidnumber: 5015
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user012,ou=people,dc=example,dc=com
cn: user012
gidnumber: 10000
givenname: user012
homedirectory: /home/user012
loginshell: /bin/bash
mail: user012@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user012
uid: user012
uidnumber: 5016
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user013,ou=people,dc=example,dc=com
cn: user013
gidnumber: 10000
givenname: user013
homedirectory: /home/user013
loginshell: /bin/bash
mail: user013@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user013
uid: user013
uidnumber: 5017
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user014,ou=people,dc=example,dc=com
cn: user014
gidnumber: 10000
givenname: user014
homedirectory: /home/user014
loginshell: /bin/bash
mail: user014@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user014
uid: user014
uidnumber: 5018
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user015,ou=people,dc=example,dc=com
cn: user015
gidnumber: 10000
givenname: user015
homedirectory: /home/user015
loginshell: /bin/bash
mail: user015@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user015
uid: user015
uidnumber: 5019
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user016,ou=people,dc=example,dc=com
cn: user016
gidnumber: 10000
givenname: user016
homedirectory: /home/user016
loginshell: /bin/bash
mail: user016@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user016
uid: user016
uidnumber: 5020
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user017,ou=people,dc=example,dc=com
cn: user017
gidnumber: 10000
givenname: user017
homedirectory: /home/user017
loginshell: /bin/bash
mail: user017@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user017
uid: user017
uidnumber: 5021
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user018,ou=people,dc=example,dc=com
cn: user018
gidnumber: 10000
givenname: user018
homedirectory: /home/user018
loginshell: /bin/bash
mail: user018@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user018
uid: user018
uidnumber: 5022
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user019,ou=people,dc=example,dc=com
cn: user019
gidnumber: 10000
givenname: user019
homedirectory: /home/user019
loginshell: /bin/bash
mail: user019@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user019
uid: user019
uidnumber: 5023
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user020,ou=people,dc=example,dc=com
cn: user020
gidnumber: 10000
givenname: user020
homedirectory: /home/user020
loginshell: /bin/bash
mail: user020@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user020
uid: user020
uidnumber: 5024
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user021,ou=people,dc=example,dc=com
cn: user021
gidnumber: 10000
givenname: user021
homedirectory: /home/user021
loginshell: /bin/bash
mail: user021@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user021
uid: user021
uidnumber: 5025
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user022,ou=people,dc=example,dc=com
cn: user022
gidnumber: 10000
givenname: user022
homedirectory: /home/user022
loginshell: /bin/bash
mail: user022@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user022
uid: user022
uidnumber: 5026
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user023,ou=people,dc=example,dc=com
cn: user023
gidnumber: 10000
givenname: user023
homedirectory: /home/user023
loginshell: /bin/bash
mail: user023@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user023
uid: user023
uidnumber: 5027
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user024,ou=people,dc=example,dc=com
cn: user024
gidnumber: 10000
givenname: user024
homedirectory: /home/user024
loginshell: /bin/bash
mail: user024@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user024
uid: user024
uidnumber: 5028
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user025,ou=people,dc=example,dc=com
cn: user025
gidnumber: 10000
givenname: user025
homedirectory: /home/user025
loginshell: /bin/bash
mail: user025@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user025
uid: user025
uidnumber: 5029
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=user026,ou=people,dc=example,dc=com
cn: user026
gidnumber: 10000
givenname: user026
homedirectory: /home/user026
loginshell: /bin/bash
mail: user026@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: user026
uid: user026
uidnumber: 5030
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
dn: cn=guest_user,ou=people,dc=example,dc=com
cn: guest_user
gidnumber: 10000
givenname: guest_user
homedirectory: /home/guest_user
loginshell: /bin/bash
mail: guest_user@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: guest_user
uid: guest_user
uidnumber: 6001
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_guest,ou=groups,dc=example,dc=com
dn: cn=dev_user,ou=people,dc=example,dc=com
cn: dev_user
gidnumber: 10000
givenname: guest_user
homedirectory: /home/dev_user
loginshell: /bin/bash
mail: dev_user@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: dev_user
uid: dev_user
uidnumber: 6002
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_dev,ou=groups,dc=example,dc=com
dn: cn=admin_user,ou=people,dc=example,dc=com
cn: admin_user
gidnumber: 10000
givenname: admin_user
homedirectory: /home/admin_user
loginshell: /bin/bash
mail: admin_user@example.com
objectclass: top
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
sn: admin_user
uid: admin_user
uidnumber: 6003
userpassword: {MD5}wb68DeX0CyENafzUADNn9A==
memberof: cn=harbor_admin,ou=groups,dc=example,dc=com