Repository navigation
feat(webhook): support OAuth2 client secrets for CRC - #111
Open
mangeshraut712 wants to merge 1 commit into
Open
mangeshraut712 wants to merge 1 commit into
mangeshraut712 wants to merge 1 commit into
Conversation
Author
|
The CLA check now passes for dc69da0. Could a maintainer approve the Go workflow so the OAuth2 CRC change can receive hosted validation? |
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
Resolves #105.
Allows
xurl webhook startto answer X webhook CRC challenges using the selected app's stored OAuth 2.0 client secret (the recommended key per the X webhook documentation), while retaining full backwards compatibility with OAuth 1.0a consumer secrets for legacy integrations.An OAuth2-only app with credentials stored via
xurl auth apps add <app> --client-id ... --client-secret ...no longer needs unrelated OAuth1 consumer secrets or user authorization flows merely to start the webhook receiver and answer CRC challenges.Changes
cli/webhook.go:webhookSigningSecret()selects the signing secret for the active app, preferring the OAuth2 client secret when present and falling back to the OAuth1 consumer secret.--appthat lacks signing credentials fails with clear guidance rather than silently borrowing another app's secret.handleWebhookCRC()to cleanly handleGET /webhook?crc_token=...requests.cli/webhook_test.go:--appselection override and isolation.crc_tokenparameter (400 Bad Request).README.md:xurl auth apps add/update,--appusage, and link to X documentation.CHANGELOG.md:## Unreleased->### Added.Test Plan
go build ./...passes cleanlygo test ./...passes with all packages green (api,auth,cli,config,store)go test -v -race ./cli/...passes 15/15 tests