Repository navigation
Aditya Dhayapulay - Protect backend social publishing credentials - #2440
adit24dhaya wants to merge 2 commits into
Conversation
Keep Mastodon and LinkedIn credentials in server configuration and authorize publishing with the existing announcements permission and verified identity. Prevent provider errors from exposing tokens through responses, logs or scheduled errors, and disable credential-bearing HTTP redirects. Resolve scheduled LinkedIn tokens at delivery while preserving the original organization. Add isolated credential-boundary, upload and retry tests and preserve the complete original task with the clarified backend-only scope. Refs #2065; Task 1551
Construct uploads with fixed HTTPS origins and validated paths, preserve signed queries, and reject unrelated provider destinations. Test the actual HTTP adapter against upload redirects and credential leakage. Remove unused Mastodon fields without mutating stored data and sanitize delivery-recording failures. Refs #2440; Task 1551
Construct uploads with fixed HTTPS origins and validated paths, preserve signed queries, and reject unrelated provider destinations. Test the actual HTTP adapter against upload redirects and credential leakage. Remove unused Mastodon fields without mutating stored data and sanitize delivery-recording failures. Refs #2440; Task 1551
|
Updated in f55eb63. LinkedIn uploads now use only the documented upload endpoints, and redirects are blocked so the server token cannot be forwarded to another host. I also removed the unused Mastodon variables and fixed the exception handling without exposing error details. Validation: 120 isolated tests passed, including actual Axios upload/redirect checks with intercepted HTTP. Build and lint passed; GitHub tests and lint also passed. No real social accounts or shared database data were used. Sonar has now finished: the Quality Gate passed with zero open issues. All GitHub checks pass on this commit. |
AaditTrivedi
left a comment
There was a problem hiding this comment.
Reviewed by Aadit Trivedi.
No conflicts with development, and the PR's tests pass (120/120).
One change needed: the PR commits three screenshots into the repository (docs/task-evidence/Task-1551-original-request-1.png, -2.png, -3.png, about 430 KB together). Once merged, these stay in the repo's history permanently and add to every clone. The same applies on frontend PR #5729.
Required action
Please remove the docs/task-evidence images from the branch and keep them in the PR description (they can be uploaded straight into the description instead of linked from the repo). Happy to re-review once removed, including a full read of the credential handling changes.
f55eb63 to
28cb993
Compare
|
Moved all three pictures to direct attachments in the PR description and removed them from the PR commits. I verified that the attachments render and match the originals. Application and test files are byte-for-byte unchanged from the previously tested head. Fresh backend tests and lint pass; the refreshed Sonar scan is running. The requested image cleanup is complete. Please re-review when ready. |
|



Description
Original task request
Original Phase I task, entry Create 100% secure method of hiding social media passwords · Task 1551. The complete original request and prior developer notes are captured below.
Jae's October 29 clarification, supplied by Aditya: “Definitely this: let backend publishing code use credentials without revealing them”. Jae also said he did not recognize Bitwarden or Okta and believed neither was configured. This PR implements the backend publishing scope using the existing server-side tokens; it does not add password viewing or assume a team vault/SSO deployment exists.
Provider errors could expose credential-bearing messages through publishing responses/logs and Mastodon schedule records. LinkedIn's routes also lacked Mastodon's announcements-permission gate. This change keeps those publishing paths behind the verified HGN identity and prevents raw provider errors from crossing the API/log boundary.
Related PRs
Related unfinished approach: HGNRest #2065. This is a new branch for the clarified requirement; the original contributor's branch is unchanged. It does not introduce #2065's list-all vault/password retrieval endpoints. No frontend PR is required.
Main changes explained
sendEmailsannouncements permission on both publishers' operations usingreq.userfrom verified JWT middleware, before LinkedIn multipart parsing. Submitted roles/requestors cannot grant access.docs/social-media-publishing-security.md.How to test
Validation at
f55eb637a3b48764a5included three isolated before/after credential-echo reproductions and four browser-driven mocked API walkthrough scenarios. The walkthrough UI is evidence tooling, not a shipped product page.Sonar confirms all six reported findings are cleared: Quality Gate passed, zero open issues. GitHub lint, tests and Sonar checks all pass on this commit.
Screenshots or videos of changes
The complete original-task images are embedded above. Four mocked API screenshots, an actual-code screenshot and a short compressed walkthrough video are prepared locally in Week 5; they are not represented as uploaded Dropbox media.
Notes and testing limits
www.linkedin.com/dms-uploads/andapi.linkedin.com/mediaUpload/endpoints. An unexpected endpoint fails closed and needs review; live provider uploads were not performed.Documentation cleanup: screenshots are attached directly to this description and removed from the PR commit range. Application and test files are byte-for-byte unchanged. Previously tested head
f55eb637a7corresponds to cleaned head28cb993f03; fresh backend tests and lint pass, and the refreshed Sonar scan is running.