Documentation
¶
Index ¶
- Variables
- type AuthorizationCodeRepository
- type BunAuthorizationCodeRepository
- func (r *BunAuthorizationCodeRepository) Consume(ctx context.Context, codeHash string, clientID string, consumedAt time.Time) (*types.OAuthAuthorizationCode, error)
- func (r *BunAuthorizationCodeRepository) Create(ctx context.Context, code *types.OAuthAuthorizationCode) (*types.OAuthAuthorizationCode, error)
- func (r *BunAuthorizationCodeRepository) DeleteExpired(ctx context.Context, before time.Time) (int64, error)
- func (r *BunAuthorizationCodeRepository) GetByCodeHash(ctx context.Context, codeHash string) (*types.OAuthAuthorizationCode, error)
- func (r *BunAuthorizationCodeRepository) WithTx(tx bun.IDB) AuthorizationCodeRepository
- type BunConsentRepository
- func (r *BunConsentRepository) Create(ctx context.Context, consent *types.OAuthConsent) (*types.OAuthConsent, error)
- func (r *BunConsentRepository) GetActiveByUserAndClient(ctx context.Context, userID string, clientID string) (*types.OAuthConsent, error)
- func (r *BunConsentRepository) GetByID(ctx context.Context, id string) (*types.OAuthConsent, error)
- func (r *BunConsentRepository) ListActiveByUser(ctx context.Context, userID string) ([]*types.OAuthConsent, error)
- func (r *BunConsentRepository) Revoke(ctx context.Context, id string, revokedAt time.Time) (bool, error)
- func (r *BunConsentRepository) RevokeByClient(ctx context.Context, clientID string, revokedAt time.Time) (int64, error)
- func (r *BunConsentRepository) RevokeByUserAndClient(ctx context.Context, userID string, clientID string, revokedAt time.Time) (int64, error)
- func (r *BunConsentRepository) WithTx(tx bun.IDB) ConsentRepository
- type BunConsentRequestRepository
- func (r *BunConsentRequestRepository) Consume(ctx context.Context, requestHash string, consumedAt time.Time) (*types.OAuthConsentRequest, error)
- func (r *BunConsentRequestRepository) Create(ctx context.Context, request *types.OAuthConsentRequest) (*types.OAuthConsentRequest, error)
- func (r *BunConsentRequestRepository) DeleteExpired(ctx context.Context, before time.Time) (int64, error)
- func (r *BunConsentRequestRepository) GetByRequestHash(ctx context.Context, requestHash string) (*types.OAuthConsentRequest, error)
- func (r *BunConsentRequestRepository) WithTx(tx bun.IDB) ConsentRequestRepository
- type BunFlowStateRepository
- func (r *BunFlowStateRepository) Consume(ctx context.Context, stateHash string, provider string, purpose string, ...) (*types.OAuthFlowState, error)
- func (r *BunFlowStateRepository) Create(ctx context.Context, state *types.OAuthFlowState) (*types.OAuthFlowState, error)
- func (r *BunFlowStateRepository) DeleteExpired(ctx context.Context, before time.Time) (int64, error)
- func (r *BunFlowStateRepository) GetByStateHash(ctx context.Context, stateHash string) (*types.OAuthFlowState, error)
- func (r *BunFlowStateRepository) WithTx(tx bun.IDB) FlowStateRepository
- type BunLoginTransactionRepository
- func (r *BunLoginTransactionRepository) Consume(ctx context.Context, transactionHash string, consumedAt time.Time) (*types.OAuthLoginTransaction, error)
- func (r *BunLoginTransactionRepository) Create(ctx context.Context, transaction *types.OAuthLoginTransaction) (*types.OAuthLoginTransaction, error)
- func (r *BunLoginTransactionRepository) DeleteExpired(ctx context.Context, before time.Time) (int64, error)
- func (r *BunLoginTransactionRepository) GetByTransactionHash(ctx context.Context, transactionHash string) (*types.OAuthLoginTransaction, error)
- func (r *BunLoginTransactionRepository) MarkCompleted(ctx context.Context, transactionHash string, completedAt time.Time) (bool, error)
- func (r *BunLoginTransactionRepository) WithTx(tx bun.IDB) LoginTransactionRepository
- type BunOAuthClientRepository
- func (r *BunOAuthClientRepository) Create(ctx context.Context, client *types.OAuthClient) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) GetByClientID(ctx context.Context, clientID string) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) GetByClientIDIncludingDeleted(ctx context.Context, clientID string) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) GetByID(ctx context.Context, id string) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) GetByIDIncludingDeleted(ctx context.Context, id string) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) List(ctx context.Context, filter OAuthClientListFilter) ([]*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) SoftDelete(ctx context.Context, id string, deletedAt time.Time) (bool, error)
- func (r *BunOAuthClientRepository) Update(ctx context.Context, client *types.OAuthClient, expectedUpdatedAt *time.Time) (*types.OAuthClient, error)
- func (r *BunOAuthClientRepository) WithTx(tx bun.IDB) OAuthClientRepository
- type ConsentRepository
- type ConsentRequestRepository
- type FlowStateRepository
- type LoginTransactionRepository
- type OAuthClientCursor
- type OAuthClientListFilter
- type OAuthClientRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOAuthClientConflict = errors.New("oauth client was modified by another request")
ErrOAuthClientConflict is returned when an optimistic update does not match the stored updated_at value.
Functions ¶
This section is empty.
Types ¶
type AuthorizationCodeRepository ¶
type AuthorizationCodeRepository interface {
Create(ctx context.Context, code *types.OAuthAuthorizationCode) (*types.OAuthAuthorizationCode, error)
GetByCodeHash(ctx context.Context, codeHash string) (*types.OAuthAuthorizationCode, error)
Consume(ctx context.Context, codeHash string, clientID string, consumedAt time.Time) (*types.OAuthAuthorizationCode, error)
DeleteExpired(ctx context.Context, before time.Time) (int64, error)
WithTx(tx bun.IDB) AuthorizationCodeRepository
}
func NewBunAuthorizationCodeRepository ¶
func NewBunAuthorizationCodeRepository(db bun.IDB) AuthorizationCodeRepository
type BunAuthorizationCodeRepository ¶
type BunAuthorizationCodeRepository struct {
// contains filtered or unexported fields
}
func (*BunAuthorizationCodeRepository) Consume ¶
func (r *BunAuthorizationCodeRepository) Consume(ctx context.Context, codeHash string, clientID string, consumedAt time.Time) (*types.OAuthAuthorizationCode, error)
func (*BunAuthorizationCodeRepository) Create ¶
func (r *BunAuthorizationCodeRepository) Create(ctx context.Context, code *types.OAuthAuthorizationCode) (*types.OAuthAuthorizationCode, error)
func (*BunAuthorizationCodeRepository) DeleteExpired ¶
func (*BunAuthorizationCodeRepository) GetByCodeHash ¶
func (r *BunAuthorizationCodeRepository) GetByCodeHash(ctx context.Context, codeHash string) (*types.OAuthAuthorizationCode, error)
func (*BunAuthorizationCodeRepository) WithTx ¶
func (r *BunAuthorizationCodeRepository) WithTx(tx bun.IDB) AuthorizationCodeRepository
type BunConsentRepository ¶
type BunConsentRepository struct {
// contains filtered or unexported fields
}
func (*BunConsentRepository) Create ¶
func (r *BunConsentRepository) Create(ctx context.Context, consent *types.OAuthConsent) (*types.OAuthConsent, error)
func (*BunConsentRepository) GetActiveByUserAndClient ¶
func (r *BunConsentRepository) GetActiveByUserAndClient(ctx context.Context, userID string, clientID string) (*types.OAuthConsent, error)
func (*BunConsentRepository) GetByID ¶
func (r *BunConsentRepository) GetByID(ctx context.Context, id string) (*types.OAuthConsent, error)
func (*BunConsentRepository) ListActiveByUser ¶
func (r *BunConsentRepository) ListActiveByUser(ctx context.Context, userID string) ([]*types.OAuthConsent, error)
func (*BunConsentRepository) RevokeByClient ¶
func (*BunConsentRepository) RevokeByUserAndClient ¶
func (*BunConsentRepository) WithTx ¶
func (r *BunConsentRepository) WithTx(tx bun.IDB) ConsentRepository
type BunConsentRequestRepository ¶
type BunConsentRequestRepository struct {
// contains filtered or unexported fields
}
func (*BunConsentRequestRepository) Consume ¶
func (r *BunConsentRequestRepository) Consume(ctx context.Context, requestHash string, consumedAt time.Time) (*types.OAuthConsentRequest, error)
func (*BunConsentRequestRepository) Create ¶
func (r *BunConsentRequestRepository) Create(ctx context.Context, request *types.OAuthConsentRequest) (*types.OAuthConsentRequest, error)
func (*BunConsentRequestRepository) DeleteExpired ¶
func (*BunConsentRequestRepository) GetByRequestHash ¶
func (r *BunConsentRequestRepository) GetByRequestHash(ctx context.Context, requestHash string) (*types.OAuthConsentRequest, error)
func (*BunConsentRequestRepository) WithTx ¶
func (r *BunConsentRequestRepository) WithTx(tx bun.IDB) ConsentRequestRepository
type BunFlowStateRepository ¶
type BunFlowStateRepository struct {
// contains filtered or unexported fields
}
func (*BunFlowStateRepository) Create ¶
func (r *BunFlowStateRepository) Create(ctx context.Context, state *types.OAuthFlowState) (*types.OAuthFlowState, error)
func (*BunFlowStateRepository) DeleteExpired ¶
func (*BunFlowStateRepository) GetByStateHash ¶
func (r *BunFlowStateRepository) GetByStateHash(ctx context.Context, stateHash string) (*types.OAuthFlowState, error)
func (*BunFlowStateRepository) WithTx ¶
func (r *BunFlowStateRepository) WithTx(tx bun.IDB) FlowStateRepository
type BunLoginTransactionRepository ¶
type BunLoginTransactionRepository struct {
// contains filtered or unexported fields
}
func (*BunLoginTransactionRepository) Consume ¶
func (r *BunLoginTransactionRepository) Consume(ctx context.Context, transactionHash string, consumedAt time.Time) (*types.OAuthLoginTransaction, error)
func (*BunLoginTransactionRepository) Create ¶
func (r *BunLoginTransactionRepository) Create(ctx context.Context, transaction *types.OAuthLoginTransaction) (*types.OAuthLoginTransaction, error)
func (*BunLoginTransactionRepository) DeleteExpired ¶
func (*BunLoginTransactionRepository) GetByTransactionHash ¶
func (r *BunLoginTransactionRepository) GetByTransactionHash(ctx context.Context, transactionHash string) (*types.OAuthLoginTransaction, error)
func (*BunLoginTransactionRepository) MarkCompleted ¶
func (*BunLoginTransactionRepository) WithTx ¶
func (r *BunLoginTransactionRepository) WithTx(tx bun.IDB) LoginTransactionRepository
type BunOAuthClientRepository ¶
type BunOAuthClientRepository struct {
// contains filtered or unexported fields
}
func (*BunOAuthClientRepository) Create ¶
func (r *BunOAuthClientRepository) Create(ctx context.Context, client *types.OAuthClient) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) GetByClientID ¶
func (r *BunOAuthClientRepository) GetByClientID(ctx context.Context, clientID string) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) GetByClientIDIncludingDeleted ¶
func (r *BunOAuthClientRepository) GetByClientIDIncludingDeleted(ctx context.Context, clientID string) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) GetByID ¶
func (r *BunOAuthClientRepository) GetByID(ctx context.Context, id string) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) GetByIDIncludingDeleted ¶
func (r *BunOAuthClientRepository) GetByIDIncludingDeleted(ctx context.Context, id string) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) List ¶
func (r *BunOAuthClientRepository) List(ctx context.Context, filter OAuthClientListFilter) ([]*types.OAuthClient, error)
func (*BunOAuthClientRepository) SoftDelete ¶
func (*BunOAuthClientRepository) Update ¶
func (r *BunOAuthClientRepository) Update(ctx context.Context, client *types.OAuthClient, expectedUpdatedAt *time.Time) (*types.OAuthClient, error)
func (*BunOAuthClientRepository) WithTx ¶
func (r *BunOAuthClientRepository) WithTx(tx bun.IDB) OAuthClientRepository
type ConsentRepository ¶
type ConsentRepository interface {
Create(ctx context.Context, consent *types.OAuthConsent) (*types.OAuthConsent, error)
GetByID(ctx context.Context, id string) (*types.OAuthConsent, error)
GetActiveByUserAndClient(ctx context.Context, userID string, clientID string) (*types.OAuthConsent, error)
ListActiveByUser(ctx context.Context, userID string) ([]*types.OAuthConsent, error)
Revoke(ctx context.Context, id string, revokedAt time.Time) (bool, error)
RevokeByUserAndClient(ctx context.Context, userID string, clientID string, revokedAt time.Time) (int64, error)
RevokeByClient(ctx context.Context, clientID string, revokedAt time.Time) (int64, error)
WithTx(tx bun.IDB) ConsentRepository
}
func NewBunConsentRepository ¶
func NewBunConsentRepository(db bun.IDB) ConsentRepository
type ConsentRequestRepository ¶
type ConsentRequestRepository interface {
Create(ctx context.Context, request *types.OAuthConsentRequest) (*types.OAuthConsentRequest, error)
GetByRequestHash(ctx context.Context, requestHash string) (*types.OAuthConsentRequest, error)
Consume(ctx context.Context, requestHash string, consumedAt time.Time) (*types.OAuthConsentRequest, error)
DeleteExpired(ctx context.Context, before time.Time) (int64, error)
WithTx(tx bun.IDB) ConsentRequestRepository
}
func NewBunConsentRequestRepository ¶
func NewBunConsentRequestRepository(db bun.IDB) ConsentRequestRepository
type FlowStateRepository ¶
type FlowStateRepository interface {
Create(ctx context.Context, state *types.OAuthFlowState) (*types.OAuthFlowState, error)
GetByStateHash(ctx context.Context, stateHash string) (*types.OAuthFlowState, error)
Consume(ctx context.Context, stateHash string, provider string, purpose string, consumedAt time.Time) (*types.OAuthFlowState, error)
DeleteExpired(ctx context.Context, before time.Time) (int64, error)
WithTx(tx bun.IDB) FlowStateRepository
}
func NewBunFlowStateRepository ¶
func NewBunFlowStateRepository(db bun.IDB) FlowStateRepository
type LoginTransactionRepository ¶
type LoginTransactionRepository interface {
Create(ctx context.Context, transaction *types.OAuthLoginTransaction) (*types.OAuthLoginTransaction, error)
GetByTransactionHash(ctx context.Context, transactionHash string) (*types.OAuthLoginTransaction, error)
MarkCompleted(ctx context.Context, transactionHash string, completedAt time.Time) (bool, error)
Consume(ctx context.Context, transactionHash string, consumedAt time.Time) (*types.OAuthLoginTransaction, error)
DeleteExpired(ctx context.Context, before time.Time) (int64, error)
WithTx(tx bun.IDB) LoginTransactionRepository
}
func NewBunLoginTransactionRepository ¶
func NewBunLoginTransactionRepository(db bun.IDB) LoginTransactionRepository
type OAuthClientCursor ¶
OAuthClientCursor is the keyset position for client list pagination.
type OAuthClientListFilter ¶
type OAuthClientListFilter struct {
OwnerType string
OwnerID string
OrganizationID *string
IncludeDeleted bool
Limit int
Cursor *OAuthClientCursor
}
OAuthClientListFilter filters and paginates client listings.
type OAuthClientRepository ¶
type OAuthClientRepository interface {
Create(ctx context.Context, client *types.OAuthClient) (*types.OAuthClient, error)
GetByID(ctx context.Context, id string) (*types.OAuthClient, error)
GetByIDIncludingDeleted(ctx context.Context, id string) (*types.OAuthClient, error)
GetByClientID(ctx context.Context, clientID string) (*types.OAuthClient, error)
GetByClientIDIncludingDeleted(ctx context.Context, clientID string) (*types.OAuthClient, error)
List(ctx context.Context, filter OAuthClientListFilter) ([]*types.OAuthClient, error)
Update(ctx context.Context, client *types.OAuthClient, expectedUpdatedAt *time.Time) (*types.OAuthClient, error)
SoftDelete(ctx context.Context, id string, deletedAt time.Time) (bool, error)
WithTx(tx bun.IDB) OAuthClientRepository
}
func NewBunOAuthClientRepository ¶
func NewBunOAuthClientRepository(db bun.IDB) OAuthClientRepository
Click to show internal directories.
Click to hide internal directories.