Search in sources :

Example 1 with OxTrustJsonSetting

use of org.gluu.oxtrust.api.server.model.OxTrustJsonSetting in project oxTrust by GluuFederation.

the class OxTrustJsonSettingWebResource method getOxtrustJsonSettings.

@GET
@Operation(summary = "Get json oxtrust settings", description = "Get json oxtrust settings")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = OxTrustJsonSetting.class)), description = Constants.RESULT_SUCCESS), @ApiResponse(responseCode = "500", description = "Server error") })
@ProtectedApi(scopes = { READ_ACCESS })
public Response getOxtrustJsonSettings() {
    try {
        log(logger, "Processing oxtrust json settings retrival");
        this.oxTrustappConfiguration = jsonConfigurationService.getOxTrustappConfiguration();
        OxTrustJsonSetting setting = new OxTrustJsonSetting();
        setting.setOrgName(this.oxTrustappConfiguration.getOrganizationName());
        setting.setSupportEmail(this.oxTrustappConfiguration.getOrgSupportEmail());
        setting.setAuthenticationRecaptchaEnabled(this.oxTrustappConfiguration.isAuthenticationRecaptchaEnabled());
        setting.setCleanServiceInterval(this.oxTrustappConfiguration.getCleanServiceInterval());
        setting.setEnforceEmailUniqueness(this.oxTrustappConfiguration.getEnforceEmailUniqueness());
        setting.setPasswordResetRequestExpirationTime(this.oxTrustappConfiguration.getPasswordResetRequestExpirationTime());
        setting.setLoggingLevel(this.oxTrustappConfiguration.getLoggingLevel());
        return Response.ok(setting).build();
    } catch (Exception e) {
        log(logger, e);
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
    }
}
Also used : OxTrustJsonSetting(org.gluu.oxtrust.api.server.model.OxTrustJsonSetting) ProtectedApi(org.gluu.oxtrust.service.filter.ProtectedApi) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

Operation (io.swagger.v3.oas.annotations.Operation)1 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)1 OxTrustJsonSetting (org.gluu.oxtrust.api.server.model.OxTrustJsonSetting)1 ProtectedApi (org.gluu.oxtrust.service.filter.ProtectedApi)1