-
Notifications
You must be signed in to change notification settings - Fork 541
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
Refactor ActionManagementDAO to handle action type specific properties #6119
base: master
Are you sure you want to change the base?
Changes from all commits
0756224
c207614
a3a6111
891c883
9245f16
1f987bb
4dca5c1
1296c3a
ab1bb18
f4b2f28
374b341
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,10 @@ | |
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
<artifactId>org.wso2.carbon.identity.secret.mgt.core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
<artifactId>org.wso2.carbon.identity.certificate.management</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json.wso2</groupId> | ||
<artifactId>json</artifactId> | ||
|
@@ -54,6 +58,7 @@ | |
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
|
@@ -178,14 +183,14 @@ | |
<!-- Temporarily decreasing this. | ||
Will be improved upon in a follow-up effort. | ||
Related issue: https://github.com/wso2/product-is/issues/21368 --> | ||
<minimum>0.70</minimum> | ||
<minimum>0.77</minimum> | ||
</limit> | ||
<limit implementation="org.jacoco.report.check.Limit"> | ||
<counter>COMPLEXITY</counter> | ||
<value>COVEREDRATIO</value> | ||
<!-- Temp decreasing this. There is an ongoing effort to improve | ||
the code complexity coverage. --> | ||
<minimum>0.60</minimum> | ||
<minimum>0.68</minimum> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep this to 0.6 |
||
</limit> | ||
</limits> | ||
</rule> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,10 @@ | |
*/ | ||
public class ActionMgtConstants { | ||
|
||
public static final String URI_ATTRIBUTE = "uri"; | ||
public static final String AUTHN_TYPE_ATTRIBUTE = "authnType"; | ||
public static final String URI_PROPERTY = "uri"; | ||
public static final String AUTHN_TYPE_PROPERTY = "authnType"; | ||
public static final String PASSWORD_SHARING_FORMAT_PROPERTY = "passwordSharingFormat"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This constant should not come to the actions core. It's specific to a particular extension |
||
public static final String CERTIFICATE_ID_PROPERTY = "certificateId"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
public static final String IDN_SECRET_TYPE_ACTION_SECRETS = "ACTION_API_ENDPOINT_AUTH_SECRETS"; | ||
|
||
public static final String ACTION_NAME_FIELD = "Action name"; | ||
|
@@ -53,19 +55,30 @@ public enum ErrorMessages { | |
"%s is empty."), | ||
ERROR_INVALID_ACTION_REQUEST_FIELD("60005", "Invalid request.", | ||
"%s is invalid."), | ||
ERROR_INVALID_ACTION_CERTIFICATE("60006", "Invalid request.", "Provided certificate is invalid."), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is specific to a particular extension, we should be able to take these validations out from the core |
||
|
||
// Client errors thrown at REST API layer. | ||
ERROR_INVALID_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60007", "Unable to perform the operation.", | ||
"Required authentication properties are not provided or invalid."), | ||
ERROR_INVALID_ACTION_ENDPOINT_AUTH_TYPE("60008", "Invalid Authentication Type for Action Endpoint.", | ||
"Invalid authentication type used for path parameter."), | ||
ERROR_EMPTY_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60009", "Unable to perform the operation.", | ||
"Authentication property values cannot be empty."), | ||
ERROR_NO_ACTION_FOUND_ON_GIVEN_ACTION_TYPE_AND_ID("60010", "Action is not found.", | ||
"No action is found for given action id and action type"), | ||
|
||
// Server errors. | ||
ERROR_WHILE_ADDING_ACTION("65001", "Error while adding Action.", | ||
"Error while persisting Action in the system."), | ||
ERROR_WHILE_ADDING_ENDPOINT_PROPERTIES("65002", "Error while adding Endpoint properties", | ||
"Error while persisting Action Endpoint properties in the system."), | ||
ERROR_WHILE_RETRIEVING_ACTION_ENDPOINT_PROPERTIES("65003", | ||
"Error while retrieving Action Endpoint properties", | ||
"Error while retrieving Action Endpoint properties from the system."), | ||
ERROR_WHILE_ADDING_ACTION_PROPERTIES("65002", "Error while adding Action properties", | ||
"Error while persisting Action properties in the system."), | ||
ERROR_WHILE_RETRIEVING_ACTION_PROPERTIES("65003", | ||
"Error while retrieving Action properties", | ||
"Error while retrieving Action properties from the system."), | ||
ERROR_WHILE_RETRIEVING_ACTIONS_BY_ACTION_TYPE("65004", | ||
"Error while retrieving Actions by Action Type", | ||
"Error while retrieving Actions by Action Type from the system."), | ||
ERROR_WHILE_UPDATING_ENDPOINT_PROPERTIES("65005", | ||
ERROR_WHILE_UPDATING_ACTION_PROPERTIES("65005", | ||
"Error while updating Action Endpoint properties", | ||
"Error while updating Action Endpoint properties in the system."), | ||
ERROR_WHILE_UPDATING_ACTION("65006", "Error while updating Action.", | ||
|
@@ -84,11 +97,22 @@ public enum ErrorMessages { | |
ERROR_WHILE_DECRYPTING_ACTION_ENDPOINT_AUTH_PROPERTIES("65012", | ||
"Error while decrypting Action Endpoint Authentication properties", | ||
"Error while decrypting Action Endpoint Authentication properties in the system."), | ||
ERROR_NO_AUTHENTICATION_TYPE("65013", | ||
"Error while retrieving Action Endpoint Authentication configurations", | ||
"Authentication type is not defined for the Action Endpoint."), | ||
ERROR_WHILE_UPDATING_ACTION_BASIC_INFO("65014", "Error while updating basic Action information", | ||
"Error while updating basic Action information in the system."); | ||
ERROR_WHILE_UPDATING_ACTION_BASIC_INFO("65013", "Error while updating basic Action information", | ||
"Error while updating basic Action information in the system."), | ||
ERROR_WHILE_BUILDING_ACTION_RESPONSE("65014", "Error while building Action response.", | ||
"Error while building Action response object."), | ||
ERROR_WHILE_ADDING_ACTION_CERTIFICATE("65015", "Error while adding action certificate.", | ||
"Error while persisting certificate in the system."), | ||
ERROR_WHILE_RETRIEVING_ACTION_CERTIFICATE("65016", "Error while retrieving action certificate.", | ||
"Error while retrieving certificate from the system."), | ||
ERROR_WHILE_UPDATING_ACTION_CERTIFICATE("65017", "Error while updating action certificate.", | ||
"Error while updating certificate in the system."), | ||
ERROR_WHILE_DELETING_ACTION_CERTIFICATE("65018", "Error while deleting action certificate.", | ||
"Error while deleting certificate from the system."), | ||
|
||
// Server errors thrown at REST API layer. | ||
ERROR_NOT_IMPLEMENTED_ACTION_TYPE("650015", "Unable to perform the operation.", | ||
"The requested action type is not currently supported by the server."); | ||
|
||
private final String code; | ||
private final String message; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target here should be 0.8