Documentation ¶
Index ¶
- func AddRequestHeader(header, key string) func(*gin.Context)
- func BasicAuthMiddleware(accounts gin.Accounts) func(c *gin.Context)
- func CertTemplate() (*x509.Certificate, error)
- func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (cert *x509.Certificate, certPEM []byte, err error)
- func GenerateCertificates() ([]tls.Certificate, error)
- func GinRunSelfSignedSSL(r *gin.Engine, addr string) (err error)
- func JWTAuthCachedMiddleware(jwksURL, boundIssuer, jwtheader, claimid string) func(c *gin.Context)
- func JWTAuthMiddleware(jwksURL, boundIssuer, jwtheader, claimid string) func(c *gin.Context)
- func LogoutRoute(c *gin.Context)
- func MetricsMiddleware(metric string, keys ...any) func(c *gin.Context)
- func Proxy(target string) func(*gin.Context)
- func RBACMiddleware(config *RBACConfig) func(c *gin.Context)
- func RBACTokenParamMiddleware(model, policy any, tokenHeader string, params []string) func(c *gin.Context)
- func RBACTokenPathMiddleware(model, policy any, tokenHeader string) func(c *gin.Context)
- func RemoveHeaders(headers ...string) func(*gin.Context)
- func RequireAuthMiddleware() func(c *gin.Context)
- func ReturnData(c *gin.Context, status int, data any)
- func SAMLMiddleware(samlSP *samlsp.Middleware) func(c *gin.Context)
- func SAMLtoParamsMapMiddleware(params map[string]string) func(c *gin.Context)
- func SAMLtoParamsMiddleware(params ...string) func(c *gin.Context)
- func SimpleTokenAuthMiddleware(token, header string) func(c *gin.Context)
- func SimpleTokenAuthOptionalMiddleware(token, header string) func(c *gin.Context)
- func WrapBytes(b []byte) func(*gin.Context)
- func WrapDataFunc(f func() (any, error)) func(*gin.Context)
- func WrapDataFuncContext(f func(*gin.Context) (any, error)) func(*gin.Context)
- func WrapDataFuncParams(f func(Params) (any, error)) func(*gin.Context)
- func WrapErrorFunc(f func() error) func(*gin.Context)
- func WrapGinH(d gin.H) func(*gin.Context)
- func WrapH(d H) func(*gin.Context)
- func WrapString(s string) func(*gin.Context)
- type Engine
- func (e *Engine) AddHealthCheckFunc(f func() error) *Engine
- func (e *Engine) AddTemplateFunc(k string, v interface{}) *Engine
- func (e *Engine) Any(relativePath string, f ...any)
- func (e *Engine) DELETE(relativePath string, f ...any)
- func (e *Engine) GET(relativePath string, f ...any)
- func (e *Engine) HEAD(relativePath string, f ...any)
- func (e *Engine) HTML(template string, f any) func(*gin.Context)
- func (e *Engine) HTMLWithError(template, errorTemplate string, f any) func(*gin.Context)
- func (e *Engine) Handle(httpMethod, relativePath string, funcs ...any)
- func (e *Engine) HealthCheckRoute(c *gin.Context)
- func (e *Engine) JWTAuthGroup(path, jwksURL, boundIssuer, jwtheader, claimid string) *RouterGroup
- func (e *Engine) NoRoute(funcs ...any)
- func (e *Engine) NoRouteHTML(template string, f any)
- func (e *Engine) NoRouteProxy(target string)
- func (e *Engine) NoRouteRedirect(location string)
- func (e *Engine) OAuthGroup(path string, authServerURL string, config oauth2.Config) *gin.RouterGroup
- func (e *Engine) OAuthMW(path string, authServerURL string, config oauth2.Config) gin.HandlerFunc
- func (e *Engine) OPTIONS(relativePath string, f ...any)
- func (e *Engine) PATCH(relativePath string, f ...any)
- func (e *Engine) POST(relativePath string, f ...any)
- func (e *Engine) PUT(relativePath string, f ...any)
- func (e *Engine) RBACGroup(path string, config *RBACConfig) *gin.RouterGroup
- func (e *Engine) RBACTokenParamGroup(path string, model, policy any, tokenHeader string, params []string) *gin.RouterGroup
- func (e *Engine) RBACTokenPathGroup(path string, model, policy any, tokenHeader string) *gin.RouterGroup
- func (e *Engine) Redirect(location string) gin.HandlerFunc
- func (e *Engine) Router() *gin.Engine
- func (e *Engine) Run(addr ...string) error
- func (e *Engine) RunSSLSelfSigned(addr string) error
- func (e *Engine) SAMLGroup(path string, config *SAMLGroupConfig) *gin.RouterGroup
- func (e *Engine) SAMLInit(config *SAMLGroupConfig) *samlsp.Middleware
- func (e *Engine) SAMLSetup(config *SAMLGroupConfig) *samlsp.Middleware
- func (e *Engine) SetVersion(version string) *Engine
- func (e *Engine) SimpleTokenAuthGroup(path, token, header string) *RouterGroup
- func (e *Engine) Static(assets string) *Engine
- func (e *Engine) Templates(views string, partials []string) *Engine
- type H
- type Param
- type Params
- type RBACConfig
- type RouterGroup
- func (r *RouterGroup) Any(relativePath string, funcs ...any)
- func (r *RouterGroup) DELETE(relativePath string, funcs ...any)
- func (r *RouterGroup) GET(relativePath string, funcs ...any)
- func (r *RouterGroup) HEAD(relativePath string, funcs ...any)
- func (r *RouterGroup) Handle(httpMethod, relativePath string, funcs ...any)
- func (r *RouterGroup) OPTIONS(relativePath string, funcs ...any)
- func (r *RouterGroup) PATCH(relativePath string, funcs ...any)
- func (r *RouterGroup) POST(relativePath string, funcs ...any)
- func (r *RouterGroup) PUT(relativePath string, funcs ...any)
- type SAMLGroupConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRequestHeader ¶
func CertTemplate ¶
func CertTemplate() (*x509.Certificate, error)
func CreateCert ¶
func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) ( cert *x509.Certificate, certPEM []byte, err error)
func GenerateCertificates ¶
func GenerateCertificates() ([]tls.Certificate, error)
func JWTAuthCachedMiddleware ¶ added in v0.5.0
func JWTAuthMiddleware ¶ added in v0.5.0
func LogoutRoute ¶
func RBACMiddleware ¶
func RBACMiddleware(config *RBACConfig) func(c *gin.Context)
func RBACTokenPathMiddleware ¶
func RemoveHeaders ¶
func RequireAuthMiddleware ¶ added in v0.5.0
func SAMLMiddleware ¶
func SAMLMiddleware(samlSP *samlsp.Middleware) func(c *gin.Context)
func SAMLtoParamsMiddleware ¶
func WrapDataFuncContext ¶
func WrapErrorFunc ¶
func WrapString ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() (r *Engine)
func NewDefaultWithSessions ¶
func (*Engine) AddHealthCheckFunc ¶
func (*Engine) AddTemplateFunc ¶
func (*Engine) HTMLWithError ¶
func (*Engine) HealthCheckRoute ¶
func (*Engine) JWTAuthGroup ¶ added in v0.5.0
func (e *Engine) JWTAuthGroup(path, jwksURL, boundIssuer, jwtheader, claimid string) *RouterGroup
func (*Engine) NoRouteHTML ¶
func (*Engine) NoRouteProxy ¶
func (*Engine) NoRouteRedirect ¶
func (*Engine) OAuthGroup ¶
func (*Engine) RBACGroup ¶
func (e *Engine) RBACGroup(path string, config *RBACConfig) *gin.RouterGroup
func (*Engine) RBACTokenParamGroup ¶
func (*Engine) RBACTokenPathGroup ¶
func (*Engine) RunSSLSelfSigned ¶
func (*Engine) SAMLGroup ¶
func (e *Engine) SAMLGroup(path string, config *SAMLGroupConfig) *gin.RouterGroup
func (*Engine) SAMLInit ¶
func (e *Engine) SAMLInit(config *SAMLGroupConfig) *samlsp.Middleware
func (*Engine) SAMLSetup ¶ added in v0.8.0
func (e *Engine) SAMLSetup(config *SAMLGroupConfig) *samlsp.Middleware
func (*Engine) SetVersion ¶
func (*Engine) SimpleTokenAuthGroup ¶
func (e *Engine) SimpleTokenAuthGroup(path, token, header string) *RouterGroup
type RBACConfig ¶
TODO: Implement RBACConfig
type RouterGroup ¶
type RouterGroup struct {
gin.RouterGroup
}
func (*RouterGroup) Any ¶
func (r *RouterGroup) Any(relativePath string, funcs ...any)
func (*RouterGroup) DELETE ¶
func (r *RouterGroup) DELETE(relativePath string, funcs ...any)
func (*RouterGroup) GET ¶
func (r *RouterGroup) GET(relativePath string, funcs ...any)
func (*RouterGroup) HEAD ¶
func (r *RouterGroup) HEAD(relativePath string, funcs ...any)
func (*RouterGroup) Handle ¶
func (r *RouterGroup) Handle(httpMethod, relativePath string, funcs ...any)
func (*RouterGroup) OPTIONS ¶
func (r *RouterGroup) OPTIONS(relativePath string, funcs ...any)
func (*RouterGroup) PATCH ¶
func (r *RouterGroup) PATCH(relativePath string, funcs ...any)
func (*RouterGroup) POST ¶
func (r *RouterGroup) POST(relativePath string, funcs ...any)
func (*RouterGroup) PUT ¶
func (r *RouterGroup) PUT(relativePath string, funcs ...any)
type SAMLGroupConfig ¶
type SAMLGroupConfig struct { MetaDataFile string MetaDataURL string CertFile string KeyFile string EntityID string RootURL string ParamMap map[string]string AllowSkip bool }
metadataFile metadata.xml certFile myservice.cert keyFile myservice.key entityID asdfasdf rootURL https://devlocal.site:8000 ACS URL: /saml/acs TODO: Implement SAMLGroupConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.