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

call-back-api #446

Open
wants to merge 6 commits into
base: feature-workflow-externalization
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
Copy link
Contributor

@dewniMW dewniMW Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update with the correct year. check all files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by :0f13918

~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
~ You may not alter or remove any copyright or other notice from copies of this content.
-->

<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>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.workflow.management</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2.43-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when merging the PR, need to make sure the correct version is included here

</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.api.server.workflow.management.common</artifactId>

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.workflow.mgt</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
*
* This software is the property of WSO2 LLC. and its suppliers, if any.
* Dissemination of any information or reproduction of any material contained
* herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
* You may not alter or remove any copyright or other notice from copies of this content.
*/

package org.wso2.carbon.identity.workflow.mgt.api.common;

import org.wso2.carbon.identity.workflow.mgt.WorkFlowExecutorManager;

/**
* Service holder class for user organization management services.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by : 0f13918

*/
public class WorkflowManagementServiceHolder {

private static WorkFlowExecutorManager workFlowExecutorManager;

/**
* Get workflow execute manager service.
*
* @return WorkFlowExecutorManager service.
*/
public static WorkFlowExecutorManager getWorkFlowExecutorManager() {

return workFlowExecutorManager;
}

/**
* Set workflow executor management OSGi service.
*
* @param workFlowExecutorManager service.
*/
public static void setWorkFlowExecutorManager(WorkFlowExecutorManager workFlowExecutorManager) {

WorkflowManagementServiceHolder.workFlowExecutorManager = workFlowExecutorManager;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
*
* This software is the property of WSO2 LLC. and its suppliers, if any.
* Dissemination of any information or reproduction of any material contained
* herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
* You may not alter or remove any copyright or other notice from copies of this content.
*/

package org.wso2.carbon.identity.workflow.mgt.api.common.factory;

import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.wso2.carbon.identity.workflow.mgt.WorkFlowExecutorManager;

/**
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to
* instantiate the WorkFlowExecutorManager type of object inside the container.
*/
public class WorkflowManagementOSGIServiceFactory extends AbstractFactoryBean<WorkFlowExecutorManager> {

private WorkFlowExecutorManager workFlowExecutorManager;

@Override
public Class<?> getObjectType() {

return Object.class;
}

@Override
protected WorkFlowExecutorManager createInstance() throws Exception {

if (this.workFlowExecutorManager == null) {
WorkFlowExecutorManager service = WorkFlowExecutorManager.getInstance();
if (service != null) {
this.workFlowExecutorManager = service;
} else {
throw new Exception("Unable to retrieve WorkFlowExecutorManager service.");
}
}
return this.workFlowExecutorManager;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
~ You may not alter or remove any copyright or other notice from copies of this content.
-->

<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>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.workflow.management</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2.43-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.api.server.workflow.management.v1</artifactId>
<packaging>jar</packaging>
<name>WSO2 Identity Server - Workflow Management Rest API</name>
<description>WSO2 Identity Server - Workflow Management Rest API</description>

<dependencies>
<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.server.api</groupId>
<artifactId>org.wso2.carbon.identity.workflow.mgt.api.common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.workflow.mgt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
</exclusions>
</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>
<!--Dependency to generate the code from the openapi generation.-->
<!-- <plugin>-->
<!-- <groupId>org.openapitools</groupId>-->
<!-- <artifactId>openapi-generator-maven-plugin</artifactId>-->
<!-- <version>4.1.2</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>generate</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <inputSpec>${project.basedir}/src/main/resources/workflow.mgt.yaml</inputSpec>-->
<!-- <generatorName>org.wso2.carbon.codegen.CxfWso2Generator</generatorName>-->
<!-- <configOptions>-->
<!-- <sourceFolder>src/gen/java</sourceFolder>-->
<!-- <apiPackage>org.wso2.carbon.identity.workflow.mgt.api.v1</apiPackage>-->
<!-- <modelPackage>org.wso2.carbon.identity.workflow.mgt.api.v1.model</modelPackage>-->
<!-- <packageName>org.wso2.carbon.identity.workflow.mgt.api.v1</packageName>-->
<!-- <dateLibrary>java8</dateLibrary>-->
<!-- <hideGenerationTimestamp>true</hideGenerationTimestamp>-->
<!-- </configOptions>-->
<!-- <output>.</output>-->
<!-- <skipOverwrite>false</skipOverwrite>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <dependencies>-->
<!-- <dependency>-->
<!-- <groupId>org.openapitools</groupId>-->
<!-- <artifactId>cxf-wso2-openapi-generator</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- </plugin>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* 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.workflow.mgt.api.v1;

import org.springframework.beans.factory.annotation.Autowired;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import java.io.InputStream;
import java.util.List;

import org.wso2.carbon.identity.workflow.mgt.api.v1.model.Error;
import org.wso2.carbon.identity.workflow.mgt.api.v1.model.WorkflowApprovalPatchRequest;
import org.wso2.carbon.identity.workflow.mgt.api.v1.WorkflowApiService;

import javax.validation.Valid;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;

import javax.validation.constraints.*;

@Path("/workflow")
@Api(description = "The workflow API")

public class WorkflowApi {

@Autowired
private WorkflowApiService delegate;

@Valid
@PATCH
@Path("/{workflow-id}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Update the workflow request status. ", notes = "This API provides the capability to update the workflow request status. ", response = Void.class, authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "me" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful Response", response = Void.class),
@ApiResponse(code = 401, message = "Authentication information is missing or invalid.", response = Void.class),
@ApiResponse(code = 403, message = "Access forbidden.", response = Void.class),
@ApiResponse(code = 404, message = "Resource is not found.", response = Error.class),
@ApiResponse(code = 500, message = "Internal server error.", response = Error.class)
})
public Response workflowWorkflowIdPatch(@ApiParam(value = "ID of the workflow request.",required=true) @PathParam("workflow-id") String workflowId, @ApiParam(value = "" ) @Valid WorkflowApprovalPatchRequest workflowApprovalPatchRequest) {

return delegate.workflowWorkflowIdPatch(workflowId, workflowApprovalPatchRequest );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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.workflow.mgt.api.v1;

import org.wso2.carbon.identity.workflow.mgt.api.v1.*;
import org.wso2.carbon.identity.workflow.mgt.api.v1.model.*;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import java.io.InputStream;
import java.util.List;
import org.wso2.carbon.identity.workflow.mgt.api.v1.model.Error;
import org.wso2.carbon.identity.workflow.mgt.api.v1.model.WorkflowApprovalPatchRequest;
import javax.ws.rs.core.Response;


public interface WorkflowApiService {

public Response workflowWorkflowIdPatch(String workflowId, WorkflowApprovalPatchRequest workflowApprovalPatchRequest);
}
Loading