Add checks for script token expiry date #1739
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes changes to introduce token expiry checks and update user notifications in the
deploy-board
anddeploy-service
modules. The most important changes include adding a warning message for deprecated script tokens, implementing token expiry logic, and updating tests to cover the new functionality.User Interface Updates:
deploy-board/deploy_board/templates/users/script_token_deprecation.html
: Added a warning message about script token deprecation and expiration after 180 days.deploy-board/deploy_board/templates/users/users_config.tmpl
: Included the script token deprecation message in the user configuration template. [1] [2]deploy-board/deploy_board/templates/users/users_moved_message.html
: Updated appearance to match the style of script token.Backend Changes:
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/config/TokenAuthenticationFactory.java
: AddedcheckTokenExpiry
property and methods to handle token expiry checks. [1] [2] [3]deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/TokenRoles.java
: Updated token expiry logic to use a 180-day validation period. [1] [2]deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/security/TeletraanScriptTokenProvider.java
: Implemented token expiry validation in theTeletraanScriptTokenProvider
class. [1] [2]Testing Updates:
deploy-service/teletraanservice/src/test/java/com/pinterest/teletraan/security/TeletraanScriptTokenProviderTest.java
: Updated tests to include scenarios for token expiry and parameterized tests forcheckTokenExpiry
. [1] [2] [3] [4]Launched Teletraan service locally and confirmed that all 3 cases are working as expected
checkTokenExpiry
not setcheckTokenExpiry
set to truecheckTokenExpiry
set to false