Security
Authentication
All rule management endpoints require a Payability session token and an instance the caller is authorised
for. Tracking endpoints are public by design. In front of the app, API Gateway runs the shared
PayabilityAPIGatewayAuthorizer, which currently allows every request. The per-endpoint matrix is in REST
API.
Cross-origin requests
Browsers may call the API only from https://payability.com and its subdomains (for example
crm.payability.com or staging.dev.payability.com). The rule is CORS_ALLOWED_ORIGINS in src/settings.py
and applies to every route, including the @cross_origin views. A matching origin is echoed back in
Access-Control-Allow-Origin (with Vary: Origin); /track and /tracking also allow credentials, for the
pybUserID cookie. Any other origin, plain http, or a look-alike host such as payability.com.example.com
gets no CORS headers, so the browser blocks the response.
CORS only restricts browsers. Internal services calling server to server send no Origin header and are not
affected; what protects the API from them is the authentication above.
IAM
Each function has its own role. Resources are named exactly, with the environment’s table suffix:
| Function | Allowed |
|---|---|
|
CRUD on |
|
CRUD on |
All functions can also write CloudWatch Logs and X-Ray traces.