File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ type ApplicationConfig struct {
7272 DisableRuntimeSettings bool
7373
7474 AgentJobRetentionDays int // Default: 30 days
75+
76+ PathWithoutAuth []string
7577}
7678
7779type AppOption func (* ApplicationConfig )
@@ -82,6 +84,15 @@ func NewApplicationConfig(o ...AppOption) *ApplicationConfig {
8284 UploadLimitMB : 15 ,
8385 Debug : true ,
8486 AgentJobRetentionDays : 30 , // Default: 30 days
87+ PathWithoutAuth : []string {
88+ "/static/" ,
89+ "/generated-audio/" ,
90+ "/generated-images/" ,
91+ "/generated-videos/" ,
92+ "/favicon.svg" ,
93+ "/readyz" ,
94+ "/healthz" ,
95+ },
8596 }
8697 for _ , oo := range o {
8798 oo (opt )
Original file line number Diff line number Diff line change @@ -156,21 +156,10 @@ func getApiKeyRequiredFilterFunction(applicationConfig *config.ApplicationConfig
156156 return func (c echo.Context ) bool {
157157 path := c .Request ().URL .Path
158158
159- // Always skip authentication for static files
160- if strings .HasPrefix (path , "/static/" ) {
161- return true
162- }
163-
164- // Always skip authentication for generated content
165- if strings .HasPrefix (path , "/generated-audio/" ) ||
166- strings .HasPrefix (path , "/generated-images/" ) ||
167- strings .HasPrefix (path , "/generated-videos/" ) {
168- return true
169- }
170-
171- // Skip authentication for favicon
172- if path == "/favicon.svg" {
173- return true
159+ for _ , p := range applicationConfig .PathWithoutAuth {
160+ if strings .HasPrefix (path , p ) {
161+ return true
162+ }
174163 }
175164
176165 // Handle GET request exemptions if enabled
You can’t perform that action at this time.
0 commit comments