Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LDAP mock and directory #113

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/mock/ldap.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ server.search('c=ch', searchHandler);
Examples queries:

> ldapsearch -H ldap://localhost:1389 -x \
-LLL -b "o=epfl" uniqueIdentifier=670001
-LLL -b "c=ch" uniqueIdentifier=670001

> ldapsearch -H ldap://localhost:1389 -x \
-LLL -b "o=epfl" sn=Fett
-LLL -b "c=ch" sn=Fett
*/
function searchHandler (req, res, next) {
directory.forEach(function (user) {
/*
This test is pretty dumb, make sure in the directory that things are
spaced / cased exactly.
*/
if (user.dn.indexOf(req.dn.toString()) === -1) {
return;
}
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/ldap/directory.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"description": "Chasseur de prime",
"description;lang-en": "Bounty hunter",
"ou": [
"Kamino",
"KAMINO",
"Kamino est une planète aquatique située dans le secteur Abrion de la bordure extérieure de la galaxie."
],
"ou;lang-en": "Kamino is an aquatic planet located in the Abrion sector of the galaxy's Outer Rim.",
Expand All @@ -40,7 +40,7 @@
"description": "Chasseur de prime",
"description;lang-en": "Bounty hunter",
"ou": [
"Bespin",
"BESPIN",
"Bespin est une géante gazeuse du système stellaire du même nom."
],
"ou;lang-en": "Bespin is a gas giant in the star system of the same name.",
Expand All @@ -65,7 +65,7 @@
"description": "Chasseur de prime",
"description;lang-en": "Bounty hunter",
"ou": [
"Tatooine",
"TATOOINE",
"Tatooine est une planète désertique située dans les territoires de la bordure extérieure de la galaxie."
],
"ou;lang-en": "Tatooine is a desert planet located in the Outer Rim territories of the galaxy.",
Expand All @@ -90,7 +90,7 @@
"description": "Chasseur de prime",
"description;lang-en": "Bounty hunter",
"ou": [
"Mandalore",
"MANDALORE",
"Mandalore est une planète située dans les territoires de la bordure extérieure de la galaxie."
],
"ou;lang-en": "Mandalore is a planet located in the Outer Rim territories of the galaxy.",
Expand All @@ -100,7 +100,7 @@
}
},
{
"dn": "cn=Din Grogu,ou=mandalore,ou=tv-3,ou=so,o=epfl,c=ch",
"dn": "cn=Din Grogu,ou=coruscant,ou=tv-3,ou=so,o=epfl,c=ch",
"attributes": {
"cn": ["Din Grogu", "Grogu"],
"sn": "Grogu",
Expand All @@ -115,7 +115,7 @@
"description": "Jedi",
"description;lang-en": "Jedi",
"ou": [
"Coruscant",
"CORUSCANT",
"Coruscant est une planète tellurique des Mondes du Noyau entièrement urbanisée et recouvertes d'infrastructures."
],
"ou;lang-en": "Coruscant is an ecumenopolis, collectively known as Imperial City in the Core Worlds.",
Expand All @@ -140,7 +140,7 @@
"description": "Infanterie lourde",
"description;lang-en": "Heavy infantry",
"ou": [
"Mandalore",
"MANDALORE",
"Mandalore est une planète située dans les territoires de la bordure extérieure de la galaxie."
],
"ou;lang-en": "Mandalore is a planet located in the Outer Rim territories of the galaxy.",
Expand All @@ -165,7 +165,7 @@
"description": "Princesse",
"description;lang-en": "Princess",
"ou": [
"Kalevala",
"KALEVALA",
"Kalevala est une planète du système Mandalore située dans les territoires de la bordure extérieure."
],
"ou;lang-en": "Kalevala is a planet in the Mandalore system located in the Outer Rim territories.",
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/people/json-name-din-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
{
"phoneList": ["+41 21 0054322"],
"officeList": ["Jedi Temple"],
"path": "EPFL/SO/TV-3/MANDALORE",
"acronym": "MANDALORE",
"path": "EPFL/SO/TV-3/CORUSCANT",
"acronym": "CORUSCANT",
"rank": "1",
"position": "Jedi",
"name": "Coruscant is an ecumenopolis, collectively known as Imperial City in the Core Worlds."
Expand Down