Skip to content
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

support for headers param in attest functions #1790

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Conversation

bdehamer
Copy link
Contributor

Updates the attest and attestProvenance functions to accept a new, optional headers parameter.

If supplied, any headers will be passed-along to the GH attestations API in addition to the required auth header.

@bdehamer bdehamer requested a review from a team as a code owner August 14, 2024 18:14
@bdehamer bdehamer force-pushed the bdehamer/attest-headers branch from 918b285 to d063821 Compare August 14, 2024 18:21
@@ -28,6 +28,8 @@ export type AttestOptions = {
// Sigstore instance to use for signing. Must be one of "public-good" or
// "github".
sigstore?: SigstoreInstance
// HTTP headers to include in request to attestations API.
headers?: {[header: string]: string | number | undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a block list to make sure the client does not set a header that may interfere with any standard headers that are sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this and everything we'd maybe want to block (user-agent, accept, content-type, authorization) is already overridden in the @octokit/request library. I think we're good to pass-along whatever and let octokit sort it out.

Verified

This commit was signed with the committer’s verified signature.
Tyriar Daniel Imms
Signed-off-by: Brian DeHamer <bdehamer@github.com>
@bdehamer bdehamer force-pushed the bdehamer/attest-headers branch from d063821 to 340a103 Compare August 15, 2024 22:35
@bdehamer bdehamer merged commit 279e891 into main Aug 16, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants