auth
Package auth provides Passport-style authentication middleware for gox/http. Node equivalent: passport, passport-jwt, passport-http-bearer.
import "github.com/sahilkhaire/gox/auth"
Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.
Functions
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| APIKey | — | func | APIKey validates a header API key and stores it on the request context. |
| Basic | — | func | Basic validates HTTP Basic credentials. |
| Bearer | — | func | Bearer validates Authorization: Bearer <jwt> and stores claims on the request context. |
| GetAPIKey | — | func | GetAPIKey returns the API key set by APIKey middleware. |
| GetBasicUser | — | func | GetBasicUser returns the username set by Basic middleware. |
| GetClaims | — | func | GetClaims returns JWT claims set by Bearer middleware. |
Types
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| APIKeyOpts | — | type | APIKeyOpts configures API key middleware. |
| BearerOptions | — | type | BearerOptions configures JWT bearer middleware. |