-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BaseAuthentication Service should return a 401
- Loading branch information
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/groovy/io/xh/hoist/exception/NotAuthenticatedException.groovy
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,24 @@ | ||
/* | ||
* This file belongs to Hoist, an application development toolkit | ||
* developed by Extremely Heavy Industries (www.xh.io | [email protected]) | ||
* | ||
* Copyright © 2023 Extremely Heavy Industries Inc. | ||
*/ | ||
|
||
package io.xh.hoist.exception | ||
|
||
import static org.apache.hc.core5.http.HttpStatus.SC_UNAUTHORIZED | ||
|
||
/** | ||
* Exception for use when the user making the request is not successfully authenticated, | ||
* | ||
* This exception is thrown by Hoist's {@link io.xh.hoist.security.BaseAuthenticationService} if | ||
* an incoming request cannot be successfully Authenticated. | ||
* | ||
* Instances of this exception will be sent to clients with HttpStatus 401 ('Unauthorized'). | ||
*/ | ||
class NotAuthenticatedException extends HttpException implements RoutineException { | ||
NotAuthenticatedException(String s = 'Not Authenticated') { | ||
super(s, null, SC_UNAUTHORIZED) | ||
} | ||
} |
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