fix: correct OAuth2 URL, harden auth, thread context, tighten perms#1
Merged
fix: correct OAuth2 URL, harden auth, thread context, tighten perms#1
Conversation
…tighten permissions - Fix OAuth2 base URL from /wiki/rest/api/v2 (invalid) to /wiki/api/v2 - Validate OAuth2 callback code parameter before reporting success - Thread context.Context through FetchUserPages for cancellation support - Change template file permissions from 0644 to 0600 (consistent with codebase) - Add io.LimitReader to search response body reads (10 MiB cap)
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.
Summary
/wiki/rest/api/v2(invalid, all API calls 404) to/wiki/api/v2codeparameter before showing "Authorization successful!"context.ContextthroughFetchUserPagesfor proper cancellation/timeout support0644to0600(consistent with rest of codebase)io.LimitReader(10 MiB cap) to search response body reads to prevent memory exhaustionTest plan
go test ./...— all tests passgo vet ./...— cleango build ./...— builds successfully