Skip to content

Commit

Permalink
Fix auth type display to say default
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed May 31, 2024
1 parent d98fc06 commit f2e3c23
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/clace/app_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ func appType(app types.AppResponse) string {
func authType(app types.AppResponse) string {
if app.Settings.AuthnType == types.AppAuthnNone {
return "NONE"
} else if app.Settings.AuthnType == types.AppAuthnDefault {
} else if app.Settings.AuthnType == types.AppAuthnSystem {
return "SYSTEM"
} else if app.Settings.AuthnType == "" {
return "----"
} else if app.Settings.AuthnType == types.AppAuthnDefault || app.Settings.AuthnType == "" {
return "DEFAULT"
} else {
return string(app.Settings.AuthnType)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/commander/test_reload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ tests:
stdout:
exactly: "0" # no apps at 0e23273f82701c7ecb4f9f6b4e2a4c6ea154c0ec
reload0506a: # check app list auth listing
command: '../clace app list --internal "/reload_git*" | grep SYST | wc -l'
command: '../clace app list --internal "/reload_git*" | grep DEFAULT | wc -l'
stdout:
exactly: "4"

Expand Down
4 changes: 2 additions & 2 deletions tests/commander/test_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ tests:
command: curl -su "admin:qwerty" localhost:25222/versions_local1/abc/def/test.txt
stdout: "abc"
versions0060: # check list, four apps on version 1
command: ../clace app list -i "/versions*" | grep "1 SYST" | wc -l
command: ../clace app list -i "/versions*" | grep "1 DEFAULT" | wc -l
stdout: "4"
versions0070: # check list, one dev app on version 0
command: ../clace app list -i "/versions*" | grep "0 SYST" | wc -l
command: ../clace app list -i "/versions*" | grep "0 DEFAULT" | wc -l
stdout: "1"
versions0080: # update static file
command: echo "22" > ./versionstest/static_root/rootfile.txt
Expand Down
8 changes: 7 additions & 1 deletion tests/test_basics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ tests:
command: ../clace app create --dev --auth=default ./testapp /test3
exit-code: 0

basic260a: # List shows auth as DEFAULT
command: "../clace app list --format csv /test3 | grep DEFAULT | wc -l"
stdout:
exactly: "1"
exit-code: 0

basic270: # check curl works with password
command: curl -sS -u "admin:abcd" localhost:9154/test3
stdout: "Test app body"
Expand Down Expand Up @@ -147,7 +153,7 @@ tests:
line-count: 4
contains:
- "Type Version Auth"
- "PROD 1 SYST"
- "PROD 1 DEFAULT"
exit-code: 0
basic510: # Test app list command with internal
command: ../clace app list --internal
Expand Down

0 comments on commit f2e3c23

Please sign in to comment.