Skip to content

Commit

Permalink
refactor: apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hoo47 committed Jan 13, 2025
1 parent 4bacce8 commit 14def87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,11 @@ func (b *Broker) createSaslAuthenticateRequest(msg []byte) *SaslAuthenticateRequ
func buildClientFirstMessage(token *AccessToken) ([]byte, error) {
var ext string

if token != nil && token.Extensions != nil && len(token.Extensions) > 0 {
if token == nil {
return []byte{}, fmt.Errorf("failed to build client first message: token is nil")
}

if len(token.Extensions) > 0 {
if _, ok := token.Extensions[SASLExtKeyAuth]; ok {
return []byte{}, fmt.Errorf("the extension `%s` is invalid", SASLExtKeyAuth)
}
Expand Down

0 comments on commit 14def87

Please sign in to comment.