package
0.9.1
Repository: https://github.com/coding-hui/iam.git
Documentation: pkg.go.dev

# Packages

Package auth defines authentication strategy like Basic, Bearer.

# Functions

Context is a middleware that injects common prefix fields to gin.Context.
Cors add cors headers.
GetDefaultLogFormatterWithRequestID returns gin.LogFormatter with 'RequestID'.
GetLoggerConfig return gin.LoggerConfig which will write the logs to specified io.Writer with given gin.LogFormatter.
GetRequestIDFromContext returns 'RequestID' from the given context if present.
GetRequestIDFromHeaders returns 'RequestID' from the headers if present.
GinRecovery custom error output.
NoCache is a middleware function that appends headers to prevent the client from caching the HTTP response.
Options is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request.
RequestID is a middleware that injects a 'X-Request-ID' into the context and request/response header of each request.
RequestLog write to console.
Secure is a middleware function that appends security and resource access headers.

# Constants

Defines the key in gin context which represents the owner of the secret.
Defines the key in gin context which represents the owner of the secret.
XRequestIDKey defines X-Request-ID key string.

# Variables

Middlewares store registered middlewares.

# Structs

AuthOperator used to switch between different authentication strategy.

# Interfaces

AuthStrategy defines the set of methods used to do resource authentication.