Advanced Search
Search Results
39 total results found
Authentication
This chapter explains the authentication endpoints provided by SWAIN for login, signup, token management, and email verification.
Auth Endpoints
/auth/signup – Register a new user with an email and password. Returns a new user record and a JWT for authentication. /auth/login – Authenticate an existing user using email and password, returning a JWT token for subsequent requests. /auth/refresh – Use ...
Additional
This chapter covers additional tools and resources for SWAIN, including the command-line interface and testing strategies.
Swain CLI
Quick Start Install once, generate everywhere. Install: pipx install swain_cli (Python 3.8+ or via virtual environment). Authenticate: Run swain_cli auth login to sign in with your Swain username and password (the interactive wizard uses this credenti...
Testing
Use an API client like Postman to manually test each generated endpoint and verify it returns the expected responses. Write automated integration tests to cover your core use cases, including CRUD operations and edge cases. Validate authentication flows by...
Troubleshooting
If database connections fail, verify the host, port, database name and credentials, and ensure your firewall allows access from the platform. If your schema has changed but endpoints don’t reflect updates, re-run the Sync Schema step to refresh the schema. ...
Security
This chapter outlines best practices for securing your SWAIN backend, including recommendations for JWT secret management, token lifetimes, password hashing, protecting routes, restricting database access, securing SMTP credentials, and maintaining audit trail...
Security Best Practices
JWT Security – Use a strong JWT secret (32+ random bytes) and rotate it carefully. Token Management – Keep access tokens short‑lived (e.g., 15–60 minutes) and use refresh tokens for longer-lived sessions. Password Security – Store passwords hashed with mod...
Glossary
This chapter provides definitions for common terms and concepts used in SWAIN, such as row-level security (RLS), tenants/accounts, JWTs, and other key terminology to help users understand the platform.
Glossary
RLS (Row-Level Security) – Restricts records returned or modified to those owned by the authenticated user’s tenant. Tenant/Account – The organization or unit that owns data; users belong to a tenant or account. JWT (JSON Web Token) – A compact, URL‑safe t...