security: # Password hashers password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' # Providers providers: app_user_provider: entity: class: App\Entity\User property: id firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false openai_compat: pattern: ^/v1 stateless: true provider: app_user_provider user_checker: App\Security\AccountStatusChecker entry_point: App\Security\ApiAuthenticationEntryPoint custom_authenticators: - App\Security\OidcBearerAuthenticator - App\Security\ApiKeyAuthenticator # Model Context Protocol (MCP) Streamable HTTP endpoint. # API key (sk_*) or OIDC bearer when the request presents one. # initialize and tools/list are public; McpController rejects every # other method without a user (401 + WWW-Authenticate → RFC 9728). mcp: pattern: ^/mcp stateless: true provider: app_user_provider user_checker: App\Security\AccountStatusChecker entry_point: App\Security\McpAuthenticationEntryPoint custom_authenticators: - App\Security\OidcBearerAuthenticator - App\Security\ApiKeyAuthenticator api: pattern: ^/api stateless: true provider: app_user_provider # Returns a clean JSON 401 instead of letting the security # ExceptionListener escalate anonymous requests into uncaught # HttpExceptions (which otherwise spam the request channel with # ERROR-level stack traces for every unauthenticated call). user_checker: App\Security\AccountStatusChecker entry_point: App\Security\ApiAuthenticationEntryPoint custom_authenticators: - App\Security\CookieTokenAuthenticator - App\Security\OidcBearerAuthenticator - App\Security\QueryTokenAuthenticator - App\Security\ApiKeyAuthenticator main: lazy: true provider: app_user_provider user_checker: App\Security\AccountStatusChecker access_control: # Voice sidecar callbacks. The controller checks an HMAC; the sidecar # has no user cookie. Do not put these under the public API document. - { path: ^/internal/voice, roles: PUBLIC_ACCESS } # Synaplan Demo key issuance. Only the private synafreeapi_server plugin # defines this route (404 everywhere else); it applies proof of work # and per-IP limits. SetupLockdownSubscriber still guards /v1 while # first-run setup is unfinished. - { path: ^/v1/free/keys$, methods: [POST], roles: PUBLIC_ACCESS } # OpenAI-compatible endpoints. API keys, plus an OIDC bearer token # on POST /v1/chat/completions and GET /v1/models only. - { path: ^/v1, roles: IS_AUTHENTICATED_FULLY } # MCP: RFC 9728 metadata, and the endpoint itself. The controller # allows initialize + tools/list without a user and rejects the rest. # Anchored so a future route under /mcp/ does not become public too. - { path: ^/\.well-known/oauth-protected-resource, roles: PUBLIC_ACCESS } - { path: ^/\.well-known/synaplan-federation, roles: PUBLIC_ACCESS } - { path: ^/mcp$, roles: PUBLIC_ACCESS } - { path: ^/mcp, roles: IS_AUTHENTICATED_FULLY } # Public API documentation (Swagger) - { path: ^/api/doc, roles: PUBLIC_ACCESS } # Public runtime configuration (reCAPTCHA site key, etc.) - { path: ^/api/v1/config/runtime, roles: PUBLIC_ACCESS } - { path: ^/api/v1/config/memory-service/check, roles: PUBLIC_ACCESS } # Public capability discovery (supported file formats, languages, summary options) - { path: ^/api/v1/config/capabilities, roles: PUBLIC_ACCESS } # Public marketing news for the anonymous guest landing (feed + image proxy) - { path: ^/api/v1/news/, roles: PUBLIC_ACCESS } # Public auth endpoints - { path: ^/api/v1/auth/login, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/register, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/verify-email, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/forgot-password, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/reset-password, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/resend-verification, roles: PUBLIC_ACCESS } # Pay first: a person without an account starts Stripe Checkout - { path: ^/api/v1/checkout/start$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/checkout/claim$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/email-link(/consume)?$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/code-signup(/consume)?$, methods: [POST], roles: PUBLIC_ACCESS } # Refresh is public on purpose: the 5-minute access cookie is often # expired (or unsigned after an APP_SECRET rotation) when this is # called. CookieTokenAuthenticator must not claim this path, or the # DB-backed 30-day refresh token in BTOKENS is never consulted. - { path: ^/api/v1/auth/refresh, roles: PUBLIC_ACCESS } # Native (mobile) OAuth handoff exchange — auth IS the signed handoff token - { path: ^/api/v1/auth/native/exchange, roles: PUBLIC_ACCESS } # Authenticated auth endpoints - { path: ^/api/v1/auth/me, roles: IS_AUTHENTICATED_FULLY } - { path: ^/api/v1/auth/logout, roles: IS_AUTHENTICATED_FULLY } - { path: ^/api/v1/auth/revoke-all, roles: IS_AUTHENTICATED_FULLY } # Health monitoring (API-Key protected probe) - { path: ^/api/health/probe, roles: IS_AUTHENTICATED_FULLY } # Public health + test endpoints - { path: ^/api/health, roles: PUBLIC_ACCESS } - { path: ^/api/test, roles: PUBLIC_ACCESS } # Public OIDC endpoints - { path: ^/api/v1/oidc/discovery, roles: PUBLIC_ACCESS } # Public Social Login endpoints (Google, GitHub & Keycloak OAuth) - { path: ^/api/v1/auth/providers, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/google/login, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/google/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/github/login, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/github/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/keycloak/login, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/keycloak/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/apple/login, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/apple/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/auth/apple/native, roles: PUBLIC_ACCESS } # Outbound connector consent: the provider redirects the browser here # cross-site, where the SameSite=Strict auth cookie is not sent. The # HMAC-signed OAuth state identifies the user instead; /start (which # mints that state) stays authenticated. - { path: ^/api/v1/connections/m365/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/connections/dropbox/callback, roles: PUBLIC_ACCESS } - { path: ^/api/v1/mcp-servers/oauth/callback, roles: PUBLIC_ACCESS } # Desktop pairing exchange: a fresh Synaplan Desktop client has no # session yet, so it swaps a (rate-limited, one-time, TTL'd) pairing # code for its scoped key here. Anchored exactly so it never exposes the # other /api/v1/desktop/* routes, which stay behind the catch-all below. # When DESKTOP_AGENT.ENABLED is off the controller still 404s (C8). - { path: ^/api/v1/desktop/pair$, roles: PUBLIC_ACCESS } # Partner-instance handshake: anonymous register (pending), public # confirm-card lookup, instance self-check, and code exchange. All # 404 when PLATFORM_LINKS.ENABLED is off. Session routes stay auth'd. - { path: ^/api/v1/platform-links/instances$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/instances/self$, roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/deliveries/, roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/pickups/, roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/read-scope$, roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/sources/events$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/watches$, methods: [GET], roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/lifecycle$, methods: [POST], roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/instances/[^/]+/public$, roles: PUBLIC_ACCESS } - { path: ^/api/v1/platform-links/exchange$, methods: [POST], roles: PUBLIC_ACCESS } # Partner handshake. The invite preview and the signed connect call # prove themselves (unguessable token, Ed25519 signature). Admin routes # stay behind the catch-all below. - { path: ^/api/v1/federation/invites/, roles: PUBLIC_ACCESS } - { path: ^/api/v1/federation/connect$, methods: [POST], roles: PUBLIC_ACCESS } # Public shared chat endpoint (no auth required) - { path: ^/api/v1/chats/shared/, roles: PUBLIC_ACCESS } # Public file uploads endpoint (controller handles auth internally) - { path: ^/api/v1/files/uploads/, roles: PUBLIC_ACCESS } # File download for /