Skip to content

Commit

Permalink
Fix missing user permissions after Azure authentication flow (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianFarmadin authored Apr 19, 2022
1 parent 70a6d52 commit 8555a0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public String getOrOriginal(String objectId) {
if (containsKey(objectId)) {
return get(objectId);
}
String extractedObjectId = extractObjectId(objectId);
if (containsKey(extractedObjectId)) {
return get(extractedObjectId);
}
for (String value : values()) {
if (value.startsWith(objectId + " (")) {
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

public class ObjId2FullSidMapTest {

public static final String FULL_SID_1 = "Smith (00000000-00000000-00000000-00000000)";
public static final String FULL_SID_1 = "Smith@test (00000000-00000000-00000000-00000000)";

public static final String EMAIL_1 = "Smith@test";
public static final String NAME_1 = "Smith";
public static final String OBJECT_ID_1 = "00000000-00000000-00000000-00000000";

@Test
public void testFullSId() {

final String fullSid = ObjId2FullSidMap.generateFullSid(NAME_1, OBJECT_ID_1);
final String fullSid = ObjId2FullSidMap.generateFullSid(EMAIL_1, OBJECT_ID_1);
Assert.assertEquals(FULL_SID_1, fullSid);
Assert.assertEquals(OBJECT_ID_1, ObjId2FullSidMap.extractObjectId(fullSid));
Assert.assertNull(ObjId2FullSidMap.extractObjectId("some string"));
Expand All @@ -24,7 +25,8 @@ public void testPutAndGet() {
map.putFullSid(FULL_SID_1);
Assert.assertEquals(FULL_SID_1, map.get(OBJECT_ID_1));
Assert.assertEquals(FULL_SID_1, map.getOrOriginal(OBJECT_ID_1));
Assert.assertEquals(FULL_SID_1, map.getOrOriginal(NAME_1));
Assert.assertEquals(FULL_SID_1, map.getOrOriginal(EMAIL_1));
Assert.assertEquals(FULL_SID_1, map.getOrOriginal(ObjId2FullSidMap.generateFullSid(NAME_1, OBJECT_ID_1)));
Assert.assertEquals("some string", map.getOrOriginal("some string"));
}
}

0 comments on commit 8555a0b

Please sign in to comment.