Documentation
¶
Index ¶
- Constants
- func IsAuthError(err error) bool
- type AuthConfig
- type AuthService
- func (s *AuthService) CompleteOIDCLogin(ctx context.Context, code, nonce string) (*core.User, error)
- func (s *AuthService) CookieSecure() bool
- func (s *AuthService) CreateAPIKey(ctx context.Context, name, description, environmentID string) (*CreatedAPIKey, error)
- func (s *AuthService) CreateSession(ctx context.Context, userID string) (string, time.Time, error)
- func (s *AuthService) Enabled() bool
- func (s *AuthService) ListAPIKeys(ctx context.Context) ([]*core.APIKey, error)
- func (s *AuthService) LoginURL(state, nonce string) (string, error)
- func (s *AuthService) LoginWithPassword(ctx context.Context, email, password string) (*core.User, error)
- func (s *AuthService) Mode() string
- func (s *AuthService) OIDCEnabled() bool
- func (s *AuthService) PasswordEnabled() bool
- func (s *AuthService) RevokeAPIKey(ctx context.Context, id string) error
- func (s *AuthService) RevokeSession(ctx context.Context, token string) error
- func (s *AuthService) SessionTTL() time.Duration
- func (s *AuthService) UserForSessionToken(ctx context.Context, token string) (*core.User, error)
- func (s *AuthService) ValidateAPIKey(ctx context.Context, token string) (*core.APIKey, error)
- type ContextService
- func (s *ContextService) CreateContext(ctx context.Context, c *core.ContextSchema) (*core.ContextSchema, error)
- func (s *ContextService) DeleteContext(ctx context.Context, id string) error
- func (s *ContextService) GetContext(ctx context.Context, id string) (*core.ContextSchema, error)
- func (s *ContextService) ListContexts(ctx context.Context) ([]*core.ContextSchema, error)
- func (s *ContextService) UpdateContext(ctx context.Context, c *core.ContextSchema) (*core.ContextSchema, error)
- type CreatedAPIKey
- type EnvironmentService
- func (s *EnvironmentService) Create(ctx context.Context, env *core.Environment) error
- func (s *EnvironmentService) Default(ctx context.Context) (*core.Environment, error)
- func (s *EnvironmentService) Delete(ctx context.Context, id string) error
- func (s *EnvironmentService) Get(ctx context.Context, id string) (*core.Environment, error)
- func (s *EnvironmentService) List(ctx context.Context) ([]*core.Environment, error)
- func (s *EnvironmentService) Update(ctx context.Context, env *core.Environment) error
- type EvalService
- func (s *EvalService) Definitions(ctx context.Context, environmentID string) (evalcore.Definitions, string, error)
- func (s *EvalService) DefinitionsETag() string
- func (s *EvalService) Evaluate(ctx context.Context, environmentID, key string, user evalcore.DataContext) (core.FlagValue, error)
- func (s *EvalService) EvaluateAll(ctx context.Context, environmentID string, user evalcore.DataContext) (map[string]core.FlagValue, error)
- func (s *EvalService) EvaluateWithTrace(ctx context.Context, environmentID, key string, user evalcore.DataContext) (evalcore.EvaluationTrace, error)
- func (s *EvalService) InvalidateContext(id string)
- func (s *EvalService) InvalidateFlag(environmentID, key string)
- type FlagService
- func (s *FlagService) CreateFlag(ctx context.Context, environmentID string, flag *core.FlagConfig) error
- func (s *FlagService) DeleteFlag(context context.Context, environmentID, id string) error
- func (s *FlagService) GetFlag(ctx context.Context, environmentID, key string) (*core.FlagConfig, error)
- func (s *FlagService) GetFlagHistory(ctx context.Context, environmentID, key string) ([]*core.AuditEntry, error)
- func (s *FlagService) GetFlags(ctx context.Context, environmentID string) ([]*core.FlagConfig, error)
- type OIDCUserInfo
- type RuleService
- func (s *RuleService) CreateRule(ctx context.Context, environmentID, flagKey string, rule core.Rule) (*core.Rule, error)
- func (s *RuleService) DeleteRule(ctx context.Context, environmentID, flagKey, ruleID string) error
- func (s *RuleService) GetRule(ctx context.Context, environmentID, flagKey, ruleID string) (*core.Rule, error)
- func (s *RuleService) ListRules(ctx context.Context, environmentID, flagKey string) ([]core.Rule, error)
- func (s *RuleService) ReorderRules(ctx context.Context, environmentID, flagKey string, ruleIDs []string) error
- func (s *RuleService) UpdateRule(ctx context.Context, environmentID, flagKey string, rule core.Rule) (*core.Rule, error)
Constants ¶
View Source
const ( SessionCookieName = "flagcel_session" OAuthStateCookieName = "flagcel_oauth_state" OAuthNonceCookieName = "flagcel_oauth_nonce" )
Variables ¶
This section is empty.
Functions ¶
func IsAuthError ¶
Types ¶
type AuthConfig ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(ctx context.Context, cfg AuthConfig, store *postgres.Store) (*AuthService, error)
func (*AuthService) CompleteOIDCLogin ¶
func (*AuthService) CookieSecure ¶
func (s *AuthService) CookieSecure() bool
func (*AuthService) CreateAPIKey ¶
func (s *AuthService) CreateAPIKey(ctx context.Context, name, description, environmentID string) (*CreatedAPIKey, error)
func (*AuthService) CreateSession ¶
func (*AuthService) Enabled ¶
func (s *AuthService) Enabled() bool
func (*AuthService) ListAPIKeys ¶
func (*AuthService) LoginWithPassword ¶
func (*AuthService) Mode ¶
func (s *AuthService) Mode() string
func (*AuthService) OIDCEnabled ¶
func (s *AuthService) OIDCEnabled() bool
func (*AuthService) PasswordEnabled ¶
func (s *AuthService) PasswordEnabled() bool
func (*AuthService) RevokeAPIKey ¶
func (s *AuthService) RevokeAPIKey(ctx context.Context, id string) error
func (*AuthService) RevokeSession ¶
func (s *AuthService) RevokeSession(ctx context.Context, token string) error
func (*AuthService) SessionTTL ¶
func (s *AuthService) SessionTTL() time.Duration
func (*AuthService) UserForSessionToken ¶
func (*AuthService) ValidateAPIKey ¶
type ContextService ¶
type ContextService struct {
// contains filtered or unexported fields
}
func NewContextService ¶
func NewContextService(store *postgres.Store, onContextChange ...func(string)) *ContextService
func (*ContextService) CreateContext ¶
func (s *ContextService) CreateContext(ctx context.Context, c *core.ContextSchema) (*core.ContextSchema, error)
func (*ContextService) DeleteContext ¶
func (s *ContextService) DeleteContext(ctx context.Context, id string) error
func (*ContextService) GetContext ¶
func (s *ContextService) GetContext(ctx context.Context, id string) (*core.ContextSchema, error)
func (*ContextService) ListContexts ¶
func (s *ContextService) ListContexts(ctx context.Context) ([]*core.ContextSchema, error)
func (*ContextService) UpdateContext ¶
func (s *ContextService) UpdateContext(ctx context.Context, c *core.ContextSchema) (*core.ContextSchema, error)
type CreatedAPIKey ¶
type EnvironmentService ¶
type EnvironmentService struct {
// contains filtered or unexported fields
}
func NewEnvironmentService ¶
func NewEnvironmentService(store *postgres.Store) *EnvironmentService
func (*EnvironmentService) Create ¶
func (s *EnvironmentService) Create(ctx context.Context, env *core.Environment) error
func (*EnvironmentService) Default ¶
func (s *EnvironmentService) Default(ctx context.Context) (*core.Environment, error)
func (*EnvironmentService) Delete ¶
func (s *EnvironmentService) Delete(ctx context.Context, id string) error
func (*EnvironmentService) Get ¶
func (s *EnvironmentService) Get(ctx context.Context, id string) (*core.Environment, error)
func (*EnvironmentService) List ¶
func (s *EnvironmentService) List(ctx context.Context) ([]*core.Environment, error)
func (*EnvironmentService) Update ¶
func (s *EnvironmentService) Update(ctx context.Context, env *core.Environment) error
type EvalService ¶
type EvalService struct {
// contains filtered or unexported fields
}
func NewEvalService ¶
func NewEvalService(store *postgres.Store, eng *evalcore.Engine) *EvalService
func (*EvalService) Definitions ¶
func (s *EvalService) Definitions(ctx context.Context, environmentID string) (evalcore.Definitions, string, error)
func (*EvalService) DefinitionsETag ¶
func (s *EvalService) DefinitionsETag() string
func (*EvalService) Evaluate ¶
func (s *EvalService) Evaluate(ctx context.Context, environmentID, key string, user evalcore.DataContext) (core.FlagValue, error)
func (*EvalService) EvaluateAll ¶
func (s *EvalService) EvaluateAll(ctx context.Context, environmentID string, user evalcore.DataContext) (map[string]core.FlagValue, error)
func (*EvalService) EvaluateWithTrace ¶
func (s *EvalService) EvaluateWithTrace(ctx context.Context, environmentID, key string, user evalcore.DataContext) (evalcore.EvaluationTrace, error)
func (*EvalService) InvalidateContext ¶
func (s *EvalService) InvalidateContext(id string)
func (*EvalService) InvalidateFlag ¶
func (s *EvalService) InvalidateFlag(environmentID, key string)
type FlagService ¶
type FlagService struct {
// contains filtered or unexported fields
}
func NewFlagService ¶
func NewFlagService(store *postgres.Store, onFlagChange ...func(string, string)) *FlagService
func (*FlagService) CreateFlag ¶
func (s *FlagService) CreateFlag(ctx context.Context, environmentID string, flag *core.FlagConfig) error
func (*FlagService) DeleteFlag ¶
func (s *FlagService) DeleteFlag(context context.Context, environmentID, id string) error
func (*FlagService) GetFlag ¶
func (s *FlagService) GetFlag(ctx context.Context, environmentID, key string) (*core.FlagConfig, error)
func (*FlagService) GetFlagHistory ¶
func (s *FlagService) GetFlagHistory(ctx context.Context, environmentID, key string) ([]*core.AuditEntry, error)
func (*FlagService) GetFlags ¶
func (s *FlagService) GetFlags(ctx context.Context, environmentID string) ([]*core.FlagConfig, error)
type OIDCUserInfo ¶
type RuleService ¶
type RuleService struct {
// contains filtered or unexported fields
}
func NewRuleService ¶
func NewRuleService(store *postgres.Store, onFlagChange ...func(string, string)) *RuleService
func (*RuleService) CreateRule ¶
func (*RuleService) DeleteRule ¶
func (s *RuleService) DeleteRule(ctx context.Context, environmentID, flagKey, ruleID string) error
func (*RuleService) ReorderRules ¶
Click to show internal directories.
Click to hide internal directories.