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

v2: return ETag with ACL and raw ACL responses #120

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

oxtoacart
Copy link
Contributor

This allows clients to know which ETag to provide when updating an ACL.

Updates #119

v2/policyfile.go Outdated
if err != nil {
return nil, err
}
acl.ETag = header.Get("ETag")
Copy link
Member

Choose a reason for hiding this comment

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

If you spell it the Go canonical way (Etag) here you avoid an alloc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL, thanks!

v2/policyfile.go Outdated
return string(resp), nil
return &RawACL{
HuJSON: string(resp),
ETag: header.Get("ETag"),
Copy link
Member

Choose a reason for hiding this comment

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

Etag

@bradfitz
Copy link
Member

(both are just FYIs, not blockers)

This allows clients to know which ETag to provide when updating an ACL.

Updates #119

Signed-off-by: Percy Wegmann <[email protected]>
@oxtoacart oxtoacart merged commit bd4d815 into main Oct 28, 2024
3 checks passed
@oxtoacart oxtoacart deleted the percy/issue119 branch October 28, 2024 21:01
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.

3 participants