trypost/tests/Unit
Paulo Castellano 4d8353d758
MCP: workspace settings, viewer read access, and token access (#241)
* Add workspace MCP settings and token access controls.

Ship MCP settings UI, OAuth revoke/list helpers, Passport deploy wiring,
and workspace.token:mcp gating so assistants can connect without pulling
in welcome/onboarding from the parent epic.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Type MCP client config shapes instead of string checks.

Encode http/config-root on each advanced client and tighten primary
client ids so snippet generation does not branch on magic strings.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Polish MCP settings follow-ups from review.

Translate Ukrainian MCP copy, deep-link ChatGPT into connector
creation, drop an unused asset and revoke arg, and assert PATs are
rejected on the MCP endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden MCP connected clients, revoke scope, and OAuth consent.

List recoverable sessions with live refresh tokens, revoke only PATs,
throttle registration alone, and block viewers from authorizing MCP.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Simplify MCP OAuth route throttling to a single middleware group.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Allow workspace viewers read-only MCP access with web policy writes.

Mirror the web app: MCP connects on view + OAuth mcp:use, write tools
enforce createPost/update/delete/manageAccounts/manageTeam, and demotion
to Viewer keeps grants. Cover role denials, consent, and disconnect.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden MCP tool authz with shared workspace helpers.

Route ApiKey tools through AuthorizesMcpTool, fail closed on null user
or policy argument, and resolve the current workspace before mutating.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop redundant string casts on validated request data.

Enum::from and validated() fields are already strings, so the casts
add noise without changing behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Show only the current user's MCP connections in settings.

Match API keys privacy: list and disconnect your own OAuth clients,
not teammates' across the account.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Cover LoadWorkspaceFromToken gaps and harden AuthorizesMcpTool tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop redundant is_string guard before UpdatePostTool find.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Refactor AppSidebar to always show MCP link and simplify route middleware definition in ai.php. The MCP link is now consistently displayed regardless of the current workspace state, and the route middleware syntax has been streamlined.

* Refresh MCP connected clients with Inertia usePoll.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Bump laravel/mcp to 0.9.1 and add the TryPost server icon.

Requires laravel/boost 2.5 for the Icon attribute; expose images/trypost/icon.png on TryPostServer.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop no-op ReflectionClass import in TryPostServerTest.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 09:54:51 -03:00
..
Actions Allow account owners to delete workspaces (#208) 2026-08-01 13:00:38 -04:00
Ai/Agents Add Ukrainian as a supported platform language (#219) 2026-08-05 19:45:30 -03:00
Automation test(automations): extract inline feed XML into shared fixtures 2026-06-16 11:06:46 -03:00
Broadcasting feat: workspace-scoped broadcast channel and post lifecycle events 2026-05-07 16:02:22 -03:00
DataTransferObjects test(tiktok): cover MediaItem dimensions and platform max-width helpers 2026-06-26 12:31:46 -03:00
Enums Add Ukrainian as a supported platform language (#219) 2026-08-05 19:45:30 -03:00
Events refactor: prefer string interpolation over concatenation for channel names 2026-05-08 19:22:01 -03:00
Exceptions/Social fix(x): harden chunked media upload handling and coverage 2026-07-24 10:30:34 -03:00
Mail feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
Models MCP: workspace settings, viewer read access, and token access (#241) 2026-08-06 09:54:51 -03:00
Policies Allow account owners to delete workspaces (#208) 2026-08-01 13:00:38 -04:00
PostTemplates refactor: reorganize settings UI, migrate post templates to a file-based registry, and remove legacy video generation features 2026-05-03 13:44:13 -03:00
Rules refactor(linkedin): infer post format from media + unify account connection 2026-06-24 21:05:09 -03:00
Services Add Ukrainian as a supported platform language (#219) 2026-08-05 19:45:30 -03:00
Settings Add Ukrainian as a supported platform language (#219) 2026-08-05 19:45:30 -03:00
Socialite refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
Support fix: keep post drafts unscheduled by default (#209) 2026-08-01 17:39:18 -03:00
Traits Allow account owners to delete workspaces (#208) 2026-08-01 13:00:38 -04:00
AuthorizesMcpToolTest.php MCP: workspace settings, viewer read access, and token access (#241) 2026-08-06 09:54:51 -03:00
ExampleTest.php refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
HelpersTest.php fix(security): make SSRF private-network block configurable and guard the last user-URL fetches 2026-07-17 15:40:15 -03:00
MediaItemAltTextTest.php Extract alt-text truncation onto MediaItem and close test gaps 2026-07-11 10:34:57 -03:00
MediaPolymorphTest.php fix: persist morph map alias on AI-generated Media rows 2026-05-04 14:14:14 -03:00
MorphMapTest.php Register all models in the morph map + lock it with a test 2026-06-14 16:12:49 -03:00
PlatformAltTextTest.php Harden per-image alt text across publishers, validation, and attach paths 2026-07-16 13:55:33 -03:00
PostHogServiceTest.php chore: remove legacy plan tiers (starter/plus/pro/max) 2026-06-22 15:31:32 -03:00
PostPlatformMetaRulesTest.php Add optional Pinterest pin title and destination link (#232) 2026-08-05 18:15:50 -03:00
PostPlatformTest.php fix(facebook): empty-message rejection + state consistency + no re-publish on terminal 2026-05-19 12:47:18 -03:00
TryPostServerTest.php MCP: workspace settings, viewer read access, and token access (#241) 2026-08-06 09:54:51 -03:00