From ca05dd3c1e405dc9afe3fb5b9aba56110da78431 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 20 Nov 2024 16:08:24 -0800 Subject: [PATCH 1/3] Add read/write mutex for refreshing access token --- artifactory.go | 1 - path_config_user_token.go | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/artifactory.go b/artifactory.go index bc6599b..303c39e 100644 --- a/artifactory.go +++ b/artifactory.go @@ -216,7 +216,6 @@ func (b *backend) CreateToken(config baseConfiguration, role artifactoryRole) (* return nil, createErr } - //noinspection GoUnhandledErrorResult defer resp.Body.Close() if resp.StatusCode != http.StatusOK { diff --git a/path_config_user_token.go b/path_config_user_token.go index 5e66cc1..f6432b1 100644 --- a/path_config_user_token.go +++ b/path_config_user_token.go @@ -94,6 +94,9 @@ type userTokenConfiguration struct { } func (c *userTokenConfiguration) RefreshAccessToken(ctx context.Context, req *logical.Request, username string, b *backend, adminBaseConfig baseConfiguration) error { + b.configMutex.Lock() + defer b.configMutex.Unlock() + logger := b.Logger().With("func", "RefreshAccessToken") if c.RefreshToken == "" { From f38e9cb11c29cc2456b173b68d12f160cc841e30 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 20 Nov 2024 16:09:00 -0800 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c7e40..6aa3e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.8.2 (November 21, 2024) + +BUG FIXES: + +* Fix concurrency error when refreshing user token. Issue: [#225](https://github.com/jfrog/artifactory-secrets-plugin/issues/225) PR: [#226](https://github.com/jfrog/artifactory-secrets-plugin/pull/226) + ## 1.8.1 (November 8, 2024). Tested on Artifactory 7.98.8 with Vault v1.18.1 and OpenBao v2.0.0 BUG FIXES: From cc0353da1ff82344c6e4972a9f1b59f84f136cbf Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Thu, 21 Nov 2024 00:12:29 +0000 Subject: [PATCH 3/3] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa3e4f..58d2282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.8.2 (November 21, 2024) +## 1.8.2 (November 21, 2024). Tested on Artifactory 7.98.8 with Vault v1.18.1 and OpenBao v2.0.0 BUG FIXES: