Search in sources :

Example 6 with ProtectedApi

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();
}
Also used : Conf(io.jans.as.model.config.Conf) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Example 7 with ProtectedApi

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();
}
Also used : JSONWebKey(io.jans.as.model.jwk.JSONWebKey) WebKeysConfiguration(io.jans.as.model.config.WebKeysConfiguration) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Example 8 with ProtectedApi

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();
}
Also used : Scope(io.jans.as.persistence.model.Scope) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Example 9 with ProtectedApi

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

Example 10 with ProtectedApi

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();
}
Also used : GluuConfiguration(io.jans.as.persistence.model.configuration.GluuConfiguration) ProtectedApi(io.jans.configapi.core.rest.ProtectedApi)

Aggregations

ProtectedApi (io.jans.configapi.core.rest.ProtectedApi)52 Client (io.jans.as.common.model.registration.Client)6 Conf (io.jans.as.model.config.Conf)6 Scope (io.jans.as.persistence.model.Scope)5 GluuConfiguration (io.jans.as.persistence.model.configuration.GluuConfiguration)5 GluuAttribute (io.jans.model.GluuAttribute)5 WebKeysConfiguration (io.jans.as.model.config.WebKeysConfiguration)4 UmaResource (io.jans.as.model.uma.persistence.UmaResource)3 SmtpConfiguration (io.jans.model.SmtpConfiguration)3 CustomScript (io.jans.model.custom.script.model.CustomScript)3 AppConfiguration (io.jans.as.model.configuration.AppConfiguration)2 JSONWebKey (io.jans.as.model.jwk.JSONWebKey)2 LicenseResponse (io.jans.ca.plugin.adminui.model.auth.LicenseResponse)2 ApplicationException (io.jans.ca.plugin.adminui.model.exception.ApplicationException)2 ScimAppConfiguration (io.jans.configapi.plugin.scim.model.config.ScimAppConfiguration)2 Properties (java.util.Properties)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 GluuOrganization (io.jans.as.persistence.model.GluuOrganization)1 OAuth2ConfigResponse (io.jans.ca.plugin.adminui.model.auth.OAuth2ConfigResponse)1 AUIConfiguration (io.jans.ca.plugin.adminui.model.config.AUIConfiguration)1