[codex] Add X OAuth1 publisher support#4
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for OAuth 1.0a User Context credentials to the X (Twitter) publisher, updating documentation, configuration validation, and adding the signature generation logic along with corresponding tests. Feedback on these changes suggests adding defensive type checks for the credentials object to prevent potential AttributeErrors, passing digestmod as a keyword argument in hmac.new for robustness, and keeping the X publisher disabled by default in config/local.yaml to ensure local development safety.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
.env.example, and README guidance to useapi_key,api_key_secret,access_token, andaccess_token_secretinstead of app-only bearer tokens.Why
X
POST /2/tweetsrequires user-context authentication. App-only bearer tokens cannot publish tweets, and the previous implementation only sent a bearer token. OAuth 1.0a User Context matches the working credential flow from the X Developer Portal Access Token and Secret page.Validation
uv run ruff check backend/app/publishers/x/publisher.py backend/app/config/settings.py tests/test_config.py tests/test_publishers.pyuv run pytestSend verification succeeded.
Authentication result:
@skyloevilSkyloevil2868899598Successfully created 1 test X Post:
2062224863079903513The local code now works with OAuth 1.0a User Context. Store the four credentials in your local
.envor deployment environment variableX_PUBLISHER_CREDENTIALS, and do not commit them to the repository.