Skip to content

Commit

Permalink
refactor:优化鉴权相关功能开关以及修复NPE问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Jun 15, 2023
1 parent 9e8784c commit 952fce5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 11 additions & 8 deletions auth/defaultauth/auth_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,12 @@ func Test_defaultAuthChecker_Initialize(t *testing.T) {
err := authChecker.Initialize(cfg, storage, cacheMgn)
assert.NoError(t, err)
assert.Equal(t, &AuthConfig{
ConsoleOpen: true,
ClientOpen: true,
Salt: "polarismesh@2021",
Strict: false,
ConsoleOpen: true,
ClientOpen: true,
Salt: "polarismesh@2021",
Strict: false,
ConsoleStrict: true,
ClientStrict: false,
}, AuthOption)
})

Expand All @@ -1155,10 +1157,11 @@ func Test_defaultAuthChecker_Initialize(t *testing.T) {
err := authChecker.Initialize(cfg, storage, cacheMgn)
assert.NoError(t, err)
assert.Equal(t, &AuthConfig{
ConsoleOpen: true,
ClientOpen: true,
Salt: "polarismesh@2021",
Strict: false,
ConsoleOpen: true,
ClientOpen: true,
Salt: "polarismesh@2021",
Strict: false,
ConsoleStrict: true,
}, AuthOption)
})

Expand Down
2 changes: 2 additions & 0 deletions auth/defaultauth/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func reset(strict bool) {
AuthOption.ClientOpen = true
AuthOption.ConsoleOpen = true
AuthOption.Strict = strict
AuthOption.ConsoleStrict = strict
AuthOption.ClientStrict = strict
}

func initCache(ctrl *gomock.Controller) (*cache.Config, *storemock.MockStore) {
Expand Down

0 comments on commit 952fce5

Please sign in to comment.