-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from JeethJJ/master
Implement API support for invite offline option on user creation
- Loading branch information
Showing
20 changed files
with
1,764 additions
and
1 deletion.
There are no files selected for viewing
145 changes: 145 additions & 0 deletions
145
...carbon.identity.api.user.onboard/org.wso2.carbon.identity.api.user.onboard.common/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org). | ||
~ | ||
~ WSO2 Inc. licenses this file to you under the Apache License, | ||
~ Version 2.0 (the "License"); you may not use this file except | ||
~ in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<parent> | ||
<artifactId>org.wso2.carbon.identity.api.user.onboard</artifactId> | ||
<groupId>org.wso2.carbon.identity.user.api</groupId> | ||
<version>1.3.30-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>org.wso2.carbon.identity.api.user.onboard.common</artifactId> | ||
<version>1.3.30-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon</groupId> | ||
<artifactId>org.wso2.carbon.core</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-frontend-jaxrs</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-rs-service-description</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>javax.ws.rs-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.swagger</groupId> | ||
<artifactId>swagger-jaxrs</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>jsr311-api</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.jaxrs</groupId> | ||
<artifactId>jackson-jaxrs-json-provider</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.governance</groupId> | ||
<artifactId>org.wso2.carbon.identity.user.onboard.core.service</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon</groupId> | ||
<artifactId>org.wso2.carbon.utils</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${maven.compiler.plugin.version}</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<instructions> | ||
<Bundle-SymbolicName> | ||
${project.artifactId} | ||
</Bundle-SymbolicName> | ||
<Export-Package> | ||
org.wso2.carbon.identity.framework.*; | ||
</Export-Package> | ||
<Import-Package> | ||
org.wso2.carbon.identity.framework.*; version="${carbon.identity.framework.version.range}" | ||
</Import-Package> | ||
</instructions> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
42 changes: 42 additions & 0 deletions
42
...n/java/org/wso2/carbon/identity/api/user/onboard/common/UserOnboardServiceDataHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.api.user.onboard.common; | ||
|
||
import org.wso2.carbon.identity.user.onboard.core.service.UserOnboardCoreService; | ||
|
||
/** | ||
* Service holder class for User onboard service. | ||
* | ||
* Note: This date holder is populated through Spring Factory beans. Hence there is no setter references visible. Please | ||
* check the cxf xml related to the user rest service inside META-INF/cxf folder for setter references. | ||
*/ | ||
public class UserOnboardServiceDataHolder { | ||
|
||
private static UserOnboardCoreService userOnboardCoreService; | ||
|
||
public static UserOnboardCoreService getUserOnboardCoreService() { | ||
|
||
return userOnboardCoreService; | ||
} | ||
|
||
public static void setUserOnboardCoreService(UserOnboardCoreService userOnboardCoreService) { | ||
|
||
UserOnboardServiceDataHolder.userOnboardCoreService = userOnboardCoreService; | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
...common/src/main/java/org/wso2/carbon/identity/api/user/onboard/common/error/APIError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.api.user.onboard.common.error; | ||
|
||
import javax.ws.rs.WebApplicationException; | ||
import javax.ws.rs.core.Response; | ||
|
||
/** | ||
* Common Exception for all the API related errors. | ||
*/ | ||
public class APIError extends WebApplicationException { | ||
|
||
private static final long serialVersionUID = -5096160501755108984L; | ||
private String message; | ||
private String code; | ||
private ErrorDTO responseEntity; | ||
private Response.Status status; | ||
|
||
/** | ||
* Construct an APIError. | ||
* | ||
* @param status Status of the response. | ||
* @param errorResponse Error response. | ||
*/ | ||
public APIError(Response.Status status, ErrorDTO errorResponse) { | ||
|
||
this.responseEntity = errorResponse; | ||
this.message = status.getReasonPhrase(); | ||
this.code = errorResponse.getCode(); | ||
this.status = status; | ||
} | ||
|
||
/** | ||
* Construct an APIError. | ||
* | ||
* @param status Status of the response. | ||
* @param message Error message. | ||
* @param errorResponse Error response. | ||
*/ | ||
public APIError(Response.Status status, String message, ErrorDTO errorResponse) { | ||
|
||
this(status, errorResponse); | ||
this.message = message; | ||
this.code = errorResponse.getCode(); | ||
this.status = status; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
|
||
return message; | ||
} | ||
|
||
public String getCode() { | ||
|
||
return code; | ||
} | ||
|
||
public ErrorDTO getResponseEntity() { | ||
|
||
return responseEntity; | ||
} | ||
|
||
public Response.Status getStatus() { | ||
|
||
return status; | ||
} | ||
} | ||
|
Oops, something went wrong.