# README
Migration
Migration from 1.*
to 2.*
-
CorsMiddleware
The old
CorsMiddlewareV2
is now replaced byCorsMiddleware
Migration steps:
-
If you are using
CorsMiddlewareV2
, change it toCorsMiddleware
-
If you are using
CorsMiddleware
, add this code to the endpoints that need CORS, remember to configure it to your needs.server.mux. HandleFunc("<path>", http_middleware.Options( []string{http.MethodGet}, []string{http_model.HeaderContentType}, )). Methods(http.MethodOptions)
-
-
AuthenticateMiddleware
The old
AuthenticateMiddleware
has been modified to take care of retrieving User ID by itself.Migration steps:
- Add the following code to your main file.
http_middleware.Configure( http_middleware.Config{Stage: authenticateStage}, )
- Add the following code to your main file.
# Functions
AuthenticateMiddleware retrieves the security configuration for the matched route and handles Access Token validation and stores the token claims in the request context.
AuthenticateMiddlewareV3 retrieves the security configuration for the matched route and handles Access Token validation and stores the token claims in the request context.
AuthorizeMiddleware retrieves the security configuration for the matched route and handles the configured authorizations.
No description provided by the author
ContentType wraps a HandlerFunc and checks the incoming content-type with a list of allowed content types.
CorsMiddleware adds Access-Control-Allow-Origin header to responses.
No description provided by the author
No description provided by the author
No description provided by the author
HandleSecureEndpoint creates a new SecurityConfig for the specified endpoint.
No description provided by the author
OpenCensusMiddleware adds request method and path template as span name.
Options takes a list of methods and headers and returns an Options HandlerFunc.
nolint: contextcheck.
TrailingSlashMiddleware removes trailing slash from URL's.
# Constants
No description provided by the author
# Variables
NilResourceFunc represents the Zero Value ResourceFunc.
# Structs
No description provided by the author
SecurityConfig represents how to authenticate and authorize a given endpoint and method.
# Type aliases
ResourceFunc takes a *http.Request and returns the resource to use for authorization.