Search in sources :

Example 1 with ScimAppConfiguration

use of io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration 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();
}
Also used : ScimAppConfiguration(io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Example 2 with ScimAppConfiguration

use of io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration in project jans by JanssenProject.

the class ScimConfigResource method patchAppConfigurationProperty.

@PATCH
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
@ProtectedApi(scopes = { "https://jans.io/scim/config.write" })
public Response patchAppConfigurationProperty(@NotNull String requestString) throws IOException, JsonPatchException {
    log.debug("AUTH CONF details to patch - requestString:{}", requestString);
    ScimConf conf = scimConfigService.findConf();
    ScimAppConfiguration appConfiguration = conf.getDynamicConf();
    log.trace("AUTH CONF details BEFORE patch - conf:{}, appConfiguration:{}", conf, appConfiguration);
    appConfiguration = Jackson.applyPatch(requestString, appConfiguration);
    log.trace("AUTH CONF details BEFORE patch merge - appConfiguration:{}", appConfiguration);
    conf.setDynamicConf(appConfiguration);
    scimConfigService.merge(conf);
    appConfiguration = scimConfigService.find();
    log.debug("AUTH CONF details AFTER patch merge - appConfiguration:{}", appConfiguration);
    return Response.ok(appConfiguration).build();
}
Also used : ScimAppConfiguration(io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration) ScimConf(io.jans.configapi.plugin.scim.model.config.ScimConf) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Aggregations

ProtectedApi (io.jans.configapi.core.rest.ProtectedApi)2 ScimAppConfiguration (io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration)2 ScimConf (io.jans.configapi.plugin.scim.model.config.ScimConf)1