Skip to content

Commit

Permalink
moved attribute to account
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hanel <mh@synadia.com>
  • Loading branch information
matthiashanel committed May 9, 2022
1 parent 9f4f1d5 commit b7cabf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions v2/account_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ type AccountLimits struct {
Imports int64 `json:"imports,omitempty"` // Max number of imports
Exports int64 `json:"exports,omitempty"` // Max number of exports
WildcardExports bool `json:"wildcards,omitempty"` // Are wildcards allowed in exports
Conn int64 `json:"conn,omitempty"` // Max number of active connections
LeafNodeConn int64 `json:"leaf,omitempty"` // Max number of active leaf node connections
DisallowBearer bool `json:"disallow_bearer,omitempty"` // User JWT can't be bearer token
Conn int64 `json:"conn,omitempty"` // Max number of active connections
LeafNodeConn int64 `json:"leaf,omitempty"` // Max number of active leaf node connections
}

// IsUnlimited returns true if all limits are unlimited
func (a *AccountLimits) IsUnlimited() bool {
return *a == AccountLimits{NoLimit, NoLimit, true, NoLimit, NoLimit}
return *a == AccountLimits{NoLimit, NoLimit, true, false, NoLimit, NoLimit}
}

type NatsLimits struct {
Expand Down Expand Up @@ -231,7 +232,7 @@ func NewAccountClaims(subject string) *AccountClaims {
// errors if we add to the OperatorLimits.
c.Limits = OperatorLimits{
NatsLimits{NoLimit, NoLimit, NoLimit},
AccountLimits{NoLimit, NoLimit, true, NoLimit, NoLimit},
AccountLimits{NoLimit, NoLimit, true, false, NoLimit, NoLimit},
JetStreamLimits{0, 0, 0, 0, 0, 0, 0, false},
JetStreamTieredLimits{},
}
Expand Down
1 change: 0 additions & 1 deletion v2/operator_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type Operator struct {
AssertServerVersion string `json:"assert_server_version,omitempty"`
// Signing of subordinate objects will require signing keys
StrictSigningKeyUsage bool `json:"strict_signing_key_usage,omitempty"`
DisallowBearerToken bool `json:"disallow_bearer,omitempty"`
GenericFields
}

Expand Down

0 comments on commit b7cabf8

Please sign in to comment.