gcpapigatewaymw

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 6 Imported by: 0

README

gin-gcp-api-gateway-middleware

Go Reference Go Report Card Maintainability Test Coverage

Middleware to insert GCP API Gateway user info to the context

Authors

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGatewayUserID

func GetGatewayUserID(ctx *gin.Context) string

GetGatewayUserID returns the user ID from the context.

func Middleware added in v0.3.0

func Middleware() gin.HandlerFunc

Middleware creates a new GatewayCtx middleware.

Types

type GatewayUserInfo

type GatewayUserInfo struct {
	Sub   string `json:"sub" binding:"required"`
	Email string `json:"email" binding:"required,email"`
}

func GetGatewayUserInfo

func GetGatewayUserInfo(ctx *gin.Context) GatewayUserInfo

GetGatewayUserInfo returns the user info from the context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL