feat: add API_KEY list support (#877)

Co-authored-by: Harold Sun <sunhua@amazon.com>
This commit is contained in:
Michael Nesbitt 2023-08-09 17:06:21 -05:00 committed by GitHub
parent 8c781a6a44
commit 1d1cae8e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 19 deletions

View file

@ -23,6 +23,7 @@ type Option struct {
PreloadJSONModels string
PreloadModelsFromPath string
CORSAllowOrigins string
ApiKeys []string
Galleries []gallery.Gallery
@ -184,3 +185,9 @@ func WithImageDir(imageDir string) AppOption {
o.ImageDir = imageDir
}
}
func WithApiKeys(apiKeys []string) AppOption {
return func(o *Option) {
o.ApiKeys = apiKeys
}
}