account

package
v0.19.1237 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEvaluationJourney

func DefaultEvaluationJourney(completionSource string) app.UserJourneys

DefaultEvaluationJourney returns the evaluation journey for self-signup users This is the 6-step journey: account_created, org_created, cli_installed, app_created, app_synced, install_created

func DefaultEvaluationJourneyWithAttribution

func DefaultEvaluationJourneyWithAttribution(attribution map[string]interface{}, completionSource string) app.UserJourneys

DefaultEvaluationJourneyWithAttribution returns the evaluation journey with attribution data stored in the account_created step's metadata. This enables tracking marketing source for ROI analysis.

func NoUserJourneys

func NoUserJourneys() app.UserJourneys

NoUserJourneys returns an empty journey slice for invited/support users

func RevokeDerivedCredentials added in v0.19.1236

func RevokeDerivedCredentials(tx *gorm.DB, sourceType app.TokenSourceType, sourceIDs []string) error

func ServiceAccountEmail

func ServiceAccountEmail(id string) string

Types

type Client

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

func New

func New(params Params) *Client

func (*Client) CreateAccount

func (m *Client) CreateAccount(ctx context.Context, email, subject string, userJourneys app.UserJourneys) (*app.Account, error)

func (*Client) CreateAuthAccount

func (m *Client) CreateAuthAccount(ctx context.Context, email, subject string, userJourneys app.UserJourneys) (*app.Account, error)

func (*Client) CreateServiceAccount

func (c *Client) CreateServiceAccount(ctx context.Context, svcAcctID, name string) (*app.Account, error)

func (*Client) CreateToken

func (c *Client) CreateToken(ctx context.Context, subjectOrEmail string, dur time.Duration) (*app.Token, error)

func (*Client) DeleteInstallStackServiceAccounts added in v0.19.1149

func (c *Client) DeleteInstallStackServiceAccounts(ctx context.Context, installID string) error

DeleteInstallStackServiceAccounts removes the stack accounts for an install's stacks. Must run before the install row is deleted: the account is tied to the stack by naming convention, not a foreign key, so nothing cascades to it and the IDs are unrecoverable afterwards.

func (*Client) DeleteServiceAccount added in v0.19.1149

func (c *Client) DeleteServiceAccount(ctx context.Context, svcAcctID string) error

DeleteServiceAccount removes an account's role bindings, stack roles, tokens, and the row itself. A missing account is success — delete workflows retry.

func (*Client) EnsureServiceAccount added in v0.19.1101

func (c *Client) EnsureServiceAccount(ctx context.Context, svcAcctID, name string) (*app.Account, error)

EnsureServiceAccount returns the service account for svcAcctID, creating it if it does not exist yet. CreateServiceAccount is a bare insert that conflicts on the unique email, so callers that may run against entities predating service-account creation need this instead.

func (*Client) ExtendToken

func (c *Client) ExtendToken(ctx context.Context, subjectOrEmail string, dur time.Duration) error

func (*Client) FetchAccount

func (m *Client) FetchAccount(ctx context.Context, acctID string) (*app.Account, error)

TODO(jm): this entire file should probably live in `pkg/account`

func (*Client) FindAccount

func (c *Client) FindAccount(ctx context.Context, emailOrSubjectOrID string) (*app.Account, error)

func (*Client) InvalidateOldTokens added in v0.19.770

func (c *Client) InvalidateOldTokens(ctx context.Context, subjectOrEmail string) (int64, error)

func (*Client) InvalidateTokens

func (c *Client) InvalidateTokens(ctx context.Context, subjectOrEmail string) error

func (*Client) RevokeToken added in v0.19.1236

func (c *Client) RevokeToken(ctx context.Context, tokenID string) error

type Params

type Params struct {
	fx.In

	Cfg             *internal.Config
	AnalyticsClient analytics.Writer
	DB              *gorm.DB `name:"psql"`
	V               *validator.Validate
	AuthzClient     *authz.Client
}

Jump to

Keyboard shortcuts

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