jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
116 stars 189 forks source link

Fix accessing credentials when authorize project is enabled #922

Open kneirinck opened 9 months ago

kneirinck commented 9 months ago

When using the authorize-project plugin and restricting a job to run as a specific user, rtUpload fails to retrieve the stored credentials. This happens for both a globally defined server as well as a locally defined server with rtServer.

After quite a bit of digging I found out that it's related to not using the Run context to access/find credentials. This PR changes the credential retrieval in as many places as possible to use a Run context if available and applicable.

It's inspired by https://github.com/jenkinsci/docker-commons-plugin/pull/68#pullrequestreview-220710089 This fixes #247


github-actions[bot] commented 9 months ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

kneirinck commented 9 months ago

I have read the CLA Document and I hereby sign the CLA

kneirinck commented 9 months ago

@yahavi could you re-add the safe to test label? Seems it got removed because of my (force) push