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

WIP: Secure Variables: Go API #13502

Merged
merged 1 commit into from
Jul 6, 2022
Merged

WIP: Secure Variables: Go API #13502

merged 1 commit into from
Jul 6, 2022

Conversation

angrycub
Copy link
Contributor

@angrycub angrycub commented Jun 27, 2022

  • SV API: Go API
  • Fix Testutil for delve debugging API tests
  • Updates to API
  • SV: Go API: Working state

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

I see there are some TODO tests awaiting functionality to land on the RPC side? I think we can merge this into the feature branch and then follow-up with those tests later.

Comment on lines 67 to 71
// delve debug executable for debugging test
case strings.HasSuffix(path, "__debug_bin"):
return false
case strings.HasSuffix(path, "__debug_bin.exe"):
return false
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

api/api.go Outdated
Comment on lines 1131 to 1137
// closeResponseBody reads resp.Body until EOF, and then closes it. The read
// is necessary to ensure that the http.Client's underlying RoundTripper is able
// to re-use the TCP connection. See godoc on net/http.Client.Do.
func closeResponseBody(resp *http.Response) error {
_, _ = io.Copy(ioutil.Discard, resp.Body)
return resp.Body.Close()
}
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a bug fix? Should we open a new PR with just this to fix the existing usage for backport as well?

Comment on lines 76 to 97
// CheckedUpdate is used to updated a secure variable if the modify index
// matches the one on the server
func (sv *SecureVariables) CheckedUpdate(v *SecureVariable, qo *WriteOptions) (*WriteMeta, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I like the API split between checked and unchecked you've done here. It's much nicer than passing some random checked bool flag or foisting the problem off on the consumer.

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/api HTTP API and SDK issues theme/variables Variables feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants