Skip to content

Commit

Permalink
feat(jans-config-api): scim config endpoint issue #271 (#665)
Browse files Browse the repository at this point in the history
* feat: scim config service

* feat: scim config service

* feat: scim config service

* feat: scim config endpoint

* feat: scim config endpoint

* feat: scim config endpoint

* feat: scim config endpoint

* feat: scim config endpoint

* feat: scim config endpoint

* feat: scim config endpoint issue#271

* feat: scim config endpoint issue#271

* feat: scim config endpoint issue#271

* feat: scim config endpoint issue#271

* feat: sonar fixes

* feat: scim config endpoint

* feat: sonar issue

* feat: sonar issue

* feat: sonar issue

* feat: scim config endpoint changes to resolve sonar issue

* feat: scim config endpoint changes to resolve sonar issue

* feat: scim config endpoint changes to resolve sonar issue

* feat: scim config endpoint

* feat: scim config endpoint sonar issue

* feat: scim config endpoint sonar issue

* feat: scim config endpoint sonar issue

* feat: scim config endpoint sonar issue
  • Loading branch information
pujavs authored Feb 2, 2022
1 parent 0ee6386 commit a6e9a04
Show file tree
Hide file tree
Showing 56 changed files with 849 additions and 180 deletions.
5 changes: 5 additions & 0 deletions jans-config-api/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

<dependencies>
<!-- jans -->
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-config-api-shared</artifactId>
</dependency>
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-core-util</artifactId>
Expand All @@ -34,6 +38,7 @@
<artifactId>jans-auth-common</artifactId>
</dependency>


<!-- RestEasy -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.jans.configapi.model.configuration;

import io.jans.configapi.core.model.Conf;
import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.JsonObject;
import io.jans.orm.annotation.ObjectClass;

@DataEntry
@ObjectClass(value = "jansAppConf")
public class ApiConf extends Conf {

@JsonObject
@AttributeName(name = "jansConfDyn")
private ApiAppConfiguration dynamicConf;

public ApiAppConfiguration getDynamicConf() {
return dynamicConf;
}

public void setDynamicConf(ApiAppConfiguration dynamicConf) {
this.dynamicConf = dynamicConf;
}

@Override
public String toString() {
return "ApiConf [dn=" + dn + ", dynamicConf=" + dynamicConf + ", staticConf=" + staticConf + ", revision="
+ revision + "]";
}
}
123 changes: 122 additions & 1 deletion jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tags:
- name: Statistics - User
- name: Health - Check
- name: SCIM - User Management
- name: SCIM - Config Management
- name: Auth Server Health - Check
- name: Admin UI - Role
- name: Admin UI - Permission
Expand Down Expand Up @@ -2805,6 +2806,60 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
security:
- oauth2: [https://jans.io/oauth/config/scim/users.read https://jans.io/scim/users.read]
/jans-config-api/scim/config:
get:
summary: Retrieves SCIM App configuration.
description: Retrieves SCIM configuration.
operationId: get-scim-config
security:
- oauth2: [https://jans.io/scim/config.readonly]
tags:
- SCIM - Config Management
responses:
'200':
description: OK
content:
application/json:
schema:
title: ScimAppConfiguration
description: SCIM App configuration.
$ref: '#/components/schemas/ScimAppConfiguration'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
patch:
summary: Partially modifies SCIM App configuration.
description: Partially modifies SCIM App configuration.
operationId: patch-scim-config
security:
- oauth2: [https://jans.io/scim/config.write]
tags:
- SCIM - Config Management
requestBody:
content:
application/json-patch+json:
schema:
type: array
items:
$ref: '#/components/schemas/PatchRequest'
description: String representing patch-document.
example: '[ {op:replace, path: loggingLevel, value: DEBUG } ]'
responses:
'200':
description: OK
content:
application/json:
schema:
title: ScimAppConfiguration
description: SCIM App configuration.
$ref: '#/components/schemas/ScimAppConfiguration'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/jans-config-api/api/v1/jans-auth-server/health:
get:
summary: Returns auth server health status.
Expand Down Expand Up @@ -3279,6 +3334,8 @@ components:
https://jans.io/oauth/config/stats.readonly: Vew server with basic statistic
https://jans.io/oauth/config/scim/users.read: Vew scim user related information
https://jans.io/oauth/config/scim/users.write: Manage scim user related information
https://jans.io/scim/config.readonly: Vew SCIM App configuration
https://jans.io/scim/config.write: Manage SCIM App configuration

responses:
Found:
Expand Down Expand Up @@ -6422,4 +6479,68 @@ components:
description: The customer first name.
customerLastName:
type: string
description: The customer last name.
description: The customer last name.
ScimAppConfiguration:
type: object
properties:
baseDN:
type: string
description: Application config Base DN
applicationUrl:
type: string
description: Application base URL
baseEndpoint:
type: string
description: SCIM base endpoint URL
personCustomObjectClass:
type: string
description: Person Object Class
oxAuthIssuer:
type: string
description: Jans Auth - Issuer identifier.
protectionMode:
type: string
enum:
- OAUTH
- BYPASS
description: SCIM Protection Mode
maxCount:
type: integer
example: Maximum number of results per page
userExtensionSchemaURI:
type: string
description: User Extension Schema URI
loggingLevel:
type: string
description: Logging level for scim logger.
enum:
- TRACE
- DEBUG
- INFO
- WARN
- ERROR
- FATAL
- OFF
loggingLayout:
type: string
description: Logging layout used for Server loggers.
externalLoggerConfiguration:
type: string
description: Path to external log4j2 logging configuration.
metricReporterInterval:
type: integer
description: The interval for metric reporter in seconds.
metricReporterKeepDataDays:
type: integer
description: The days to keep metric reported data.
metricReporterEnabled:
type: boolean
description: Metric reported data enabled flag.
disableJdkLogger:
type: boolean
description: Boolean value specifying whether to enable JDK Loggers.
useLocalCache:
type: boolean
description: Boolean value specifying whether to enable local in-memory cache.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import io.jans.ca.plugin.adminui.service.auth.OAuth2Service;
import io.jans.ca.plugin.adminui.service.config.AUIConfigurationService;
import io.jans.ca.plugin.adminui.utils.ErrorResponse;
import io.jans.configapi.filters.ProtectedApi;
import io.jans.configapi.core.rest.ProtectedApi;
import org.slf4j.Logger;

import javax.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.jans.ca.plugin.adminui.model.auth.LicenseResponse;
import io.jans.ca.plugin.adminui.service.license.LicenseDetailsService;
import io.jans.ca.plugin.adminui.utils.ErrorResponse;
import io.jans.configapi.filters.ProtectedApi;
import io.jans.configapi.core.rest.ProtectedApi;
import org.slf4j.Logger;

import javax.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.jans.as.model.config.adminui.AdminPermission;
import io.jans.as.model.config.adminui.AdminRole;
import io.jans.as.model.config.adminui.RolePermissionMapping;
import io.jans.configapi.filters.ProtectedApi;
import io.jans.configapi.core.rest.ProtectedApi;
import io.jans.ca.plugin.adminui.model.exception.ApplicationException;
import io.jans.ca.plugin.adminui.service.user.UserManagementService;
import io.jans.ca.plugin.adminui.utils.ErrorResponse;
Expand Down
34 changes: 31 additions & 3 deletions jans-config-api/plugins/scim-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<httpclient.version>4.5.13</httpclient.version>
</properties>


<dependencies>

<!-- config api -->
Expand All @@ -28,6 +27,11 @@
<artifactId>jans-config-api-server</artifactId>
<version>${jans.version}</version>
</dependency>
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-orm-annotation</artifactId>
<version>${jans.version}</version>
</dependency>
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-scim-model</artifactId>
Expand All @@ -46,7 +50,6 @@
<version>1.5.0</version>
</dependency>


<!-- Others -->
<dependency>
<groupId>commons-collections</groupId>
Expand Down Expand Up @@ -177,6 +180,31 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>deploy-to-local-folder</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>../target/plugins</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<include>*-distribution.jar</include>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<includes>
<include>io.jans:jans-scim-model</include>
<include>io.jans:jans-scim-client</include>
<include>io.jans:jans-config-api-shared</include>
</includes>
<scope>runtime</scope>
</dependencySet>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/

package io.jans.configapi.plugin.scim.configuration;

import io.jans.configapi.configuration.ConfigurationFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.slf4j.Logger;

@ApplicationScoped
public class ScimConfigurationFactory {

public static final String CONFIGURATION_ENTRY_DN = "scim_ConfigurationEntryDN";

@Inject
private Logger log;

@Inject
ConfigurationFactory configurationFactory;

public String getScimConfigurationDn() {
return configurationFactory.getConfigurationDn(CONFIGURATION_ENTRY_DN);
}

}
Loading

0 comments on commit a6e9a04

Please sign in to comment.