Björn Benouarets 346100feb6 init: Initial commit
2026-01-21 06:36:38 +01:00
2026-01-21 06:36:38 +01:00
2026-01-21 06:36:38 +01:00
2026-01-21 06:36:38 +01:00
2026-01-21 06:36:38 +01:00

SecNex OAuth2 API

Configuration

Environment Variables

Variable Description Default Value
ENV Environment development
UNPROTECTED_ENDPOINTS Unprotected endpoints
DEBUG Debug mode false
FIBER_SHOW_STARTUP_MESSAGE Show startup message false
CORS_ALLOW_ORIGINS CORS allow origins *
CORS_ALLOW_HEADERS CORS allow headers Origin, Content-Type, Accept
CORS_ALLOW_METHODS CORS allow methods GET, POST, PUT, DELETE
ADDRESS Address :3000
DATABASE_HOST Database host localhost
DATABASE_PORT Database port 5432
DATABASE_USER Database user postgres
DATABASE_PASSWORD Database password postgres
DATABASE_NAME Database name secnex
REDIS_HOST Redis host localhost
REDIS_PORT Redis port 6379
REDIS_PASSWORD Redis password
JWT_SECRET JWT secret your-256-bit-secret

Development Environment Variables

Variable Description Default Value
UNPROTECTED_ENDPOINTS Unprotected endpoints /api_keys

API Endpoints

Create API Key

curl -X GET http://localhost:3000/api_keys

Login

curl -X POST http://localhost:3000/login -d '{"username": "admin", "password": "admin"}'

Register

curl -X POST http://localhost:3000/register -d '{"username": "admin", "password": "admin"}'

Session Info

curl -X POST http://localhost:3000/session/info -d '{"token": "your-token"}'

Create API Key

curl -X GET http://localhost:3000/api_keys

Note: The API key can be created only in development environment without authentication. Use the header Authorization: Bearer <api-key> to authenticate the requests in other environments.

Description
No description provided
Readme 41 KiB
Languages
Go 98.9%
Dockerfile 1.1%