Documentation
¶
Index ¶
- func AuthAdmin() func(c *gin.Context)
- func AuthAdminOfTopic(db *gorm.DB) func(c *gin.Context)
- func ConfigSaml(r *gin.Engine, c SamlConfig)
- func InitI18n(c *gin.Context)
- func InitTemplateBase(tr i18n.I18n, config model.Config, db *gorm.DB) func(c *gin.Context)
- func SecurityHeaders() gin.HandlerFunc
- func SetSecureCookies(secure bool)
- type SamlConfig
- type TokenClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigSaml ¶
func ConfigSaml(r *gin.Engine, c SamlConfig)
func InitTemplateBase ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.