middleware

package
v0.0.0-...-c41461d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 25 Imported by: 0

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