enterprise

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](registry *Registry, key Key) (T, error)

Get returns the implementation registered for key. Go has no generic methods, so this is a function. A missing key or a value of the wrong type is an error.

Types

type BillingOperations

type BillingOperations interface {
	DescribeOrganizationWorkspaceUsage(ctx context.Context, orgID string, req *pb.DescribeOrganizationWorkspaceUsageRequest) (*pb.DescribeOrganizationWorkspaceUsageResponse, error)
	DescribeOrganizationSpendingReport(ctx context.Context,
		orgID string,
		req *pb.DescribeOrganizationSpendingReportRequest) (*pb.DescribeOrganizationSpendingReportResponse, error)
	ListHostedCreditProducts(ctx context.Context,
		orgID string,
		req *pb.ListHostedCreditProductsRequest) (*pb.ListHostedCreditProductsResponse, error)
	QuoteHostedCreditCheckout(ctx context.Context,
		orgID string,
		req *pb.QuoteHostedCreditCheckoutRequest) (*pb.QuoteHostedCreditCheckoutResponse, error)
	CreateHostedCreditCheckout(ctx context.Context,
		orgID string,
		req *pb.CreateHostedCreditCheckoutRequest,
		accountID string,
		baseURL string) (*pb.CreateHostedCreditCheckoutResponse, error)
	CreateBillingPortalSession(ctx context.Context,
		orgID string,
		req *pb.CreateBillingPortalSessionRequest) (*pb.CreateBillingPortalSessionResponse, error)
	ListOrganizationCreditGrants(ctx context.Context,
		orgID string,
		req *pb.ListOrganizationCreditGrantsRequest) (*pb.ListOrganizationCreditGrantsResponse, error)
	DescribeOrganizationBilling(ctx context.Context,
		orgID string,
		req *pb.DescribeOrganizationBillingRequest) (*pb.DescribeOrganizationBillingResponse, error)
	CreateBusinessCheckout(ctx context.Context,
		orgID string,
		req *pb.CreateBusinessCheckoutRequest,
		accountID string,
		baseURL string) (*pb.CreateBusinessCheckoutResponse, error)
	SelectBillingPlan(ctx context.Context, orgID string, req *pb.SelectBillingPlanRequest, accountID, baseURL string) (*pb.CreateBusinessCheckoutResponse, error)
	CreatePaymentMethodSession(ctx context.Context, orgID string, req *pb.CreatePaymentMethodSessionRequest, accountID string) (*pb.CreateBillingPortalSessionResponse, error)
	PreviewSeatPurchase(ctx context.Context, orgID string, req *pb.PreviewSeatPurchaseRequest) (*pb.PreviewSeatPurchaseResponse, error)
	PurchaseSeats(ctx context.Context, orgID string, req *pb.PurchaseSeatsRequest, userID string) (*pb.PurchaseSeatsResponse, error)
	SyncOrganizationBilling(ctx context.Context,
		orgID string,
		req *pb.SyncOrganizationBillingRequest) (*pb.DescribeOrganizationBillingResponse, error)
	CancelOrganizationSubscription(ctx context.Context,
		orgID string,
		req *pb.CancelOrganizationSubscriptionRequest) (*pb.DescribeOrganizationBillingResponse, error)
	ResumeOrganizationSubscription(ctx context.Context,
		orgID string,
		req *pb.ResumeOrganizationSubscriptionRequest) (*pb.DescribeOrganizationBillingResponse, error)
}

BillingOperations implements organization billing RPCs. Billing source is covered by the Enterprise license; operations do not require a runtime license.

type Key

type Key string

Key names an Enterprise capability. It is not a license feature. One capability can check several license features.

const (
	// RBAC is the custom role and group implementation. The license features
	// custom_roles and groups are checked inside that implementation.
	RBAC Key = "rbac"

	// Billing is the backend billing capability. It has no runtime license check.
	Billing Key = "billing"
)

type Rbac

type Rbac interface {
	CreateRole(ctx context.Context, domainType, domainID string, role *pbRoles.Role) (*pbRoles.CreateRoleResponse, error)
	UpdateRole(ctx context.Context, domainType, domainID, roleName string, spec *pbRoles.Role_Spec) (*pbRoles.UpdateRoleResponse, error)
	CreateGroup(ctx context.Context, domainType, domainID string, group *pbGroups.Group) (*pbGroups.CreateGroupResponse, error)
	UpdateGroup(ctx context.Context, domainType, domainID, groupName string, spec *pbGroups.Group_Spec) (*pbGroups.UpdateGroupResponse, error)
	AddUserToGroup(ctx context.Context, orgID, domainType, domainID, userID, userEmail, groupName string) (*pbGroups.AddUserToGroupResponse, error)
}

Rbac creates and changes custom roles and groups. The implementation is in ee/rbac under the SuperPlane Enterprise license. Operations that only remove access, such as deleting a role or a group, stay in the Community code so that administrators can always revoke access.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maps a capability name to the code that implements it. Callers resolve an implementation with Get. This is the same lookup shape as pkg/registry, which returns an action or a trigger by name.

func NewRegistry

func NewRegistry() *Registry

NewRegistry registers Community implementations for licensed capabilities. Billing stays unbound until the server installs its implementation.

func (*Registry) Register

func (r *Registry) Register(key Key, implementation any)

Register stores the implementation for a capability. A later registration replaces the previous one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL