Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: enterprise limit (#11168)

Danny Xu5d633ccfd591
diff --git a/backend/enterprise/api/license.go b/backend/enterprise/api/license.go
index ebbf3fad9a..484c73c353 100644
--- a/backend/enterprise/api/license.go
+++ b/backend/enterprise/api/license.go
@@ -20,13 +20,14 @@ var validPlans = []api.PlanType{
// License is the API message for enterprise license.
type License struct {
- Subject string `json:"subject"`
- InstanceCount int `json:"instanceCount"`
- ExpiresTs int64 `json:"expiresTs"`
- IssuedTs int64 `json:"issuedTs"`
- Plan api.PlanType `json:"plan"`
- Trialing bool `json:"trialing"`
- OrgName string `json:"orgName"`
+ Subject string
+ InstanceCount int
+ Seat int
+ ExpiresTs int64
+ IssuedTs int64
+ Plan api.PlanType
+ Trialing bool
+ OrgName string
}
// Valid will check if license expired or has correct plan type.
diff --git a/backend/enterprise/api/subscription.go b/backend/enterprise/api/subscription.go
index 8669d2ee2b..5cdb936826 100644
--- a/backend/enterprise/api/subscription.go
+++ b/backend/enterprise/api/subscription.go
@@ -14,13 +14,14 @@ type SubscriptionPatch struct {
// Subscription is the API message for subscription.
type Subscription struct {
- InstanceCount int `jsonapi:"attr,instanceCount"`
- ExpiresTs int64 `jsonapi:"attr,expiresTs"`
- StartedTs int64 `jsonapi:"attr,startedTs"`
- Plan api.PlanType `jsonapi:"attr,plan"`
- Trialing bool `jsonapi:"attr,trialing"`
- OrgID string `jsonapi:"attr,orgId"`
- OrgName string `jsonapi:"attr,orgName"`
+ InstanceCount int
+ Seat int
+ ExpiresTs int64
+ StartedTs int64
+ Plan api.PlanType
+ Trialing bool
+ OrgID string
+ OrgName string
}
// IsExpired returns if the subscription is expired.
diff --git a/backend/enterprise/plugin/aws/aws.go b/backend/enterprise/plugin/aws/aws.go
index d83623b1c2..42590478bc 100644
--- a/backend/enterprise/plugin/aws/aws.go
+++ b/backend/enterprise/plugin/aws/aws.go
@@ -68,6 +68,7 @@ func (*Provider) StoreLicense(_ context.Context, _ *enterprise.SubscriptionPatch
func (p *Provider) LoadSubscription(ctx context.Context) *enterprise.Subscription {
subscription := &enterprise.Subscription{
InstanceCount: 0,
+ Seat: 0,
Plan: api.FREE,
OrgID: aws.ToString(p.identity.Account),
OrgName: aws.ToString(p.identity.Arn),
diff --git a/backend/enterprise/plugin/hub/hub.go b/backend/enterprise/plugin/hub/hub.go
index 2f51c05a0a..aab89e9e56 100644
--- a/backend/enterprise/plugin/hub/hub.go
+++ b/backend/enterprise/plugin/hub/hub.go
@@ -31,6 +31,7 @@ type Provider struct {
// We add jwt.RegisteredClaims as an embedded type, to provide fields such as name.
type claims struct {
InstanceCount int `json:"instanceCount"`
+ Seat int `json:"seat"`
Trialing bool `json:"trialing"`
Plan string `json:"plan"`
OrgName string `json:"orgName"`
@@ -79,6 +80,7 @@ func (p *Provider) LoadSubscription(ctx context.Context) *enterprise.Subscriptio
ExpiresTs: -1,
// Instance license count.
InstanceCount: 0,
+ Seat: 0,
}
}
@@ -87,6 +89,7 @@ func (p *Provider) LoadSubscription(ctx context.Context) *enterprise.Subscriptio
ExpiresTs: license.ExpiresTs,
StartedTs: license.IssuedTs,
InstanceCount: license.InstanceCount,
+ Seat: license.Seat,
Trialing: license.Trialing,
OrgID: license.OrgID(),
OrgName: license.OrgName,
@@ -203,6 +206,7 @@ func (p *Provider) parseClaims(ctx context.Context, claim *claims) (*enterprise.
license := &enterprise.License{
InstanceCount: claim.InstanceCount,
+ Seat: claim.Seat,
ExpiresTs: claim.ExpiresAt.Unix(),
IssuedTs: claim.IssuedAt.Unix(),
Plan: planType,