Skip to content

Commit c3959cf

Browse files
pditommasoclaude
andauthored
Fix cookie policy for Seqera Platform JWT token refresh (#6411) [ci fast]
* Fix cookie policy for Seqera Platform JWT token refresh Update lib-httpx to version 2.1.0 and configure cookie policy to ACCEPT_ALL for proper JWT token refresh handling in Tower and Wave clients. Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 8e4e6ff commit c3959cf

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

modules/nf-commons/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies {
3434
api 'org.pf4j:pf4j:3.12.0'
3535
api 'org.pf4j:pf4j-update:2.3.0'
3636
api 'dev.failsafe:failsafe:3.1.0'
37-
api 'io.seqera:lib-httpx:2.0.0'
37+
api 'io.seqera:lib-httpx:2.1.0'
3838
api 'io.seqera:lib-retry:2.0.0'
3939
// patch gson dependency required by pf4j
4040
api 'com.google.code.gson:gson:2.13.1'

plugins/nf-tower/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies {
4646
compileOnly project(':nextflow')
4747
compileOnly 'org.slf4j:slf4j-api:2.0.17'
4848
compileOnly 'org.pf4j:pf4j:3.12.0'
49-
compileOnly 'io.seqera:lib-httpx:2.0.0'
49+
compileOnly 'io.seqera:lib-httpx:2.1.0'
5050

5151
api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.0"
5252
api "com.fasterxml.jackson.core:jackson-databind:2.12.7.1"

plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ class TowerClient implements TraceObserverV2 {
320320
config.bearerToken(token)
321321
config.refreshToken(refreshToken)
322322
config.refreshTokenUrl(refreshUrl)
323+
config.refreshCookiePolicy(CookiePolicy.ACCEPT_ALL)
323324
return
324325
}
325326

@@ -333,6 +334,7 @@ class TowerClient implements TraceObserverV2 {
333334
// setup the refresh
334335
config.refreshToken(refreshToken)
335336
config.refreshTokenUrl(refreshUrl)
337+
config.refreshCookiePolicy(CookiePolicy.ACCEPT_ALL)
336338
return
337339
}
338340
}

plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ class TowerFusionToken implements FusionToken {
176176
final refreshUrl = refreshToken ? "$endpoint/oauth/access_token" : null
177177
// the client config
178178
final config = HxConfig.newBuilder()
179-
.withBearerToken(accessToken)
180-
.withRefreshToken(refreshToken)
181-
.withRefreshTokenUrl(refreshUrl)
182-
.withRetryStatusCodes(SERVER_ERRORS)
183-
.withRetryConfig(RetryConfig.config())
179+
.bearerToken(accessToken)
180+
.refreshToken(refreshToken)
181+
.refreshTokenUrl(refreshUrl)
182+
.refreshCookiePolicy(CookiePolicy.ACCEPT_ALL)
183+
.retryStatusCodes(SERVER_ERRORS)
184+
.retryConfig(RetryConfig.config())
184185
.build()
185186
// the client builder
186187
final builder = HxClient.newBuilder()

plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerXAuth.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TowerXAuth implements XAuthProvider {
5151
this.refreshToken = refreshToken
5252
//
5353
// the cookie manager
54-
cookieManager = new CookieManager()
54+
cookieManager = new CookieManager(null, CookiePolicy.ACCEPT_ALL)
5555
// create http client
5656
this.httpClient = HttpClient.newBuilder()
5757
.version(HttpClient.Version.HTTP_1_1)

plugins/nf-wave/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ dependencies {
4747
compileOnly 'org.slf4j:slf4j-api:2.0.17'
4848
compileOnly 'org.pf4j:pf4j:3.12.0'
4949
compileOnly 'io.seqera:lib-trace:0.1.0'
50-
compileOnly 'io.seqera:lib-httpx:2.0.0'
50+
compileOnly 'io.seqera:lib-httpx:2.1.0'
5151

5252
// Force lib-httpx version to avoid conflicts with older versions from nf-commons
53-
testImplementation 'io.seqera:lib-httpx:2.0.0'
53+
testImplementation 'io.seqera:lib-httpx:2.1.0'
5454

5555
api 'org.apache.commons:commons-compress:1.26.1'
5656
api 'org.apache.commons:commons-lang3:3.18.0'

plugins/nf-wave/src/main/io/seqera/wave/plugin/WaveClient.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class WaveClient {
150150
.refreshToken(tower.refreshToken)
151151
.refreshTokenUrl(refreshUrl)
152152
.retryConfig(config.retryOpts())
153+
.refreshCookiePolicy(CookiePolicy.ACCEPT_ALL)
153154
.build()
154155
}
155156

0 commit comments

Comments
 (0)