Add JWT token refresh to Fusion validation request#6231
Merged
pditommaso merged 4 commits intomasterfrom Jun 30, 2025
Merged
Conversation
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
jordeu
approved these changes
Jun 28, 2025
plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovy
Show resolved
Hide resolved
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
pditommaso
added a commit
that referenced
this pull request
Jun 30, 2025
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
pditommaso
added a commit
that referenced
this pull request
Jun 30, 2025
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
pditommaso
added a commit
that referenced
this pull request
Jun 30, 2025
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
exthnet
pushed a commit
to exthnet/nextflow_tcs
that referenced
this pull request
Jul 3, 2025
… [ci fast] Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: Satoshi OHSHIMA <ohshima@cc.kyushu-u.ac.jp>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds the support for JWT token refresh to the Fusion validation HTTP request.
Detail
This pull request introduces significant changes to the
TowerFusionTokenclass and its corresponding test suite, focusing on improving token management, adding support for token refresh flow, and enhancing test coverage. Key changes include the addition of a refresh token mechanism, modifications to the HTTP client configuration, and new tests to validate the behavior of token refresh and retry logic.Token Management Enhancements:
refreshTokenalongsideaccessTokento enable token refresh workflows. Updated the constructor to initializerefreshTokenusingPlatformHelper. ([[1]](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21L83-R88),[[2]](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21R101))refreshJwtToken0method to handle token refresh requests and updateaccessTokenandrefreshTokenbased on received cookies. ([plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovyR344-R391](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21R344-R391))sendRequestmethod to retry requests with refreshed tokens upon receiving a 401 Unauthorized response. ([plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovyL292-R334](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21L292-R334))HTTP Client Configuration:
cookieManagera class-level field to manage cookies across requests. UpdatednewDefaultHttpClientto use this sharedcookieManager. ([[1]](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21R66-R67),[[2]](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21L185-R195))safeHttpSendintohttpSendandsafeApplyto simplify error handling and improve readability. ([plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovyL239-R255](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-d32afd5d3bc193f22e71a22cf64193ef5b3ce79652cfb81991c499a049d04a21L239-R255))Test Suite Enhancements:
[plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerFusionEnvTest.groovyR338-R424](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-1f6c1ec51e8c0824fec6d7c608d21f5465113d7d689d35e2c516c9cb18bae283R338-R424))[plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerFusionEnvTest.groovyR338-R424](https://github.com/nextflow-io/nextflow/pull/6231/files#diff-1f6c1ec51e8c0824fec6d7c608d21f5465113d7d689d35e2c516c9cb18bae283R338-R424))