'blob_exist()' sends a request with no header set, throws with token auth · Issue #187 · oras-project/oras-py · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduced in #171, the "HEAD" call from blob_exists() is sending a request without setting headers.
When using token auth, the change causes the authenticate_request() call to throw with 'NoneType' object does not support item assignment.
Fix should be simple; change the do_request() call in blob_exists() to send self.headers with the request: self.do_request(f"{self.prefix}://{blob_url}", "HEAD", headers=self.headers)
Bug might be a bit deeper.
On the call stack above, during a push the first call that is authenticated is the blob_exists() which after the oauth2 challenge gets a token with only pull action.
Since we already have a token cached, once the provider tries to do the put_upload() the token retrieved before is re-used and the request will fail with a 401 from lacking the sufficient scope (push). blob_exists() should be able
6D64
to request the correct scope to perform both actions or discard the authenticated token so the put_upload() can redo the challenge and get the correct scope.
Will look into it as time allows
cegraybl
added a commit
to AzureCR/azure-cli-extensions
that referenced
this issue
Apr 10, 2025
Uh oh!
There was an error while loading. Please reload this page.
Introduced in #171, the "HEAD" call from blob_exists() is sending a request without setting headers.
When using
token
auth, the change causes the authenticate_request() call to throw with'NoneType' object does not support item assignment
.Fix should be simple; change the
do_request()
call inblob_exists()
to sendself.headers
with the request:self.do_request(f"{self.prefix}://{blob_url}", "HEAD", headers=self.headers)
Under version: 0.2.28
The text was updated successfully, but these errors were encountered: