-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize: add secure authentication to interfaces in ClusterController (
- Loading branch information
Showing
13 changed files
with
566 additions
and
29 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
65 changes: 65 additions & 0 deletions
65
common/src/main/java/io/seata/common/exception/AuthenticationFailedException.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,65 @@ | ||
/* | ||
* Copyright 1999-2019 Seata.io Group. | ||
* | ||
* Licensed 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 io.seata.common.exception; | ||
|
||
|
||
/** | ||
* Exception indicating authentication failure. This exception is typically thrown | ||
* when the authentication process fails, and it extends SecurityException to | ||
* signal that it is a security-related issue. | ||
*/ | ||
public class AuthenticationFailedException extends SecurityException { | ||
|
||
/** | ||
* Constructs a new AuthenticationFailedException with no detailed message. | ||
*/ | ||
public AuthenticationFailedException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs a new AuthenticationFailedException with the specified detail message. | ||
* | ||
* @param message the detail message (which is saved for later retrieval | ||
* by the getMessage() method). | ||
*/ | ||
public AuthenticationFailedException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new AuthenticationFailedException with the specified cause. | ||
* | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* getCause() method). | ||
*/ | ||
public AuthenticationFailedException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs a new AuthenticationFailedException with the specified detail | ||
* message and cause. | ||
* | ||
* @param message the detail message (which is saved for later retrieval | ||
* by the getMessage() method). | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* getCause() method). | ||
*/ | ||
public AuthenticationFailedException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
common/src/main/java/io/seata/common/exception/RetryableException.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,67 @@ | ||
/* | ||
* Copyright 1999-2019 Seata.io Group. | ||
* | ||
* Licensed 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 io.seata.common.exception; | ||
|
||
|
||
|
||
/** | ||
* Exception indicating a retryable failure. This exception is typically thrown | ||
* when a retryable process fails, and it extends RuntimeException to | ||
* signal that it is an unchecked exception. | ||
*/ | ||
public class RetryableException extends Exception { | ||
|
||
/** | ||
* Constructs a new RetryableException with no detailed message. | ||
*/ | ||
public RetryableException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs a new RetryableException with the specified detail message. | ||
* | ||
* @param message the detail message (which is saved for later retrieval | ||
* by the getMessage() method). | ||
*/ | ||
public RetryableException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new RetryableException with the specified cause. | ||
* | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* getCause() method). | ||
*/ | ||
public RetryableException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs a new RetryableException with the specified detail | ||
* message and cause. | ||
* | ||
* @param message the detail message (which is saved for later retrieval | ||
* by the getMessage() method). | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* getCause() method). | ||
*/ | ||
public RetryableException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} | ||
|
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.