我在托管 conan 存储库的服务器上安装了 Artifactory 7.84.14 CPP CE 实例。当用户令牌过期(或用户未通过身份验证)时,Artifactory 返回错误代码 404,而不是 401/403。结果是,conan 返回“未找到包”而不是“请授权”。
> conan install --remote someremote --requires=somepackage/version@some/repo
> ERROR: Package 'somepackage/version@some/repo' not resolved: Unable to find 'somepackage/version@some/repo' in remotes.
在artifactory-request.log文件中有一行404代码。
anonymous|GET|/api/conan/package/path|404|-1|0|5|Conan/2.7.1 (Windows 11; Python 3.12.3; AMD64)
现在。我找到了有关hideUnauthorizedResources
配置选项的详细信息(这里和这里)。问题是,这个配置已经存在了。这是配置描述符 xml(来自 AF GUI):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://artifactory.jfrog.org/xsd/3.3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://releases.jfrog.io/artifactory/static-release-virtual/xsd/artifactory/artifactory-v3_3_5.xsd">
...
<security>
<hideUnauthorizedResources>false</hideUnauthorizedResources>
<passwordSettings>
<expirationPolicy>
...
这是artifactory.repository.config.latest.json:
{
"localRepoConfigs":
[
{
"type": "local",
"key": "somerepo",
"packageType": "conan",
"baseConfig":
{
"modelVersion": 2,
"description": "",
"notes": "",
"repoLayoutRef": "conan-default",
"includesPattern": "**/*",
"excludesPattern": ""
},
"repoTypeConfig":
{
"archiveBrowsingEnabled": false,
"blackedOut": false,
"propertySetRefs":
[],
"checksumPolicyType": "client-checksums",
"priorityResolution": false,
"maxUniqueSnapshots": 0,
"handleReleases": true,
"handleSnapshots": true,
"snapshotVersionBehavior": "unique"
},
"packageTypeConfig":
{
"forceConanAuthentication": "false"
},
"securityConfig":
{
"hideUnauthorizedResources": false,
"signedUrlTtl": 90
},
"repoType": "LOCAL"
}
]
...
}
所以,我的问题是,我错过了什么?为什么我得到的是 404 而不是 401/403?