refactor: use net/http method constants and dedupe url-signing key literal - #21
Merged
Conversation
…teral
Internal consistency cleanup, no public interface change: replace raw HTTP-method
string literals ("PUT", "DELETE", "POST") and the non-idiomatic http_MethodHead
constant with the standard net/http constants already used elsewhere in the client,
and extract the three duplicated "urlSigningSecretKey" literals in the dataset/
key-value-store public-URL builders into one named constant.
…rement Verified against the live API that TaskClient.Unpublish only requires write permission to the task itself, not its Actor as the docstring (copied verbatim from the JS reference) claimed. tests/task_test.go's TestTaskPublishUnpublish already asserted the correct behavior; the docstring was the factually wrong side of the contradiction.
PR #21 bumped ClientVersion twice (0.8.0->0.8.1 for the net/http-constant and url-signing-literal refactor, then 0.8.1->0.8.2 for the Unpublish docstring fix), producing two CHANGELOG sections for what is a single PR. Collapse both changes into one 0.8.1 patch bump and merge the CHANGELOG sections accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internal consistency cleanup found while auditing the client for improvement opportunities. No public interface change.
What changed
"PUT","DELETE","POST") and the non-idiomatichttp_MethodHeadconstant with the standardnet/httpmethod constants already used elsewhere in the client"urlSigningSecretKey"literals in the dataset / key-value-store public-URL builders into one named constantTask.Unpublishdocstring (it claimed Actor write permission was required; verified against the live API that only task write permission is needed)Compatibility
ClientVersionbumped to0.8.1