How regullar/ezapi works
EzAPI is a protected-traffic gateway and Go client SDK. The client packages a command into a canonical-CBOR envelope, encrypts and signs it, then sends it over TLS to one gateway endpoint; the gateway authenticates, decrypts, applies policy and user operations, and returns an encrypted response. The graph preserves the documented BOLA/property checks and monitoring capabilities. Evidence is limited to the README and indexed excerpts; unsampled modules are represented only where documented, with uncertain links omitted.
Main entry points: server.go HTTP gateway · client.go Client SDK · pipeline.go Validation and authorization · hpke.go Encrypted response
Components 16
Client SDK
- Client SDK
pkg/gateway/client.go - HPKE and signing
pkg/crypto/hpke.go - TLS certificates
pkg/crypto/certs.go
Wire Protocol
- Envelope and AAD
pkg/protocol/envelope.go - Payload schemas
pkg/protocol/messages.go - Canonical CBOR
pkg/protocol/cbor.go - Encrypted response
pkg/crypto/hpke.go
Gateway Runtime
- HTTP gateway
pkg/gateway/server.go - Request metrics
pkg/metrics/metrics.go
Security Policy
- Device registry
pkg/security/auth.go - Rate limiting
pkg/security/ratelimit.go - Validation and authorization
pkg/security/pipeline.go - Replay cache
pkg/security/replay.go
User Data
- User store
pkg/storage/memory.go - Ping and user operations
pkg/security/pipeline.go
Other components
- API caller
Connections 21
- API caller → Client SDK: calls
pkg/gateway/client.go - Client SDK → Payload schemas: encodes request
pkg/gateway/client.go - Client SDK → Envelope and AAD: forms envelope
pkg/gateway/client.go - Client SDK → HPKE and signing: encrypts and signs
pkg/gateway/client.go - Client SDK → HTTP gateway: sends HTTPS request
pkg/gateway/client.go - HTTP gateway → Rate limiting: checks limit
pkg/gateway/server.go - HTTP gateway → Envelope and AAD: decodes envelope
pkg/gateway/server.go - HTTP gateway → Device registry: looks up device
pkg/gateway/server.go - HTTP gateway → HPKE and signing: verifies and decrypts
pkg/gateway/server.go - HTTP gateway → Validation and authorization: executes request
pkg/gateway/server.go - Validation and authorization → Payload schemas: decodes payload
pkg/security/pipeline.go - Validation and authorization → Replay cache: checks request ID
pkg/security/pipeline.go - Validation and authorization → Ping and user operations: dispatches operation
pkg/security/pipeline.go - Ping and user operations → User store: reads or updates
pkg/security/pipeline.go - HTTP gateway → Request metrics: records outcomes
pkg/gateway/server.go - HTTP gateway → Encrypted response: encrypts response
pkg/gateway/server.go - Encrypted response → Envelope and AAD: wraps ciphertext
- HTTP gateway → Client SDK: returns CBOR response
pkg/gateway/client.go - Client SDK → Encrypted response: decrypts response
pkg/gateway/client.go - TLS certificates → HTTP gateway: configures TLS
- API caller → Ping and user operations: requests ping or user access
README.md