Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredential = fmt.Errorf("vault: invalid credential: %w", commonerrors.ErrValidation) ErrNotFound = fmt.Errorf("vault: credential not found: %w", commonerrors.ErrNotFound) )
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
ID ids.VaultID
GatewayID ids.GatewayID
PrincipalSub string
Provider string
AccountRef string
AccessToken string
RefreshToken string
Scopes []string
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
func NewCredential ¶
type Repository ¶
type Repository interface {
Upsert(ctx context.Context, c *Credential) error
Find(ctx context.Context, gatewayID ids.GatewayID, principalSub, provider string) (*Credential, error)
ListByPrincipal(ctx context.Context, gatewayID ids.GatewayID, principalSub string) ([]*Credential, error)
Delete(ctx context.Context, gatewayID ids.GatewayID, principalSub, provider string) error
}
Click to show internal directories.
Click to hide internal directories.