-
Notifications
You must be signed in to change notification settings - Fork 1
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
Handle non-compliant referrers endpoint response with custom transport #170
Conversation
Signed-off-by: Meredith Lancaster <[email protected]>
@@ -18,6 +19,17 @@ import ( | |||
"github.com/sigstore/sigstore-go/pkg/verify" | |||
) | |||
|
|||
type noncompliantRegistryTransport struct{} | |||
|
|||
func (a *noncompliantRegistryTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to explain why this is needed. Also would be good to include a link to a go-containerregistry issue if we are reporting this as a bug there (since this hack can be removed if go-containerregistry can handle the this unexpected header).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an issue filed yet but can add a link once I file one.
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Part of https://github.com/github/package-security/issues/1731
Use a custom transport to handle non-compliant 406 responses from APIs when attempting to reach the refferes. endpoint. If an API does not support the referrers API, we generally expect a 404 response, but we have seen a 406 response as well and want to handle that case.