Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: scim config endpoint issue#271 #665

Merged
merged 38 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9170ed8
feat: scim config service
pujavs Jan 19, 2022
666b712
feat: scim config service
pujavs Jan 19, 2022
fed6414
feat: scim config service
pujavs Jan 19, 2022
3e90c4b
feat: scim config endpoint
pujavs Jan 20, 2022
0a98e20
feat: scim config endpoint
pujavs Jan 20, 2022
71099ec
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 20, 2022
3579773
feat: scim config endpoint
pujavs Jan 20, 2022
596d94b
feat: scim config endpoint
pujavs Jan 20, 2022
f9c0514
feat: scim config endpoint
pujavs Jan 20, 2022
126de6f
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 20, 2022
31058f1
feat: scim config endpoint
pujavs Jan 20, 2022
00c7fb7
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 21, 2022
94908d7
feat: scim config endpoint issue#271
pujavs Jan 21, 2022
f6feed8
feat: scim config endpoint issue#271
pujavs Jan 21, 2022
3f8329b
feat: scim config endpoint issue#271
pujavs Jan 21, 2022
c71e496
feat: scim config endpoint issue#271
pujavs Jan 21, 2022
86ded7e
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 24, 2022
0623c12
feat: sonar fixes
pujavs Jan 24, 2022
dc6b928
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 25, 2022
69a5ac2
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 25, 2022
e9d3840
feat: scim config endpoint
pujavs Jan 25, 2022
8554fcd
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 28, 2022
b1af1dd
feat: sonar issue
pujavs Jan 28, 2022
a000853
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 28, 2022
bd21232
feat: sonar issue
pujavs Jan 28, 2022
dc7d745
feat: sonar issue
pujavs Jan 28, 2022
0131e86
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 31, 2022
a4d49fd
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Jan 31, 2022
a7f9e53
feat: scim config endpoint changes to resolve sonar issue
pujavs Jan 31, 2022
e29a4b3
feat: scim config endpoint changes to resolve sonar issue
pujavs Jan 31, 2022
4ea1540
feat: scim config endpoint changes to resolve sonar issue
pujavs Jan 31, 2022
d460598
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Feb 1, 2022
340c38a
feat: scim config endpoint
pujavs Feb 1, 2022
3217b86
feat: scim config endpoint sonar issue
pujavs Feb 1, 2022
8d6adb7
feat: scim config endpoint sonar issue
pujavs Feb 1, 2022
a7d6576
Merge branch 'main' of https://github.com/JanssenProject/jans into ja…
pujavs Feb 1, 2022
60ab2f2
feat: scim config endpoint sonar issue
pujavs Feb 1, 2022
11be2e8
feat: scim config endpoint sonar issue
pujavs Feb 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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