From server-side-swift
Plan, implement, test, and diagnose server-side Swift authentication and authorization for Vapor and Hummingbird services, including Basic and Bearer auth, JWT, sessions, OAuth or OIDC handoffs, password hashing, token lifecycle, middleware placement, request context, route protection, authorization policy, security-sensitive tests, and deployment secret handoffs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/server-side-swift:auth-authorization-workflowThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Add, modify, test, or diagnose server-side Swift authentication and authorization without confusing identity verification, permission checks, client-side credential storage, or transport security.
Add, modify, test, or diagnose server-side Swift authentication and authorization without confusing identity verification, permission checks, client-side credential storage, or transport security.
The practical decision is who the request represents, how that identity was verified, what the identity is allowed to do, where that policy is enforced, how credentials and secrets are stored, and which tests prove the boundary is secure.
401 Unauthorized, 403 Forbidden, token validation, session, cookie, password, middleware ordering, role, scope, tenant, or permission behavior.req.auth, a Hummingbird request context, a route-local value, or a domain service.Use repo-local Swift files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Swift package DocC, and then official docs or source when Dash/local coverage is missing or stale. Check one of those source-specific paths before claiming auth behavior:
Use persistence, OpenAPI, observability, Docker, Fly.io, or deployment docs when auth depends on schema, API contracts, log redaction, secrets, TLS, cookies, or environment configuration.
Package.swiftFor Vapor:
req.auth as authenticated identity state, not as a generic dependency containerFor Hummingbird:
req.auth patterns into Hummingbird codehb-generated Lambda + API Gateway V2 projects, do not treat an openly reachable endpoint as protected just because it is deployed behind Lambda; use app or device evidence, API Gateway authorizers, signed tokens, or another explicit auth boundary before accepting sensitive requestsFor any framework:
Authorization answers whether an authenticated or anonymous actor may perform a specific action.
Model authorization in terms of concrete resources and operations:
Prefer explicit policy helpers or domain methods over repeated inline conditionals in route handlers. Return 401 when authentication is required and missing or invalid; return 403 when identity is known but not allowed.
Test cross-tenant and wrong-owner access whenever a service stores user-owned or organization-owned data.
Never store plaintext passwords. Use the framework's documented password hashing guidance or an existing repository-approved hashing package.
For tokens:
For JWT:
For sessions and cookies:
Use OAuth/OIDC when a provider owns user login or federated identity.
Before implementing:
Do not build a custom OAuth/OIDC flow from memory. Use provider docs, framework packages, and security review when external identity is in scope.
Choose tests that prove the boundary:
Avoid test shortcuts that bypass the exact middleware or policy under review unless the test is intentionally unit-level and another test covers integration.
Logs and traces may name the auth mechanism, route, actor type, and safe stable IDs. Do not log passwords, raw tokens, authorization headers, cookies, private keys, full JWTs, OAuth codes, refresh tokens, or session contents.
Use observability-tracing-workflow when auth diagnostics need correlation IDs, redaction, metrics, or traces.
Use fly-io-deployment-workflow, docker-workflow, or the repository's deployment workflow when auth secrets, key files, cookie settings, or provider config must reach production.
Use vapor-server-workflow for Vapor route grouping, middleware registration, controllers, commands, and framework config.
Use hummingbird-server-workflow for Hummingbird router, middleware, request context, and framework testing behavior.
Use persistence-workflow for user, token, role, permission, session, or audit-log schema and query design.
Use openapi-rpc-workflow when API contracts need auth schemes, security requirements, generated client behavior, or RPC metadata.
Use Apple-platform guidance for Keychain, Sign in with Apple client UI, local credential storage, or app-side token handling.
Return:
Auth shape: framework, credential types, identity model, middleware, route groups, policies, tokens, sessions, password storage, and secrets.Docs used: Vapor, Hummingbird, JWT, password, session, OAuth/OIDC, persistence, observability, or deployment docs consulted.Behavior: authentication flow, authorization checks, token/session lifecycle, errors, status codes, and redaction.Command path: exact build, test, migrate, run, secret, or HTTP commands run or recommended.Validation: tests, migration checks, manual HTTP checks, or deployment-secret verification.Handoffs: framework, persistence, OpenAPI/RPC, observability, Apple-platform, Docker, Fly.io, or security review follow-up when the task crosses this skill's boundary.npx claudepluginhub gaelic-ghost/socket --plugin server-side-swiftCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.