middleware

package
v0.0.0-...-6470da7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthAdmin

func AuthAdmin() func(c *gin.Context)

func AuthAdminOfTopic

func AuthAdminOfTopic(db *gorm.DB) func(c *gin.Context)

func ConfigSaml

func ConfigSaml(r *gin.Engine, c SamlConfig)

func InitI18n

func InitI18n(c *gin.Context)

func InitTemplateBase

func InitTemplateBase(tr i18n.I18n, config model.Config, db *gorm.DB) func(c *gin.Context)

func SecurityHeaders

func SecurityHeaders() gin.HandlerFunc

SecurityHeaders adds security-related HTTP headers to responses

func SetSecureCookies

func SetSecureCookies(secure bool)

SetSecureCookies sets whether cookies should be secure (for production mode)

Types

type SamlConfig

type SamlConfig struct {
	IdpMetadataURL string `yaml:"idpMetadataURL"`
	EntityID       string `yaml:"entityID"`
	RootURL        string `yaml:"rootURL"`
	Cert           struct {
		Org           string `yaml:"org"`
		Country       string `yaml:"country"`
		Province      string `yaml:"province"`
		Locality      string `yaml:"locality"`
		StreetAddress string `yaml:"streetAddress"`
		PostalCode    string `yaml:"postalCode"`
		Cn            string `yaml:"cn"`
	} `yaml:"cert"`
}

type TokenClaims

type TokenClaims struct {
	*jwt.RegisteredClaims

	UID  string `json:"UID"`
	Name string `json:"name"`
	Mail string `json:"mail"`
}

Jump to

Keyboard shortcuts

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