-
Notifications
You must be signed in to change notification settings - Fork 3
/
account_limits.go
103 lines (80 loc) · 2.3 KB
/
account_limits.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package authb
import (
"github.com/nats-io/jwt/v2"
)
type accountLimits struct {
data *AccountData
}
func (a *accountLimits) OperatorLimits() jwt.OperatorLimits {
return a.data.Claim.Limits
}
func (a *accountLimits) SetOperatorLimits(limits jwt.OperatorLimits) error {
a.data.Claim.Limits = limits
return a.data.update()
}
func (a *accountLimits) MaxSubscriptions() int64 {
return a.data.Claim.Limits.Subs
}
func (a *accountLimits) SetMaxSubscriptions(max int64) error {
a.data.Claim.Limits.Subs = max
return a.data.update()
}
func (a *accountLimits) MaxPayload() int64 {
return a.data.Claim.Limits.Payload
}
func (a *accountLimits) SetMaxPayload(max int64) error {
a.data.Claim.Limits.Payload = max
return a.data.update()
}
func (a *accountLimits) MaxData() int64 {
return a.data.Claim.Limits.Data
}
func (a *accountLimits) SetMaxData(max int64) error {
a.data.Claim.Limits.Data = max
return a.data.update()
}
func (a *accountLimits) MaxConnections() int64 {
return a.data.Claim.Limits.Conn
}
func (a *accountLimits) SetMaxConnections(max int64) error {
a.data.Claim.Limits.Conn = max
return a.data.update()
}
func (a *accountLimits) MaxLeafNodeConnections() int64 {
return a.data.Claim.Limits.LeafNodeConn
}
func (a *accountLimits) SetMaxLeafNodeConnections(max int64) error {
a.data.Claim.Limits.LeafNodeConn = max
return a.data.update()
}
func (a *accountLimits) MaxImports() int64 {
return a.data.Claim.Limits.Imports
}
func (a *accountLimits) SetMaxImports(max int64) error {
a.data.Claim.Limits.Imports = max
return a.data.update()
}
func (a *accountLimits) MaxExports() int64 {
return a.data.Claim.Limits.Exports
}
func (a *accountLimits) SetMaxExports(max int64) error {
a.data.Claim.Limits.Exports = max
return a.data.update()
}
func (a *accountLimits) AllowWildcardExports() bool {
return a.data.Claim.Limits.WildcardExports
}
func (a *accountLimits) SetAllowWildcardExports(tf bool) error {
a.data.Claim.Limits.WildcardExports = tf
return a.data.update()
}
func (a *accountLimits) DisallowBearerTokens() bool {
return a.data.Claim.Limits.DisallowBearer
}
func (a *accountLimits) SetDisallowBearerTokens(tf bool) error {
a.data.Claim.Limits.DisallowBearer = tf
return a.data.update()
}
func (a *accountLimits) JetStream() JetStreamTieredLimits {
return &accountJsTieredLimits{data: a.data}
}