Add new flags to modules to replace isTeam (#39695)

* Add new flags to modules

* Add deprecated comments to isTeam

* Make support flag an enum

* Add a TODO instead of deprecating flag right away

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add gogoproto.jsontag to new fields

* remove meaning from enum zero value

* Reuse proto.SupportType instead of suping

* Update proto file: rename enum 0 value to unspecified;fix json tag casing

* Reuse proto file instead of aliasing it

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
This commit is contained in:
matheus
2024-03-22 17:27:59 +00:00
committed by GitHub
co-authored by Alan Parra
parent 6b791738f4
commit fad473a236
4 changed files with 1229 additions and 880 deletions
File diff suppressed because it is too large Load Diff
@@ -436,6 +436,15 @@ enum ProductType {
PRODUCT_TYPE_EUB = 2;
}
// SupportType if the type of support offered.
enum SupportType {
SUPPORT_TYPE_UNSPECIFIED = 0;
// SUPPORT_TYPE_FREE is the free tier support
SUPPORT_TYPE_FREE = 1;
// SUPPORT_TYPE_PREMIUM is the premium tier support
SUPPORT_TYPE_PREMIUM = 2;
}
// Features are auth server features.
message Features {
// Kubernetes enables Kubernetes Access product
@@ -507,6 +516,18 @@ message Features {
// Policy enables the Teleport Policy feature set.
// At the time of writing, this includes Teleport Access Graph (TAG).
PolicyFeature Policy = 28 [(gogoproto.jsontag) = "policy,omitempty"];
// Questionnaire indicates whether cluster users should get an onboarding questionnaire
bool Questionnaire = 29 [(gogoproto.jsontag) = "questionnaire,omitempty"];
// IsStripeManaged indicates if the cluster billing is managed via Stripe
bool IsStripeManaged = 30 [(gogoproto.jsontag) = "is_stripe_managed,omitempty"];
// ExternalAuditStorage indicates whether the EAS feature is enabled in the cluster.
bool ExternalAuditStorage = 31 [(gogoproto.jsontag) = "external_audit_storage,omitempty"];
// SupportType indicates the type of the customer's support
SupportType SupportType = 32 [(gogoproto.jsontag) = "support_type,omitempty"];
// JoinActiveSessions indicates whether joining active sessions via web UI is enabled
bool JoinActiveSessions = 33 [(gogoproto.jsontag) = "join_active_sessions,omitempty"];
// MobileDeviceManagement indicates whether endpoint management (like Jamf Plugin) can be used in the cluster
bool MobileDeviceManagement = 34 [(gogoproto.jsontag) = "mobile_device_management,omitempty"];
}
// DeviceTrustFeature holds the Device Trust feature general and usage-based
+27 -6
View File
@@ -110,6 +110,18 @@ type Features struct {
// Policy holds settings for the Teleport Policy feature set.
// At the time of writing, this includes Teleport Access Graph (TAG).
Policy PolicyFeature
// Questionnaire indicates whether cluster users should get an onboarding questionnaire
Questionnaire bool
// IsStripeManaged indicates if the cluster billing is managed via Stripe
IsStripeManaged bool
// ExternalAuditStorage indicates whether the EAS feature is enabled in the cluster.
ExternalAuditStorage bool
// SupportType indicates the type of customer's support
SupportType proto.SupportType
// JoinActiveSessions indicates whether joining active sessions via web UI is enabled
JoinActiveSessions bool
// MobileDeviceManagement indicates whether endpoints management (like Jamf Plugin) can be used in the cluster
MobileDeviceManagement bool
}
// DeviceTrustFeature holds the Device Trust feature general and usage-based
@@ -199,6 +211,12 @@ func (f Features) ToProto() *proto.Features {
Policy: &proto.PolicyFeature{
Enabled: f.Policy.Enabled,
},
Questionnaire: f.Questionnaire,
IsStripeManaged: f.IsStripeManaged,
ExternalAuditStorage: f.ExternalAuditStorage,
SupportType: f.SupportType,
JoinActiveSessions: f.JoinActiveSessions,
MobileDeviceManagement: f.MobileDeviceManagement,
}
}
@@ -225,6 +243,7 @@ func (f Features) IGSEnabled() bool {
return f.IdentityGovernanceSecurity
}
// TODO(mcbattirola): Deprecate IsTeam once it's unused.
func (f Features) IsTeam() bool {
return f.ProductType == ProductTypeTeam
}
@@ -357,12 +376,14 @@ func (p *defaultModules) Features() Features {
})
return Features{
Kubernetes: true,
DB: true,
App: true,
Desktop: true,
AutomaticUpgrades: p.automaticUpgrades,
Assist: true,
Kubernetes: true,
DB: true,
App: true,
Desktop: true,
AutomaticUpgrades: p.automaticUpgrades,
Assist: true,
JoinActiveSessions: true,
SupportType: proto.SupportType_SUPPORT_TYPE_FREE,
}
}
+4 -1
View File
@@ -54,7 +54,10 @@ const cfg = {
isUsageBasedBilling: false,
hideInaccessibleFeatures: false,
customTheme: '',
// isTeam is true if [Features.ProductType] == Team
/**
* isTeam is true if [Features.ProductType] == Team
* @deprecated use other flags do determine cluster features istead of relying on isTeam
*/
isTeam: false,
// isIgsEnabled refers to Identity Governance & Security product.
// It refers to a group of features: access request, device trust,