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
APIKeyfuncAPIKey validates a header API key and stores it on the request context.
BasicfuncBasic validates HTTP Basic credentials.
BearerfuncBearer validates Authorization: Bearer <jwt> and stores claims on the request context.
GetAPIKeyfuncGetAPIKey returns the API key set by APIKey middleware.
GetBasicUserfuncGetBasicUser returns the username set by Basic middleware.
GetClaimsfuncGetClaims returns JWT claims set by Bearer middleware.

Types

SymbolNode.jsKindSummary
APIKeyOptstypeAPIKeyOpts configures API key middleware.
BearerOptionstypeBearerOptions configures JWT bearer middleware.

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