Skip to content

Repository files navigation

Tasktify

Go microservice task API with post-quantum FN-DSA JWT signing. HTTP/Fiber gateway, gRPC between services, PostgreSQL storage.

FN-DSA Profiles

ProfilealgPortNote
FN-DSA-Precomputed-512FN-DSA-5125001Precomputed LDL tree signer
FN-DSA-512FN-DSA-5125002Original signer

Both profiles emit FN-DSA-512 tokens. Precomputation is internal state, not a JOSE algorithm.

Architecture

flowchart LR
subgraph Clients
Client["Client"]
K6["k6 Benchmark"]
end
Caddy["Caddy\nReverse Proxy"]
subgraph Gateway
GW["Gateway\n:3000\nHTTP/Fiber\nJWT Verify"]
GWPre["Gateway (Precomputed)\n:5001"]
GWOrig["Gateway (Original)\n:5002"]
end
subgraph Services
Auth["Auth Service\n:3001\ngRPC\nRegister / Sign-In\nJWT Signing"]
Todo["Todo Service\n:3002\ngRPC\nTask CRUD"]
end
DB[("PostgreSQL\n18-alpine")]
subgraph Shared
Pkg["backend/pkg\nJWT / FN-DSA\nKey Loaders"]
end
Client --> Caddy
K6 -->|isolated instances| GWPre
K6 -->|isolated instances| GWOrig
Caddy --> GW
GW --> Auth
GW --> Todo
GWPre --> Auth
GWOrig --> Todo
Auth --> DB
Todo --> DB
Auth -.-> Pkg
Todo -.-> Pkg
GW -.-> Pkg
Loading

Benchmark: k6 hits isolated gateway instances on :5001 and :5002.

Components

ComponentPathRole
Gatewaybackend/gateway/HTTP API, JWT verification, benchmark endpoints
Auth servicebackend/auth-service/Registration, sign-in, JWT signing
Todo servicebackend/todo-service/Task CRUD
Shared pkgbackend/pkg/JWT, FN-DSA signing, key loaders
Key generatorbackend/cmd/keygen/Key generation CLI
k6 scriptsbackend/k6/Benchmark scenarios

API Routes

Base: http://localhost:3000

Public

MethodPathResult
GET/"API OK"
GET/health{"status":"ok"}
POST/api/auth/registerCreate user (name, email, password)
POST/api/auth/signinAccess + refresh tokens (email, password)
POST/api/auth/refreshNew token pair (refresh_token)
POST/api/benchmark/pure-signingIsolated signing stats
POST/api/benchmark/jwt-issuanceJWT issuance stats
POST/api/benchmark/signAlias for JWT issuance
POST/api/benchmark/tokenOne benchmark token

Protected

Require Authorization: Bearer <access_token>.

MethodPathResult
GET/api/profileCurrent user
POST/api/tasks/Create task
GET/api/tasks/List tasks
GET/api/tasks/:idGet task
PUT/api/tasks/:idUpdate task
DELETE/api/tasks/:idDelete task

Requirements

  • Go 1.25.7
  • Docker Compose
  • PostgreSQL 18-alpine (in Compose)
  • k6 0.50+
  • protoc, protoc-gen-go, protoc-gen-go-grpc for proto regeneration

Configuration

VariableServiceDescription
APP_MODEalldev reads .env; production reads process env
APP_PORTgatewayHTTP port
GRPC_PORTauth/todogRPC port
AUTH_SERVICE_ADDRgatewayAuth gRPC address
TODO_SERVICE_ADDRgatewayTodo gRPC address
DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_PORT, DB_SSL_MODEauth/todoPostgreSQL
JWT_DEFAULT_ALGgateway/authDefault signing profile
JWT_ALLOWED_ALGSgateway/authProfile allowlist
JWT_ISSUERgateway/authExpected issuer
JWT_TOKEN_DURATIONgateway/authToken lifetime (minutes)
KEYS_DIRgateway/authPEM key directory

Quick Start

Production-like stack:

cd backend
cp .env.example .env
make keygen
make vendor
make up-build
curl http://localhost/health

Local dev:

cd backend
make dev

Benchmark

cd backend
make bench-sign # run benchmarks
make bench-down # stop

Remote target:

make client-k6 BASE_URL=https://example.com

Useful flags: ISOLATED_ONLY=true, STRESS_ONLY=true, ATTACK_ONLY=true, ITERATIONS=100.

Results go to backend/benchmark-results/.

Key Commands

Run from backend/.

TargetAction
make keygenGenerate production keys
make keygen-allGenerate benchmark keys
make compile-protoRegenerate protobuf
make up-buildBuild + start Compose stack
make downStop stack
make cleanStop + remove volumes
make bench-signRun benchmark workflow
make fndsa-checkRun FN-DSA validation

Tests

cd backend
make falcon-kat # FN-DSA known-answer tests
make fndsa-check # Full FN-DSA validation

Statistical analysis:

python3 scripts/benchmark_stat_tests.py

Docs

FileTopic
docs/grpc-implementation.mdgRPC contracts, metadata, keep-alive
docs/skenario-pengujian.mdk6 scenarios, metrics, thresholds
docs/pengujian-kat-dan-adversarial-fndsa.mdFN-DSA KAT and adversarial tests
docs/hasil-benchmark-agregat-20-run.mdAggregate benchmark results

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages