use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class JwksResource method put.
@PUT
@ProtectedApi(scopes = { ApiAccessConstants.JWKS_WRITE_ACCESS })
public Response put(WebKeysConfiguration webkeys) {
log.debug("JWKS details to be updated - webkeys = " + webkeys);
final Conf conf = configurationService.findConf();
conf.setWebKeys(webkeys);
configurationService.merge(conf);
final String json = configurationService.findConf().getWebKeys().toString();
return Response.ok(json).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class JwksResource method getKeyById.
@GET
@ProtectedApi(scopes = { ApiAccessConstants.JWKS_READ_ACCESS })
@Path(ApiConstants.KID_PATH)
public Response getKeyById(@PathParam(ApiConstants.KID) @NotNull String kid) {
log.debug("Fetch JWK details by kid = " + kid);
WebKeysConfiguration webkeys = configurationService.findConf().getWebKeys();
log.debug("WebKeysConfiguration before addding new key =" + webkeys);
JSONWebKey jwk = getJSONWebKey(webkeys, kid);
return Response.ok(jwk).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class ScopesResource method patchScope.
@PATCH
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
@ProtectedApi(scopes = { ApiAccessConstants.SCOPES_WRITE_ACCESS })
@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);
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());
return Response.ok(existingScope).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class ScimConfigResource method getAppConfiguration.
@GET
@ProtectedApi(scopes = { "https://jans.io/scim/config.readonly" })
public Response getAppConfiguration() {
ScimAppConfiguration appConfiguration = scimConfigService.find();
log.debug("SCIM appConfiguration:{}", appConfiguration);
return Response.ok(appConfiguration).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class AcrsResource method updateDefaultAuthenticationMethod.
@PUT
@ProtectedApi(scopes = { ApiAccessConstants.ACRS_WRITE_ACCESS })
public Response updateDefaultAuthenticationMethod(@Valid AuthenticationMethod authenticationMethod) {
log.debug("ACRS details to update - authenticationMethod = " + authenticationMethod);
final GluuConfiguration gluuConfiguration = configurationService.findGluuConfiguration();
gluuConfiguration.setAuthenticationMode(authenticationMethod.getDefaultAcr());
configurationService.merge(gluuConfiguration);
return Response.ok(authenticationMethod).build();
}
Aggregations