forked from wso2/carbon-identity-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wso2:master' into improve-action-execute
- Loading branch information
Showing
323 changed files
with
7,358 additions
and
750 deletions.
There are no files selected for viewing
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
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,15 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
notify: | ||
wait_for_ci: yes | ||
coverage: | ||
status: | ||
project: # checks the effect for the overall code coverage rate of the repository. | ||
default: | ||
enabled: yes | ||
threshold: null | ||
target: auto | ||
patch: # This status indicates the extent of code coverage achieved by the pull request. | ||
default: | ||
target: 80% | ||
threshold: 40% # With a target of 80% and a threshold of 40%, the acceptable coverage range is 40% to 80%. |
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
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
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
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
106 changes: 106 additions & 0 deletions
106
...java/org/wso2/carbon/identity/action/execution/model/ActionInvocationFailureResponse.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,106 @@ | ||
/* | ||
* Copyright (c) 2024, 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.action.execution.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; | ||
|
||
/** | ||
* This class is used to represent the failure response of an action invocation. | ||
* This response will contain the failure reason and the failure description. | ||
*/ | ||
@JsonDeserialize(builder = ActionInvocationFailureResponse.Builder.class) | ||
public class ActionInvocationFailureResponse implements ActionInvocationResponse.APIResponse { | ||
|
||
private final ActionInvocationResponse.Status actionStatus; | ||
private final String failureReason; | ||
private final String failureDescription; | ||
|
||
private ActionInvocationFailureResponse(ActionInvocationFailureResponse.Builder builder) { | ||
|
||
this.actionStatus = builder.actionStatus; | ||
this.failureReason = builder.failureReason; | ||
this.failureDescription = builder.failureDescription; | ||
} | ||
|
||
public ActionInvocationResponse.Status getActionStatus() { | ||
|
||
return actionStatus; | ||
} | ||
|
||
public String getFailureReason() { | ||
|
||
return failureReason; | ||
} | ||
|
||
public String getFailureDescription() { | ||
|
||
return failureDescription; | ||
} | ||
|
||
/** | ||
* This class is used to build the {@link ActionInvocationFailureResponse}. | ||
*/ | ||
@JsonPOJOBuilder(withPrefix = "") | ||
public static class Builder { | ||
|
||
private ActionInvocationResponse.Status actionStatus; | ||
private String failureReason; | ||
private String failureDescription; | ||
|
||
@JsonProperty("actionStatus") | ||
public ActionInvocationFailureResponse.Builder actionStatus(ActionInvocationResponse.Status actionStatus) { | ||
|
||
this.actionStatus = actionStatus; | ||
return this; | ||
} | ||
|
||
@JsonProperty("failureReason") | ||
public ActionInvocationFailureResponse.Builder failureReason(String failureReason) { | ||
|
||
this.failureReason = failureReason; | ||
return this; | ||
} | ||
|
||
@JsonProperty("failureDescription") | ||
public ActionInvocationFailureResponse.Builder failureDescription(String failureDescription) { | ||
|
||
this.failureDescription = failureDescription; | ||
return this; | ||
} | ||
|
||
public ActionInvocationFailureResponse build() { | ||
|
||
if (actionStatus == null) { | ||
throw new IllegalArgumentException("The actionStatus must not be null."); | ||
} | ||
|
||
if (!ActionInvocationResponse.Status.FAILED.equals(actionStatus)) { | ||
throw new IllegalArgumentException("The actionStatus must be FAILED."); | ||
} | ||
|
||
if (failureReason == null || failureReason.isEmpty()) { | ||
throw new IllegalArgumentException("The failureReason cannot be null or empty."); | ||
} | ||
|
||
return new ActionInvocationFailureResponse(this); | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -24,4 +24,5 @@ | |
*/ | ||
public enum ActionType { | ||
PRE_ISSUE_ACCESS_TOKEN, | ||
AUTHENTICATION | ||
} |
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
Oops, something went wrong.