Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: not allow manually upload license in the saas mode (#16889)
ecmadao74a031c4eabb
diff --git a/backend/api/v1/subscription_service.go b/backend/api/v1/subscription_service.goindex d9ff1a787d..ee0171650d 100644--- a/backend/api/v1/subscription_service.go+++ b/backend/api/v1/subscription_service.go@@ -46,6 +46,9 @@ func (s *SubscriptionService) GetSubscription(ctx context.Context, _ *connect.Re// UpdateSubscription updates the subscription license.func (s *SubscriptionService) UpdateSubscription(ctx context.Context, req *connect.Request[v1pb.UpdateSubscriptionRequest]) (*connect.Response[v1pb.Subscription], error) {+ if s.profile.SaaS {+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("cannot update license in the SaaS mode"))+ }if err := s.licenseService.StoreLicense(ctx, req.Msg.License); err != nil {if common.ErrorCode(err) == common.Invalid {return nil, connect.NewError(connect.CodeInvalidArgument, err)diff --git a/backend/enterprise/license.go b/backend/enterprise/license.goindex de9a61501f..104492800f 100644--- a/backend/enterprise/license.go+++ b/backend/enterprise/license.go@@ -132,6 +132,11 @@ func (s *LicenseService) GetActivatedInstanceLimit(ctx context.Context) int {// GetUserLimit gets the user limit value for the plan.func (s *LicenseService) GetUserLimit(ctx context.Context) int {subscription := s.LoadSubscription(ctx)+ // Prefer to take values from the license first.+ if subscription.Seats > 0 {+ return int(subscription.Seats)+ }+limit := userLimitValues[subscription.Plan]if subscription.Plan == v1pb.PlanType_FREE {return limit@@ -149,6 +154,11 @@ func (s *LicenseService) GetUserLimit(ctx context.Context) int {// GetInstanceLimit gets the instance limit value for the plan.func (s *LicenseService) GetInstanceLimit(ctx context.Context) int {subscription := s.LoadSubscription(ctx)+ // Prefer to take values from the license first.+ if subscription.Instances > 0 {+ return int(subscription.Instances)+ }+limit := instanceLimitValues[subscription.Plan]if limit == -1 {// Enterprise license.diff --git a/frontend/src/views/SettingWorkspaceSubscription.vue b/frontend/src/views/SettingWorkspaceSubscription.vueindex c6dd6de71d..3ffea69442 100644--- a/frontend/src/views/SettingWorkspaceSubscription.vue+++ b/frontend/src/views/SettingWorkspaceSubscription.vue@@ -105,7 +105,11 @@</div></div><div- v-if="allowEdit && subscriptionStore.isSelfHostLicense"+ v-if="+ allowEdit &&+ subscriptionStore.isSelfHostLicense &&+ !actuatorStore.isSaaSMode+ "class="w-full mt-4 flex flex-col"><label class="flex items-center gap-x-2">