Skip to content

Commit

Permalink
Merge pull request #280 from MadAppGang/fix-config-validation
Browse files Browse the repository at this point in the history
Fix FileStorageTypeLocal validation on login web app settings. Removed old static config.
  • Loading branch information
erudenko authored Dec 17, 2021
2 parents f0592ee + 5c5cdcf commit 91e9513
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 20 deletions.
6 changes: 0 additions & 6 deletions cmd/config-dynamodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ keyStorage: # Storage for keys used for signing and verifying JWTs.
file:
private_key_path: ./jwt/test_artifacts/private.pem

static:
type: local
local:
folder: ./static
serveAdminPanel: true

login: # Supported login ways.
loginWith:
phone: true
Expand Down
6 changes: 0 additions & 6 deletions cmd/config-mem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ keyStorage: # Storage for keys used for signing and verifying JWTs.
file:
private_key_path: ./jwt/test_artifacts/private.pem

static:
type: local
local:
folder: ./static
serveAdminPanel: true

login: # Supported login ways.
loginWith:
phone: true
Expand Down
6 changes: 0 additions & 6 deletions cmd/config-mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ keyStorage: # Storage for keys used for signing and verifying JWTs.
file:
private_key_path: ./jwt/test_artifacts/private.pem

static:
type: local
local:
folder: ./static
serveAdminPanel: true

login: # Supported login ways.
loginWith:
phone: true
Expand Down
3 changes: 1 addition & 2 deletions model/server_settings_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,13 @@ func (sfs *FileStorageSettings) Validate() error {
return fmt.Errorf("Nil %s", subject)
}


switch sfs.Type {
case FileStorageTypeDefault:
return nil
case FileStorageTypeNone:
return nil
case FileStorageTypeLocal:
if len(sfs.Local.FolderPath) > 0 {
if len(sfs.Local.FolderPath) == 0 {
return fmt.Errorf("%s. empty folder", subject)
}
return nil
Expand Down

0 comments on commit 91e9513

Please sign in to comment.