-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Allow REST-Authentication endpoints to send warnings for the AuthenticationResult #3686
Allow REST-Authentication endpoints to send warnings for the AuthenticationResult #3686
Conversation
…uth-rest-warnings
Codecov Report
@@ Coverage Diff @@
## master #3686 +/- ##
==========================================
- Coverage 61% 60.2% -0.8%
+ Complexity 6133 6063 -70
==========================================
Files 1451 1451
Lines 30900 30911 +11
Branches 2867 2869 +2
==========================================
- Hits 18849 18610 -239
- Misses 10246 10511 +265
+ Partials 1805 1790 -15
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3686 +/- ##
=========================================
Coverage ? 60.87%
Complexity ? 6127
=========================================
Files ? 1452
Lines ? 30957
Branches ? 2881
=========================================
Hits ? 18846
Misses ? 10297
Partials ? 1814
Continue to review full report at Codecov.
|
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.
This is excellent. A few comments here and there, mostly on docs.
### `X-Cas-Warning` | ||
|
||
For each `X-Cas-Warning` header present in the response, a corresponding `DefaultMessageDescriptor` is added | ||
to the `AuthenticationHandlerExecutionResult`. The header value is used as `code` and `defaultMessage`. |
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.
Rather that describing what happens internally API-wise (which doesn't really belong here and would serve better as javadocs, etc), it would be much better if you actually describe the what and not the how. What does CAS do when you pass along the warnings? where are they processed? where do they show up? etc etc. Avoid using class names and try to use plain language as much as possible.
...est-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java
Outdated
Show resolved
Hide resolved
...est-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java
Outdated
Show resolved
Hide resolved
...est-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java
Outdated
Show resolved
Hide resolved
...est-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java
Outdated
Show resolved
Hide resolved
docs/cas-server-documentation/installation/Rest-Authentication.md
Outdated
Show resolved
Hide resolved
docs/cas-server-documentation/installation/Rest-Authentication.md
Outdated
Show resolved
Hide resolved
docs/cas-server-documentation/installation/Rest-Authentication.md
Outdated
Show resolved
Hide resolved
@mmoayyed Please review again |
Looks great. Will merge at the right time. Thank you. |
This patch has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This patch has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This patch has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
With this PR,
RestAuthenticationHandler
reads two custom HTTP headers which can contain warnings for the createdAuthenticationHandlerExecutionResult
:X-Cas-PasswordExpirationDate
will generate aPasswordExpiringWarningMessageDescriptor
.X-Cas-Warning
will generate aDefaultMessageDescriptor
(can be used multiple times)