Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prigaux committed Jan 29, 2024
1 parent ab3b35a commit 0aa7178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions server/tests/steps/acl.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

import { assert } from '../test_utils';
import * as conf from '../../conf'
import * as test_ldap from '../test_ldap';
import * as acl from '../../steps/acl';

Expand Down Expand Up @@ -76,12 +77,12 @@ describe('global', () => {
));

it('loggedUser_to_ldap_filter should work', () => (
acl.structureRoles('structureParrain', "(up1TableKey=*)").loggedUser_to_ldap_filter({ 'id': 'arigaux@univ-paris1.fr' } as CurrentUser).then(filter => (
acl.structureRoles('structureParrain', "(up1TableKey=*)").loggedUser_to_ldap_filter({ 'id': 'arigaux' + conf.ldap.uid_to_eppn } as CurrentUser).then(filter => (
assert.deepEqual(filter, '(supannParrainDN=supannCodeEntite=DGH,ou=structures,dc=univ,dc=fr)')
))
));
it('loggedUser_to_ldap_filter if user with no role', () => (
acl.structureRoles('structureParrain', "(up1TableKey=*)").loggedUser_to_ldap_filter({ 'id': 'ayrigaux@univ-paris1.fr' } as CurrentUser).then(filter => (
acl.structureRoles('structureParrain', "(up1TableKey=*)").loggedUser_to_ldap_filter({ 'id': 'ayrigaux' + conf.ldap.uid_to_eppn } as CurrentUser).then(filter => (
assert.deepEqual(filter, '(|(supannParrainDN=supannCodeEntite=DGH,ou=structures,dc=univ,dc=fr)(supannParrainDN=supannCodeEntite=DGHA,ou=structures,dc=univ,dc=fr))')
))
));
Expand Down
4 changes: 2 additions & 2 deletions server/tests/test_ldap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function test_params() {
"[up1Source={COMPTEX}PLB.SC4][up1Priority=190][up1StartDate=20171216][up1EndDate=20181101][eduPersonAffiliation=employee;member;teacher][eduPersonEntitlement=urn:mace:univ-paris1.fr:entitlement:SC4:registered-reader][eduPersonPrimaryAffiliation=teacher][employeeNumber=9100035249][givenName=Pascal][homePhone=+33 1 82 09 08 74][homePostalAddress=6 Allée D'ANDREZIEUX$75018 PARIS$FRANCE][sn=Rigaux][supannCivilite=M.][supannEtablissement={UAI}0752719Y][supannOrganisme={EES}0752719Y][supannParrainDN=supannCodeEntite=SC4,ou=structures,dc=univ-paris1,dc=fr][supannRefId={MIFARE}803853C2593A04][up1BirthDay=19751002000000Z][up1BirthName=Nomdavant][up1TagMifare=8A38A3CA59AA0A]",
] },
{ uid: "e10000000", sn: "rigaux", givenName: "pascal", cn: "rigaux pascal", displayName: "pascal rigaux", up1BirthDay: '19751002000000Z', eduPersonAffiliation: ['member','student'], supannEtuId: '22', mailHost: 'malix.univ-paris1.fr', objectClass: [] },
{ uid: "arigaux", sn: "rigaux", givenName: "aymé", cn: "rigaux ayme", displayName: "aymé rigaux", up1BirthDay: '19751002000000Z', eduPersonAffiliation: ['member','employee','staff'], objectClass: [], mail: "[email protected]", eduPersonPrincipalName: "arigaux@univ-paris1.fr", supannRoleEntite: ["[role={SUPANN}D30][type={SUPANN}S230][code=DGH]"], memberOf: ["cn=g1,ou=groups,dc=univ,dc=fr"] },
{ uid: "ayrigaux", sn: "rigaux", givenName: "aymé", cn: "rigaux ayme", displayName: "aymé rigaux", up1BirthDay: '19750101000000Z', eduPersonAffiliation: ['member','employee','staff'], objectClass: [], eduPersonPrincipalName: "ayrigaux@univ-paris1.fr", supannRoleEntite: ["[role={SUPANN}D30][type={SUPANN}S230][code=DGH]", "[role={SUPANN}D10][type={SUPANN}S230][code=DGHA]"] },
{ uid: "arigaux", sn: "rigaux", givenName: "aymé", cn: "rigaux ayme", displayName: "aymé rigaux", up1BirthDay: '19751002000000Z', eduPersonAffiliation: ['member','employee','staff'], objectClass: [], mail: "[email protected]", eduPersonPrincipalName: "[email protected]", supannRoleEntite: ["[role={SUPANN}D30][type={SUPANN}S230][code=DGH]"], memberOf: ["cn=g1,ou=groups,dc=univ,dc=fr"] },
{ uid: "ayrigaux", sn: "rigaux", givenName: "aymé", cn: "rigaux ayme", displayName: "aymé rigaux", up1BirthDay: '19750101000000Z', eduPersonAffiliation: ['member','employee','staff'], objectClass: [], eduPersonPrincipalName: "[email protected]", supannRoleEntite: ["[role={SUPANN}D30][type={SUPANN}S230][code=DGH]", "[role={SUPANN}D10][type={SUPANN}S230][code=DGHA]"] },
/* tslint:enable */
];
let rolesGeneriques = [
Expand Down

0 comments on commit 0aa7178

Please sign in to comment.