auth

command
v0.0.0-...-092ab73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command auth is the Lambda entrypoint for awesome-lambda-auth.

It composes four things and adds nothing of its own to the auth surface: the declarative configuration (internal/config), the DynamoDB stores (internal/store/dynamodb), the imported auth core (github.com/nik2208/awesome-go-auth and its net/http adapter) and the event normalisation layer (internal/lambdahttp).

Cold start versus request

Everything expensive happens once, in New, before lambda.Start is reached: reading and validating the configuration document, resolving secrets, building the AWS client and its connection pool, constructing the store, the auth core and the routing table. The per-invocation path attaches a request id and dispatches. See the App type for why that split is a correctness property and not only a performance one.

One read is repeated on purpose, and only one: with http.originVerify on, the front door's secret is read again every five minutes by the first request that finds it stale, so that a rotation reaches an execution environment that stays warm for hours (origin_verify.go says why the alternative, recycling every environment before the edge moves, is worse).

Failing to start

A configuration the loader refuses aborts the init with a non-zero exit, which the Lambda service reports as an init failure. That is deliberate: a refuse-to-start rule that surfaced as a 500 per request would look like an outage instead of a bad deployment, and would keep serving the routes that happened not to touch the broken knob.

Routes

The auth routes come entirely from the imported adapter — this binary must never add one, because a route that exists here and not in the other family ports is a wire divergence by construction. The only local route is GET /healthz, which answers from memory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL