feat: fiber CSRF (#2482)

new config option - enables or disables the fiber csrf middleware

Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
Dave 2024-06-04 15:43:46 -04:00 committed by GitHub
parent 2fc6fe806b
commit 4e1463fec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 0 deletions

View file

@ -26,6 +26,7 @@ type ApplicationConfig struct {
DynamicConfigsDir string
DynamicConfigsDirPollInterval time.Duration
CORS bool
CSRF bool
PreloadJSONModels string
PreloadModelsFromPath string
CORSAllowOrigins string
@ -87,6 +88,12 @@ func WithCors(b bool) AppOption {
}
}
func WithCsrf(b bool) AppOption {
return func(o *ApplicationConfig) {
o.CSRF = b
}
}
func WithModelLibraryURL(url string) AppOption {
return func(o *ApplicationConfig) {
o.ModelLibraryURL = url