Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] fix the problem of can not require the api of kie when open rbac #1486

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions server/plugin/auth/buildin/buildin.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,20 @@ func (ba *TokenAuthenticator) VerifyToken(req *http.Request) (interface{}, error
return nil, rbacmodel.NewError(rbacmodel.ErrNoAuthHeader, "")
}
claims, ok := tokenCache.Get(v)
s := strings.Split(v, " ")
if len(s) != 2 {
return nil, rbacmodel.ErrInvalidHeader
}
to := s[1]
if ok {
token.WithRequest(req, to)
switch claimsVal := claims.(type) {
case error:
return nil, claimsVal
default:
return claimsVal, nil
}
}
s := strings.Split(v, " ")
if len(s) != 2 {
return nil, rbacmodel.ErrInvalidHeader
}
to := s[1]

claims, err := authr.Authenticate(req.Context(), to)
if err != nil {
Expand Down
Loading