Skip to content

The token caching does not seem to work (at least not when using the plugin for allprojects from init.gradle.kts) #224

@lestephane

Description

@lestephane

From looking at your code, I could see you intended to cache tokens for the lifetime of the plugin.
But it seems that, despite the gradle daemon staying around, the plugin instance does not.

To test the hypothesis, I ran the same command twice, and expected the second one to not output anything (ie. no GetAuthorization, because the token from the first one is not expired yet).

$ gradle build --debug | grep "/v1/authorization-token"
2021-09-17T13:12:28.564+0200 [DEBUG] [software.amazon.awssdk.request] Sending Request: DefaultSdkHttpFullRequest(httpMethod=POST, protocol=https, host=codeartifact.eu-central-1.amazonaws.com, encodedPath=/v1/authorization-token, headers=[amz-sdk-invocation-id, User-Agent], queryParameters=[domain, domain-owner])
2021-09-17T13:12:28.674+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request POST /v1/authorization-token?domain=SCRUBBED&domain-owner=411628588745 HTTP/1.1
2:17
$ gradle build --debug | grep "/v1/authorization-token"
2021-09-17T13:12:34.989+0200 [DEBUG] [software.amazon.awssdk.request] Sending Request: DefaultSdkHttpFullRequest(httpMethod=POST, protocol=https, host=codeartifact.eu-central-1.amazonaws.com, encodedPath=/v1/authorization-token, headers=[amz-sdk-invocation-id, User-Agent], queryParameters=[domain, domain-owner])
2021-09-17T13:12:35.107+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request POST /v1/authorization-token?domain=SCRUBBED&domain-owner=411628588745 HTTP/1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions