Skip to content

Artifactory Identity token #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ambua opened this issue Nov 28, 2022 · 1 comment
Open

Artifactory Identity token #4

ambua opened this issue Nov 28, 2022 · 1 comment

Comments

@ambua
Copy link

ambua commented Nov 28, 2022

Hi Developers,
We need to use Artifactory Identity token instead of API Key:
https://www.jfrog.com/confluence/display/JFROG/User+Profile#UserProfile-identitytoken

Technically the request on Artifactory should change like so:
https://www.jfrog.com/confluence/display/JFROG/Access+Tokens#AccessTokens-AuthorizationHeaders

# Old: API key: 
 curl -H 'X-JFrog-Art-Api:$API_KEY' "https://some.artifactory.com/artifactory/my-repo/my_artifact.bin"
# New: Identity token:
 curl -H 'Authorization: Bearer $USER_TOKEN' "https://some.artifactory.com/artifactory/my-repo/my_artifact.bin"

I was able to monkey patch the _request method like so:
https://github.com/Orange-OpenSource/rtpy/blob/master/rtpy/tools.py#L253

        if self._user_settings["X-JFrog-Art-Api"]:
            # Use Artifactory identity token instead of API key
            #headers = {"X-JFrog-Art-Api": self._user_settings["X-JFrog-Art-Api"]}
            headers = {"Authorization": f"Bearer {self._user_settings['X-JFrog-Art-Api']}"}

This is not very nice. So would you agree to add this feature?
Or do you see another better way without code changes?
I think it is not a big thing. I can also add a pull request if you like.
Best regards,
Adrian

@guillaumerenault
Copy link
Contributor

guillaumerenault commented Dec 1, 2022

Hi Adrian, I'm no longer maintaining the project as I don't work for the company that released it, you can however open a pull request to discuss and show your suggested changes. I can reach out to some of my former colleagues who could potentially publish a new release.

If you do open the PR, please run the tests to make sure everything is still working (make sure to run the tests only on a Artifactory test instance).

Hope that helps!

Guillaume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants