Skip to content
Node: passport8 APIs

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"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions ​

SymbolNode.jsKindSummary
APIKey—funcAPIKey validates a header API key and stores it on the request context.
Basic—funcBasic validates HTTP Basic credentials.
Bearer—funcBearer validates Authorization: Bearer <jwt> and stores claims on the request context.
GetAPIKey—funcGetAPIKey returns the API key set by APIKey middleware.
GetBasicUser—funcGetBasicUser returns the username set by Basic middleware.
GetClaims—funcGetClaims returns JWT claims set by Bearer middleware.

Types ​

SymbolNode.jsKindSummary
APIKeyOpts—typeAPIKeyOpts configures API key middleware.
BearerOptions—typeBearerOptions configures JWT bearer middleware.

MIT Licensed · Built for Node.js developers moving to Go