SSO, RBAC, and audit logging for Go HTTP apps. Drop-in middleware with Google/Okta/Auth0/Azure OIDC or SAML, role policies, HMAC sessions, service accounts, and admin dashboard - no vendor lock-in, self-hosted.
  • HTML 57.2%
  • Go 42.8%
Go to file
2026-03-10 02:28:03 -07:00
cmd/example Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
.gitignore Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
admin.go Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
audit.go Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
dashboard.html Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
go.mod Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
LICENSE Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
middleware.go Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
providers.go Initial commit: GateKey SSO RBAC audit middleware for Go 2026-03-06 09:40:38 -08:00
README.md README: use hexed clone URL 2026-03-10 02:28:03 -07:00

GateKey

SSO, RBAC, and audit logging for Go HTTP apps. middleware. no auth vendor lock in, no k8s operators, no eight hundred a month okta for twenty people

drop it into any net/http server in like fifteen lines

what it does

SSO with Google, Okta, Auth0, Azure AD (OIDC), or SAML. role policies with path and method allow/deny. audit log for every request: who, what, allow/deny, how long. sessions with HMAC signed cookies and Bearer tokens. service accounts so you can issue tokens for CI and scripts. admin dashboard for the audit log and role editor

quick start

git clone https://git.hexed.systems/lifelessai/gatekey
cd gatekey
go mod tidy

GATEKEY_SECRET="your-secret-at-least-32-chars!!" go run ./cmd/example
# open localhost:8080, login at /auth/dev/login (dev provider: alice@acme.com / dev, bob@acme.com / dev)

wire it up: New with Config and providers. Protect("admin") or Protect("employee","admin") on handlers. LoginHandler, CallbackHandler, LogoutHandler for the auth routes. read the example

providers

Google (OAuth2, client ID and domain allowlist). Okta Auth0 Azure (OIDC, discovery URL). SAML stub. DevProvider for local dev with a simple email/password map

RBAC

DefineRole with Allow and Deny rules. paths and methods. first match wins. deny wins over allow when both match. see the example for the shape

audit backends

file (ndjson), webhook (e.g. splunk), in memory, or multi so you can send to several. plug in what you need

service accounts

IssueToken with principal and expiry. use the token as Bearer. good for deploy pipelines and automation

vs the rest

Auth0 and Okta cost money and are not a Go middleware. Casbin does RBAC but no SSO and no audit. gatekey is just a library, self hosted, free. you keep your stack

license

MIT