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.
Create new migrations and add coverage
- Loading branch information
1 parent
1a5802d
commit 64fdc3f
Showing
6 changed files
with
34 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,29 @@ public void testAarcProfileIntrospect() throws Exception { | |
|
||
} | ||
|
||
@Test | ||
public void testAarcProfileIntrospectWithoutScopes() throws Exception { | ||
|
||
Set<String> scopes = Sets.newHashSet("openid", "profile", "email"); | ||
JWT token = JWTParser.parse(getAccessTokenForUser(scopes)); | ||
|
||
// @formatter:off | ||
mvc.perform(post("/introspect") | ||
.with(httpBasic(CLIENT_ID, CLIENT_SECRET)) | ||
.param("token", token.getParsedString())) | ||
.andExpect(status().isOk()) | ||
.andExpect(jsonPath("$.active", equalTo(true))) | ||
.andExpect(jsonPath("$." + EDUPERSON_SCOPED_AFFILIATION_CLAIM).doesNotExist()) | ||
.andExpect(jsonPath("$." + EDUPERSON_ENTITLEMENT_CLAIM).doesNotExist()) | ||
.andExpect(jsonPath("$." + EDUPERSON_ASSURANCE_CLAIM).doesNotExist()) | ||
.andExpect(jsonPath("$.name", equalTo("Test User"))) | ||
.andExpect(jsonPath("$.given_name", equalTo("Test"))) | ||
.andExpect(jsonPath("$.family_name", equalTo("User"))) | ||
.andExpect(jsonPath("$.email", equalTo("[email protected]"))); | ||
// @formatter:on | ||
|
||
} | ||
|
||
@Test | ||
@WithMockOAuthUser(clientId = CLIENT_ID, user = USERNAME, authorities = {"ROLE_USER"}, | ||
scopes = {"openid profile eduperson_scoped_affiliation eduperson_entitlement eduperson_assurance"}) | ||
|
3 changes: 1 addition & 2 deletions
3
iam-persistence/src/main/resources/db/migration/h2/V52__add_eduperson_system_scopes.sql
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
INSERT INTO system_scope(scope, description, icon, restricted, default_scope, structured, structured_param_description) | ||
VALUES | ||
('eduperson_scoped_affiliation', 'Access to EduPerson scoped affiliation information', null, false, false, false, null), | ||
('eduperson_entitlement', 'Access to EduPerson entitlements information', null, false, false, false, null), | ||
('eduperson_assurance', 'Access to EduPerson assurance information', null, false, false, false, null); | ||
('eduperson_entitlement', 'Access to EduPerson entitlements information', null, false, false, false, null); |
3 changes: 3 additions & 0 deletions
3
iam-persistence/src/main/resources/db/migration/h2/V81__add_eduperson_assurance_scope.sql
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INSERT INTO system_scope(scope, description, icon, restricted, default_scope, structured, structured_param_description) | ||
VALUES | ||
('eduperson_assurance', 'Access to EduPerson assurance information', null, false, false, false, null); |
3 changes: 1 addition & 2 deletions
3
iam-persistence/src/main/resources/db/migration/mysql/V52__add_eduperson_system_scopes.sql
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
INSERT INTO system_scope(scope, description, icon, restricted, default_scope, structured, structured_param_description) | ||
VALUES | ||
('eduperson_scoped_affiliation', 'Access to EduPerson scoped affiliation information', null, false, false, false, null), | ||
('eduperson_entitlement', 'Access to EduPerson entitlements information', null, false, false, false, null), | ||
('eduperson_assurance', 'Access to EduPerson assurance information', null, false, false, false, null); | ||
('eduperson_entitlement', 'Access to EduPerson entitlements information', null, false, false, false, null); |
3 changes: 3 additions & 0 deletions
3
iam-persistence/src/main/resources/db/migration/mysql/V81__add_eduperson_assurance_scope.sql
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INSERT INTO system_scope(scope, description, icon, restricted, default_scope, structured, structured_param_description) | ||
VALUES | ||
('eduperson_assurance', 'Access to EduPerson assurance information', null, false, false, false, null); |