How to pass global options to wget and curl in Yocto

Viewed 530

i have kept all my downloads in our artifactory repository. Updated SRC_MIRROR_URL to point to Artifactory repository.

The problem is authentication. I need to some how pass my authentication token to all the wget/curl which are happening. Is there any way to achieve this through some configuration option in Yocto

2 Answers

Add host config to your ~/.ssh/config

Host server1
     HostName stackoverflow.com
     User jamal
     Port 1234
     IdentityFile /home/jamal/.ssh/id_rsa

From what I understood is that you need to pass on the credentials to the Artifactory using the curl/wget, you can pass on the credentials easily by passing it in the URL as below,

https://<username>:<api-key>@artifactory.myorg.com:443/artifactory/local-pypi-mywork-01/mypackage-0.1-py3-none-any.whl

However, it is more recommended to use access tokens. Access tokens are expirable and more limited in general. You can create easily access tokens with the JFrog CLI:

jfrog rt access-token-create froggy-user

And then pass this access token in the URL as below,

https://froggy-user:<token>@artifactory.myorg.com:443/artifactory/local-pypi-mywork-01/mypackage-0.1-py3-none-any.whl
Related