[audit] Security, API safety, missing tests, error handling #1

Open
opened 2026-03-22 16:41:28 +00:00 by Virgil · 2 comments
Member

Full audit:

  1. Security: API key exposure, OAuth token handling, webhook validation, input sanitisation
  2. Rate limiting: proper backoff, quota tracking, retry logic
  3. Missing tests: provider actions without Pest coverage
  4. Error handling: swallowed API errors, missing HTTP status checks, timeout handling
  5. UK English: American spellings in code/comments
  6. Coding standards: strict_types, type hints, Action pattern, SPDX headers

Report all findings with severity and file:line. Do NOT fix.

Full audit: 1. Security: API key exposure, OAuth token handling, webhook validation, input sanitisation 2. Rate limiting: proper backoff, quota tracking, retry logic 3. Missing tests: provider actions without Pest coverage 4. Error handling: swallowed API errors, missing HTTP status checks, timeout handling 5. UK English: American spellings in code/comments 6. Coding standards: strict_types, type hints, Action pattern, SPDX headers Report all findings with severity and file:line. Do NOT fix.
Author
Member

Codex Audit Findings

CRITICAL (1)

  1. TikTok upload not to spec — does one multipart PUT but TikTok requires raw binary with Content-Range and sequential chunks (Post.php:69)

HIGH (2)

  1. Single-photo Meta posts never published — upload forced unpublished, publish() returns success without creating feed post (Media.php:57, Post.php:61)
  2. Meta Facebook page token handoff broken — list API returns access_token but post publishing reads different key (Pages.php:46, Post.php:34)
## Codex Audit Findings ### CRITICAL (1) 1. TikTok upload not to spec — does one multipart PUT but TikTok requires raw binary with Content-Range and sequential chunks (Post.php:69) ### HIGH (2) 2. Single-photo Meta posts never published — upload forced unpublished, publish() returns success without creating feed post (Media.php:57, Post.php:61) 3. Meta Facebook page token handoff broken — list API returns access_token but post publishing reads different key (Pages.php:46, Post.php:34)
Author
Member

API Contract Extraction

Full provider API contracts extracted for all providers. Example — YouTube:

Class Methods
Auth construct, identifier, name, getAuthUrl, requestAccessToken, refresh, getAccount
Post publish (title, tags, category_id, privacy_status, made_for_kids, publish_at), externalPostUrl, externalAccountUrl
Read get, me, list (limit, page_token)
Delete delete
Comment comment

Config: clientId, clientSecret, redirectUrl. OAuth 2.0 auth code with offline access.

Full tables for Twitter, Meta, LinkedIn, Pinterest, Reddit, TikTok, VK, YouTube in agent log.

## API Contract Extraction Full provider API contracts extracted for all providers. Example — YouTube: | Class | Methods | |---|---| | Auth | construct, identifier, name, getAuthUrl, requestAccessToken, refresh, getAccount | | Post | publish (title, tags, category_id, privacy_status, made_for_kids, publish_at), externalPostUrl, externalAccountUrl | | Read | get, me, list (limit, page_token) | | Delete | delete | | Comment | comment | Config: clientId, clientSecret, redirectUrl. OAuth 2.0 auth code with offline access. Full tables for Twitter, Meta, LinkedIn, Pinterest, Reddit, TikTok, VK, YouTube in agent log.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

-

Dependencies

No dependencies set.

Reference: core/php-plug-social#1
No description provided.