productfeatures

package
v0.0.0-...-4aceb60 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(mux goahttp.Muxer, service *Service)

func FeatureCacheKey

func FeatureCacheKey(organizationID string, feature Feature) string

Types

type Client

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

func NewClient

func NewClient(logger *slog.Logger, tracerProvider trace.TracerProvider, db *pgxpool.Pool, redisClient *redis.Client) *Client

func (*Client) IsFeatureEnabled

func (c *Client) IsFeatureEnabled(ctx context.Context, organizationID string, feature Feature) (bool, error)

func (*Client) PlatformFeatureCheck

func (c *Client) PlatformFeatureCheck(ctx context.Context, organizationID string, feature string) bool

PlatformFeatureCheck adapts IsFeatureEnabled to the platformtools.FeatureChecker signature so it can gate platform-tool dispatch. Errors degrade to "disabled" so a transient lookup failure does not silently grant access; the underlying error is logged for ops.

func (*Client) UpdateFeatureCache

func (c *Client) UpdateFeatureCache(ctx context.Context, organizationID string, feature Feature, enabled bool)

UpdateFeatureCache stores the given enabled state for the feature directly into the cache. Call this after writing the feature flag to the database from a code path that bypasses this client, so the cache stays consistent.

type Feature

type Feature string
const (
	FeatureLogs                  Feature = "logs"
	FeatureToolIOLogs            Feature = "tool_io_logs"
	FeatureRBAC                  Feature = "rbac"
	FeatureSessionCapture        Feature = "session_capture"
	FeatureAuthzChallengeLogging Feature = "authz_challenge_logging"
	FeatureWebhooks              Feature = "webhooks"
)

type FeatureCache

type FeatureCache struct {
	OrganizationID string
	Feature        Feature
	Enabled        bool
}

func (FeatureCache) AdditionalCacheKeys

func (c FeatureCache) AdditionalCacheKeys() []string

func (FeatureCache) CacheKey

func (f FeatureCache) CacheKey() string

func (FeatureCache) TTL

func (f FeatureCache) TTL() time.Duration

type OpenRouterKeyRefresher

type OpenRouterKeyRefresher interface {
	ScheduleOpenRouterKeyRefresh(ctx context.Context, orgID string) error
	CancelOpenRouterKeyRefreshWorkflow(ctx context.Context, orgID string) error
}

OpenRouterKeyRefresher defines the interface for managing openrouter key refresh workflows

type Service

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

Service implements organization feature management operations.

func NewService

func NewService(
	logger *slog.Logger,
	tracerProvider trace.TracerProvider,
	db *pgxpool.Pool,
	sessions *sessions.Manager,
	redisClient *redis.Client,
	authzEngine *authz.Engine,
) *Service

func (*Service) APIKeyAuth

func (s *Service) APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)

func (*Service) GetProductFeatures

func (s *Service) GetProductFeatures(ctx context.Context, payload *gen.GetProductFeaturesPayload) (*gen.GetProductFeaturesResult, error)

func (*Service) SetProductFeature

func (s *Service) SetProductFeature(ctx context.Context, payload *gen.SetProductFeaturePayload) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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