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(jans-config-api): issue UMA scope request being saved as OAUTH #2063

Merged
merged 47 commits into from
Aug 9, 2022
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9d444bd
bug(jans-config-api): fixed swagger format issue
pujavs Jul 22, 2022
4c253a2
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 25, 2022
f6eb80b
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 25, 2022
ac97cc6
fix(jans-config-api): fixed due to couchbase clustter change
pujavs Jul 25, 2022
cd554ae
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 25, 2022
f4bd7aa
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 26, 2022
b313aae
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 27, 2022
c8003fd
feat(jans-config-api): new endpoint to get UmaResource based on assoc…
pujavs Jul 27, 2022
fc5ebe0
fix(jans-config-api): swagger spec fix for client attributes
pujavs Jul 27, 2022
77d19bb
fix(jans-config-api): reverted the local test properties
pujavs Jul 27, 2022
d4f8194
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 27, 2022
a977d1f
test(jans-config-api): commented test case
pujavs Jul 27, 2022
15dee7f
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 28, 2022
b409633
feat(jans-config-api): scim config endpoint enhancment
pujavs Jul 28, 2022
1498d74
feat(jans-config-api): swagger and DTO change for new fields for scim…
pujavs Jul 29, 2022
6940645
Merge branch 'jans-config-api-fixes' of https://github.com/JanssenPro…
pujavs Jul 29, 2022
3ac7ea1
feat(jans-config-api): swagger and DTO change for new fields for scim…
pujavs Jul 29, 2022
8db181b
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jul 29, 2022
1faa93f
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 1, 2022
0e40cbe
fix(jans-config-api): rectified endpoint url in swagger spec for uma …
pujavs Aug 1, 2022
e40c219
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 2, 2022
ef33d5c
feat(jans-config-api): agama endpoint fixes
pujavs Aug 2, 2022
0c76af8
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 3, 2022
084c853
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 3, 2022
1a80d8e
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 3, 2022
0477b09
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
44415b9
fix(jans-config-api): fixed swagger spec for Uma Resource delete
pujavs Aug 3, 2022
77547bb
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
ee4afb3
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
f22cd3b
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
7ac9cde
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
3a05019
fix(jans-config-api): agama endpoint enhancements
pujavs Aug 3, 2022
153c746
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 4, 2022
d740c68
feat(jans-config-api): agama patch endpoint
pujavs Aug 4, 2022
0a8e5e6
feat(jans-config-api): agama patch endpoint
pujavs Aug 4, 2022
8ed2ba8
feat(jans-config-api): agama patch endpoint
pujavs Aug 4, 2022
c57ad28
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 4, 2022
bfafc93
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 5, 2022
f47a977
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 5, 2022
060c139
feat(jans-config-api): Scope object changes for creator details
pujavs Aug 5, 2022
3ba103a
feat(jans-config-api): Scope object changes for creator details
pujavs Aug 5, 2022
a1fc138
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 5, 2022
0e83c0b
fix(jans-config-api): updated agama endpoint for exception handling a…
pujavs Aug 8, 2022
670db74
test(jans-config-api): updates user mgmt test case for POST
pujavs Aug 8, 2022
e3182e4
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 9, 2022
343bd78
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Aug 9, 2022
698fa12
fix(jans-config-api): issue UMA scope request being saved as OAUTH
pujavs Aug 9, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Response getScopes(@DefaultValue("") @QueryParam(ApiConstants.TYPE) Strin
@DefaultValue(DEFAULT_LIST_SIZE) @QueryParam(value = ApiConstants.LIMIT) int limit,
@DefaultValue("") @QueryParam(value = ApiConstants.PATTERN) String pattern,
@DefaultValue("false") @QueryParam(value = ApiConstants.WITH_ASSOCIATED_CLIENTS) boolean withAssociatedClients) {
log.debug("SCOPES to be fetched type = " + type + " , limit = " + limit + " , pattern = " + pattern);
log.debug("SCOPES to be fetched based on type:{}, limit:{}, pattern:{}", type, limit, pattern);
final List<CustomScope> scopes;
if (StringHelper.isNotEmpty(pattern)) {
scopes = scopeService.searchScopes(pattern, limit, type, withAssociatedClients);
Expand All @@ -75,8 +75,8 @@ public Response getScopes(@DefaultValue("") @QueryParam(ApiConstants.TYPE) Strin
@ProtectedApi(scopes = { ApiAccessConstants.SCOPES_READ_ACCESS })
@Path(ApiConstants.INUM_PATH)
public Response getScopeById(@NotNull @PathParam(ApiConstants.INUM) String inum,
@DefaultValue("false") @QueryParam(value = ApiConstants.WITH_ASSOCIATED_CLIENTS) boolean withAssociatedClients) {
log.debug("SCOPES to be fetched - inum = " + inum);
@DefaultValue("false") @QueryParam(value = ApiConstants.WITH_ASSOCIATED_CLIENTS) boolean withAssociatedClients) {
log.debug("SCOPES to be fetched by inum:{}", inum);
CustomScope scope = scopeService.getScopeByInum(inum, withAssociatedClients);
checkResourceNotNull(scope, SCOPE);
return Response.ok(scope).build();
Expand All @@ -85,8 +85,8 @@ public Response getScopeById(@NotNull @PathParam(ApiConstants.INUM) String inum,
@POST
@ProtectedApi(scopes = { ApiAccessConstants.SCOPES_WRITE_ACCESS })
public Response createOpenidScope(@Valid Scope scope) {
log.debug("SCOPE to be added - scope = " + scope);
log.debug("SCOPE to be added - scope.getId() = " + scope.getId());
log.debug("SCOPE to be added - scope:{}", scope);

checkNotNull(scope.getId(), AttributeNames.ID);
if (scope.getDisplayName() == null) {
scope.setDisplayName(scope.getId());
Expand All @@ -97,35 +97,31 @@ public Response createOpenidScope(@Valid Scope scope) {
if (scope.getScopeType() == null) {
scope.setScopeType(ScopeType.OAUTH);
}
if (ScopeType.UMA.getValue().equalsIgnoreCase(scope.getScopeType().getValue())) {
scope.setScopeType(ScopeType.OAUTH);
}

scopeService.addScope(scope);
Scope result = scopeService.getScopeByInum(inum);
log.debug("SCOPE added is - " + result.getId());
log.debug("Id of newly added is {}", result.getId());
return Response.status(Response.Status.CREATED).entity(result).build();
}

@PUT
@ProtectedApi(scopes = { ApiAccessConstants.SCOPES_WRITE_ACCESS })
public Response updateScope(@Valid Scope scope) {
log.debug("SCOPE to be updated - scope = " + scope.getId());
log.debug("SCOPE to be updated - scop:{}", scope.getId());
String inum = scope.getInum();
checkNotNull(inum, SCOPE);
Scope existingScope = scopeService.getScopeByInum(inum);
checkResourceNotNull(existingScope, SCOPE);
if (scope.getScopeType() == null) {
scope.setScopeType(ScopeType.OAUTH);
}
if (ScopeType.UMA.getValue().equalsIgnoreCase(scope.getScopeType().getValue())) {
scope.setScopeType(ScopeType.OAUTH);
}

scope.setInum(existingScope.getInum());
scope.setBaseDn(scopeService.getDnForScope(inum));
scopeService.updateScope(scope);
Scope result = scopeService.getScopeByInum(inum);

log.debug("SCOPE updated is - " + result.getId());
log.debug("Updated scope:{}", result.getId());
return Response.ok(result).build();
}

Expand All @@ -135,14 +131,14 @@ public Response updateScope(@Valid Scope scope) {
@Path(ApiConstants.INUM_PATH)
public Response patchScope(@PathParam(ApiConstants.INUM) @NotNull String inum, @NotNull String pathString)
throws JsonPatchException, IOException {
log.debug("SCOPES to be patched - inum = " + inum + " , pathString = " + pathString);
log.debug("SCOPES patch details - inum:{}, pathString:{}", inum, pathString);
Scope existingScope = scopeService.getScopeByInum(inum);
checkResourceNotNull(existingScope, SCOPE);
existingScope = Jackson.applyPatch(pathString, existingScope);
scopeService.updateScope(existingScope);

existingScope = scopeService.getScopeByInum(inum);
log.debug("SCOPE patched is - " + existingScope.getId());
log.debug("patched scope:{}", existingScope.getId());

return Response.ok(existingScope).build();
}
Expand All @@ -151,7 +147,7 @@ public Response patchScope(@PathParam(ApiConstants.INUM) @NotNull String inum, @
@Path(ApiConstants.INUM_PATH)
@ProtectedApi(scopes = { ApiAccessConstants.SCOPES_DELETE_ACCESS })
public Response deleteScope(@PathParam(ApiConstants.INUM) @NotNull String inum) {
log.debug("SCOPES to be deleted - inum = " + inum);
log.debug("SCOPES to be deleted - inum:{}", inum);
Scope scope = scopeService.getScopeByInum(inum);
checkResourceNotNull(scope, SCOPE);
scopeService.removeScope(scope);
Expand Down