forked from indigo-iam/iam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add left part to eduperson_scoped_affiliation - fix urn namespace for eduperson_entitlement - fix related jUnit tests - add subnamespaces support
- Loading branch information
1 parent
ab8c1a5
commit 5cfc517
Showing
5 changed files
with
33 additions
and
21 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
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
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 |
---|---|---|
|
@@ -59,7 +59,6 @@ | |
// @formatter:off | ||
"iam.host=example.org", | ||
"iam.jwt-profile.default-profile=aarc", | ||
"iam.organisation.name=org", | ||
// @formatter:on | ||
}) | ||
public class AarcProfileIntegrationTests extends EndpointsTestUtils { | ||
|
@@ -69,8 +68,8 @@ public class AarcProfileIntegrationTests extends EndpointsTestUtils { | |
private static final String USERNAME = "test"; | ||
private static final String PASSWORD = "password"; | ||
|
||
private static final String URN_GROUP_ANALYSIS = "urn:example:iam:group:Analysis#example.org"; | ||
private static final String URN_GROUP_PRODUCTION = "urn:example:iam:group:Production#example.org"; | ||
private static final String URN_GROUP_ANALYSIS = "urn:geant:iam.example:group:Analysis#example.org"; | ||
private static final String URN_GROUP_PRODUCTION = "urn:geant:iam.example:group:Production#example.org"; | ||
|
||
protected static final Set<String> BASE_SCOPES = Sets.newHashSet("openid", "profile"); | ||
protected static final Set<String> EDUPERSON_AFFILIATION_SCOPE = | ||
|
@@ -138,7 +137,7 @@ public void testEdupersonScopedAffiliationScope() throws Exception { | |
assertThat(token.getJWTClaimsSet().getClaim("email"), nullValue()); | ||
|
||
assertThat(token.getJWTClaimsSet().getClaim(EDUPERSON_SCOPED_AFFILIATION_SCOPE), | ||
equalTo("org")); | ||
equalTo("[email protected]")); | ||
} | ||
|
||
@Test | ||
|
@@ -152,7 +151,7 @@ public void testEdupersonScopedAffiliationAndEntitlementScopes() throws Exceptio | |
assertThat(token.getJWTClaimsSet().getClaim("email"), nullValue()); | ||
|
||
assertThat(token.getJWTClaimsSet().getClaim(EDUPERSON_SCOPED_AFFILIATION_SCOPE), | ||
equalTo("org")); | ||
equalTo("[email protected]")); | ||
|
||
List<String> groups = Lists | ||
.newArrayList(token.getJWTClaimsSet().getStringArrayClaim(EDUPERSON_ENTITLEMENT_CLAIM)); | ||
|
@@ -174,7 +173,7 @@ public void testAarcProfileIntrospect() throws Exception { | |
.param("token", token.getParsedString())) | ||
.andExpect(status().isOk()) | ||
.andExpect(jsonPath("$.active", equalTo(true))) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("org"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("[email protected]"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, hasSize(equalTo(2)))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, containsInAnyOrder(URN_GROUP_ANALYSIS, URN_GROUP_PRODUCTION))) | ||
.andExpect(jsonPath("$.name", equalTo("Test User"))) | ||
|
@@ -196,7 +195,7 @@ public void testAarcProfileUserinfo() throws Exception { | |
.andExpect(jsonPath("$.sub").exists()) | ||
.andExpect(jsonPath("$.organisation_name").doesNotExist()) | ||
.andExpect(jsonPath("$.groups").doesNotExist()) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("org"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("[email protected]"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, hasSize(equalTo(2)))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, containsInAnyOrder(URN_GROUP_ANALYSIS, URN_GROUP_PRODUCTION))) | ||
.andExpect(jsonPath("$.name", equalTo("Test User"))) | ||
|
@@ -216,7 +215,7 @@ public void testAarcProfileUserinfoWithEmail() throws Exception { | |
.andExpect(jsonPath("$.sub").exists()) | ||
.andExpect(jsonPath("$.organisation_name").doesNotExist()) | ||
.andExpect(jsonPath("$.groups").doesNotExist()) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("org"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM, equalTo("[email protected]"))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, hasSize(equalTo(2)))) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM, containsInAnyOrder(URN_GROUP_ANALYSIS, URN_GROUP_PRODUCTION))) | ||
.andExpect(jsonPath("$.name", equalTo("Test User"))) | ||
|