我有一个本地的Artifactory存储库,我希望将URL提供给我的用户,以便他们能够安装轮子。它们本身并不是Artifשבtory的一部分,所以我在考虑使用API。根据文档-
our API key can be used to authenticate you when using the REST API.
To use the API key, add the following header to all REST API calls: 'X-JFrog-Art-Api: <YOUR_API_KEY>'我有我的命令作为这样的pip install https://artifactory.myorg.com:443/artifactory/local-pypi-mywork-01/mypackage-0.1-py3-none-any.whl
有没有办法将API密钥作为头提供给这个URL请求?
发布于 2020-10-03 18:51:28
不完全是您所要求的,但可能提供了一个解决方案:
pip install https://<username>:<api-key>@artifactory.myorg.com:443/artifactory/local-pypi-mywork-01/mypackage-0.1-py3-none-any.whl但是,更推荐使用访问令牌。访问令牌是可过期的,通常会受到更多限制。您可以轻松创建access tokens with the JFrog CLI
jfrog rt access-token-create froggy-user然后:
pip install https://froggy-user:<token>@artifactory.myorg.com:443/artifactory/local-pypi-mywork-01/mypackage-0.1-py3-none-any.whlhttps://stackoverflow.com/questions/64177290
复制相似问题