Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,672 changes: 859 additions & 813 deletions api/client/proto/authservice.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/client/webclient/webconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type WebConfig struct {
// The web UI for dashboards provides functionality for downloading self-hosted licenses and
// Teleport Enterprise binaries.
IsDashboard bool `json:"isDashboard,omitempty"`
// IsUsageBasedBilling determines if the cloud user subscription is usage-based (pay-as-you-go).
IsUsageBasedBilling bool `json:"isUsageBasedBilling,omitempty"`
}

// UIConfig provides config options for the web UI served by the proxy service.
Expand Down
2 changes: 2 additions & 0 deletions api/proto/teleport/legacy/client/proto/authservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ message Features {
bool Plugins = 15 [(gogoproto.jsontag) = "plugins"];
// AutomaticUpgrades enables Automatic Upgrades for the agents/services.
bool AutomaticUpgrades = 16 [(gogoproto.jsontag) = "automatic_upgrades"];
// IsUsageBased enables some usage-based billing features
bool IsUsageBased = 17 [(gogoproto.jsontag) = "is_usage_based"];
}

// DeleteUserRequest is the input value for the DeleteUser method.
Expand Down
3 changes: 3 additions & 0 deletions lib/modules/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ type Features struct {
Plugins bool
// AutomaticUpgrades enables automatic upgrades of agents/services.
AutomaticUpgrades bool
// IsUsageBasedBilling enables some usage-based billing features
IsUsageBasedBilling bool
}

// ToProto converts Features into proto.Features
Expand All @@ -84,6 +86,7 @@ func (f Features) ToProto() *proto.Features {
RecoveryCodes: f.RecoveryCodes,
Plugins: f.Plugins,
AutomaticUpgrades: f.AutomaticUpgrades,
IsUsageBased: f.IsUsageBasedBilling,
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ func (h *Handler) getWebConfig(w http.ResponseWriter, r *http.Request, p httprou
RecoveryCodesEnabled: h.ClusterFeatures.GetRecoveryCodes(),
UI: h.getUIConfig(r.Context()),
IsDashboard: isDashboard(h.ClusterFeatures),
IsUsageBasedBilling: h.ClusterFeatures.GetIsUsageBased(),
}

resource, err := h.cfg.ProxyClient.GetClusterName()
Expand Down
3 changes: 2 additions & 1 deletion web/packages/teleport/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const cfg = {
isEnterprise: false,
isCloud: false,
isDashboard: false,
isUsageBasedBilling: false,
tunnelPublicAddress: '',
recoveryCodesEnabled: false,
// IsUsageBasedBilling determines if the user subscription is usage-based (pay-as-you-go).
isUsageBasedBilling: false,

configDir: '$HOME/.config',

Expand Down