mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
removed vendor
This commit is contained in:
@@ -204,8 +204,13 @@ func (s *Server) processClientOrLeafCallout(c *client, opts *Options) (authorize
|
||||
}
|
||||
defer acc.unsubscribeInternal(sub)
|
||||
|
||||
// Build our request claims.
|
||||
claim := jwt.NewAuthorizationRequestClaims(AuthRequestSubject)
|
||||
// Build our request claims - jwt subject should be nkey
|
||||
jwtSub := acc.Name
|
||||
if opts.AuthCallout != nil {
|
||||
jwtSub = opts.AuthCallout.Issuer
|
||||
}
|
||||
claim := jwt.NewAuthorizationRequestClaims(jwtSub)
|
||||
claim.Audience = AuthRequestSubject
|
||||
// Set expected public user nkey.
|
||||
claim.UserNkey = pub
|
||||
|
||||
@@ -229,11 +234,6 @@ func (s *Server) processClientOrLeafCallout(c *client, opts *Options) (authorize
|
||||
|
||||
authTimeout := secondsToDuration(s.getOpts().AuthTimeout)
|
||||
claim.Expires = time.Now().Add(time.Duration(authTimeout)).UTC().Unix()
|
||||
if opts.AuthCallout != nil {
|
||||
claim.Audience = opts.AuthCallout.Issuer
|
||||
} else {
|
||||
claim.Audience = acc.Name
|
||||
}
|
||||
|
||||
// Grab client info for the request.
|
||||
c.mu.Lock()
|
||||
|
||||
@@ -1857,7 +1857,7 @@ func (c *client) updateSmap(sub *subscription, delta int32) {
|
||||
|
||||
n := c.leaf.smap[key]
|
||||
// We will update if its a queue, if count is zero (or negative), or we were 0 and are N > 0.
|
||||
update := sub.queue != nil || n == 0 || n+delta <= 0
|
||||
update := sub.queue != nil || (n <= 0 && n+delta > 0) || (n > 0 && n+delta <= 0)
|
||||
n += delta
|
||||
if n > 0 {
|
||||
c.leaf.smap[key] = n
|
||||
|
||||
Reference in New Issue
Block a user