sql

package
v0.0.0-...-9637607 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransactionOpen   = errors.New("There is already a transaction in this context.")
	ErrNoTransactionOpen = errors.New("There is no transaction in this context.")
)

Functions

func BytesToString

func BytesToString(data []byte) string

Types

type Dependencies

type Dependencies interface {
	ClientHasher() fosite.Hasher
	KeyCipher() *jwk.AEAD
	helpers.RegistryLogger
	helpers.TracingProvider
}

type OAuth2RequestSQL

type OAuth2RequestSQL struct {
	ID                string         `db:"signature"`
	Request           string         `db:"request_id"`
	ConsentChallenge  sql.NullString `db:"challenge_id"`
	RequestedAt       time.Time      `db:"requested_at"`
	Client            string         `db:"client_id"`
	Scopes            string         `db:"scope"`
	GrantedScope      string         `db:"granted_scope"`
	RequestedAudience string         `db:"requested_audience"`
	GrantedAudience   string         `db:"granted_audience"`
	Form              string         `db:"form_data"`
	Subject           string         `db:"subject"`
	Active            bool           `db:"active"`
	Session           []byte         `db:"session_data"`
	Table             tableName      `db:"-"`
}

func (OAuth2RequestSQL) TableName

func (r OAuth2RequestSQL) TableName() string

type OldMigrationRecord

type OldMigrationRecord struct {
	ID        string    `db:"id"`
	AppliedAt time.Time `db:"applied_at"`
}

this type is copied from sql-migrate to remove the dependency

type Persister

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

func NewPersister

func NewPersister(ctx context.Context, c *pop.Connection, r Dependencies, config *config.Provider, l *logrusx.Logger) (*Persister, error)

func (*Persister) AcceptLogoutRequest

func (p *Persister) AcceptLogoutRequest(ctx context.Context, challenge string) (*consent.LogoutRequest, error)

func (*Persister) AddKey

func (p *Persister) AddKey(ctx context.Context, set string, key *jose.JSONWebKey) error

func (*Persister) AddKeySet

func (p *Persister) AddKeySet(ctx context.Context, set string, keys *jose.JSONWebKeySet) error

func (*Persister) Authenticate

func (p *Persister) Authenticate(ctx context.Context, id string, secret []byte) (*models.Client, error)

func (*Persister) BeginTX

func (p *Persister) BeginTX(ctx context.Context) (context.Context, error)

func (*Persister) ClientAssertionJWTValid

func (p *Persister) ClientAssertionJWTValid(ctx context.Context, jti string) error

func (*Persister) Commit

func (p *Persister) Commit(ctx context.Context) error

func (*Persister) ConfirmLoginSession

func (p *Persister) ConfirmLoginSession(ctx context.Context, id string, authenticatedAt time.Time, subject string, remember bool) error

func (*Persister) Connection

func (p *Persister) Connection(ctx context.Context) *pop.Connection

func (*Persister) CountClients

func (p *Persister) CountClients(ctx context.Context) (int, error)

func (*Persister) CountSubjectsGrantedConsentRequests

func (p *Persister) CountSubjectsGrantedConsentRequests(ctx context.Context, subject string) (int, error)

func (*Persister) CreateAccessTokenSession

func (p *Persister) CreateAccessTokenSession(ctx context.Context, signature string, requester fosite.Requester) (err error)

func (*Persister) CreateAuthorizeCodeSession

func (p *Persister) CreateAuthorizeCodeSession(ctx context.Context, signature string, requester fosite.Requester) (err error)

func (*Persister) CreateClient

func (p *Persister) CreateClient(ctx context.Context, c *models.Client) error

func (*Persister) CreateConsentRequest

func (p *Persister) CreateConsentRequest(ctx context.Context, req *consent.ConsentRequest) error

func (*Persister) CreateForcedObfuscatedLoginSession

func (p *Persister) CreateForcedObfuscatedLoginSession(ctx context.Context, session *consent.ForcedObfuscatedLoginSession) error

func (*Persister) CreateLoginRequest

func (p *Persister) CreateLoginRequest(ctx context.Context, req *consent.LoginRequest) error

func (*Persister) CreateLoginSession

func (p *Persister) CreateLoginSession(ctx context.Context, session *consent.LoginSession) error

func (*Persister) CreateLogoutRequest

func (p *Persister) CreateLogoutRequest(ctx context.Context, request *consent.LogoutRequest) error

func (*Persister) CreateOpenIDConnectSession

func (p *Persister) CreateOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) error

func (*Persister) CreatePKCERequestSession

func (p *Persister) CreatePKCERequestSession(ctx context.Context, signature string, requester fosite.Requester) error

func (*Persister) CreateRefreshTokenSession

func (p *Persister) CreateRefreshTokenSession(ctx context.Context, signature string, requester fosite.Requester) (err error)

func (*Persister) DeleteAccessTokenSession

func (p *Persister) DeleteAccessTokenSession(ctx context.Context, signature string) (err error)

func (*Persister) DeleteAccessTokens

func (p *Persister) DeleteAccessTokens(ctx context.Context, clientID string) error

func (*Persister) DeleteClient

func (p *Persister) DeleteClient(ctx context.Context, id string) error

func (*Persister) DeleteKey

func (p *Persister) DeleteKey(ctx context.Context, set, kid string) error

func (*Persister) DeleteKeySet

func (p *Persister) DeleteKeySet(ctx context.Context, set string) error

func (*Persister) DeleteLoginSession

func (p *Persister) DeleteLoginSession(ctx context.Context, id string) error

func (*Persister) DeleteOpenIDConnectSession

func (p *Persister) DeleteOpenIDConnectSession(ctx context.Context, signature string) error

func (*Persister) DeletePKCERequestSession

func (p *Persister) DeletePKCERequestSession(ctx context.Context, signature string) error

func (*Persister) DeleteRefreshTokenSession

func (p *Persister) DeleteRefreshTokenSession(ctx context.Context, signature string) (err error)

func (*Persister) FindGrantedAndRememberedConsentRequests

func (p *Persister) FindGrantedAndRememberedConsentRequests(ctx context.Context, client, subject string) ([]consent.HandledConsentRequest, error)

func (*Persister) FindSubjectsGrantedConsentRequests

func (p *Persister) FindSubjectsGrantedConsentRequests(ctx context.Context, subject string, limit, offset int) ([]consent.HandledConsentRequest, error)

func (*Persister) FlushInactiveAccessTokens

func (p *Persister) FlushInactiveAccessTokens(ctx context.Context, notAfter time.Time, limit int, batchSize int) error

func (*Persister) FlushInactiveLoginConsentRequests

func (p *Persister) FlushInactiveLoginConsentRequests(ctx context.Context, notAfter time.Time, limit int, batchSize int) error

func (*Persister) FlushInactiveRefreshTokens

func (p *Persister) FlushInactiveRefreshTokens(ctx context.Context, notAfter time.Time, limit int, batchSize int) error

func (*Persister) GetAccessTokenSession

func (p *Persister) GetAccessTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)

func (*Persister) GetAuthorizeCodeSession

func (p *Persister) GetAuthorizeCodeSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)

func (*Persister) GetClient

func (p *Persister) GetClient(ctx context.Context, id string) (fosite.Client, error)

func (*Persister) GetClientAssertionJWT

func (p *Persister) GetClientAssertionJWT(ctx context.Context, j string) (*oauth2.BlacklistedJTI, error)

func (*Persister) GetClients

func (p *Persister) GetClients(ctx context.Context, filters client.Filter) ([]models.Client, error)

func (*Persister) GetConcreteClient

func (p *Persister) GetConcreteClient(ctx context.Context, id string) (*models.Client, error)

func (*Persister) GetConsentRequest

func (p *Persister) GetConsentRequest(ctx context.Context, challenge string) (*consent.ConsentRequest, error)

func (*Persister) GetForcedObfuscatedLoginSession

func (p *Persister) GetForcedObfuscatedLoginSession(ctx context.Context, client, obfuscated string) (*consent.ForcedObfuscatedLoginSession, error)

func (*Persister) GetKey

func (p *Persister) GetKey(ctx context.Context, set, kid string) (*jose.JSONWebKeySet, error)

func (*Persister) GetKeySet

func (p *Persister) GetKeySet(ctx context.Context, set string) (*jose.JSONWebKeySet, error)

func (*Persister) GetLoginRequest

func (p *Persister) GetLoginRequest(ctx context.Context, challenge string) (*consent.LoginRequest, error)

func (*Persister) GetLogoutRequest

func (p *Persister) GetLogoutRequest(ctx context.Context, challenge string) (*consent.LogoutRequest, error)

func (*Persister) GetOpenIDConnectSession

func (p *Persister) GetOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) (fosite.Requester, error)

func (*Persister) GetPKCERequestSession

func (p *Persister) GetPKCERequestSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)

func (*Persister) GetRefreshTokenSession

func (p *Persister) GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)

func (*Persister) GetRememberedLoginSession

func (p *Persister) GetRememberedLoginSession(ctx context.Context, id string) (*consent.LoginSession, error)

func (*Persister) HandleConsentRequest

func (p *Persister) HandleConsentRequest(ctx context.Context, challenge string, r *consent.HandledConsentRequest) (*consent.ConsentRequest, error)

func (*Persister) HandleLoginRequest

func (p *Persister) HandleLoginRequest(ctx context.Context, challenge string, r *consent.HandledLoginRequest) (lr *consent.LoginRequest, err error)

func (*Persister) InvalidateAuthorizeCodeSession

func (p *Persister) InvalidateAuthorizeCodeSession(ctx context.Context, signature string) (err error)

func (*Persister) ListUserAuthenticatedClientsWithBackChannelLogout

func (p *Persister) ListUserAuthenticatedClientsWithBackChannelLogout(ctx context.Context, subject, sid string) ([]models.Client, error)

func (*Persister) ListUserAuthenticatedClientsWithFrontChannelLogout

func (p *Persister) ListUserAuthenticatedClientsWithFrontChannelLogout(ctx context.Context, subject, sid string) ([]models.Client, error)

func (*Persister) MigrateDown

func (p *Persister) MigrateDown(ctx context.Context, steps int) error

func (*Persister) MigrateUp

func (p *Persister) MigrateUp(ctx context.Context) error

func (*Persister) MigrateUpTo

func (p *Persister) MigrateUpTo(ctx context.Context, steps int) (int, error)

func (*Persister) MigrationStatus

func (p *Persister) MigrationStatus(ctx context.Context) (popx.MigrationStatuses, error)

func (*Persister) PrepareMigration

func (p *Persister) PrepareMigration(_ context.Context) error

func (*Persister) RejectLogoutRequest

func (p *Persister) RejectLogoutRequest(ctx context.Context, challenge string) error

func (*Persister) RevokeAccessToken

func (p *Persister) RevokeAccessToken(ctx context.Context, id string) error

func (*Persister) RevokeRefreshToken

func (p *Persister) RevokeRefreshToken(ctx context.Context, id string) error

func (*Persister) RevokeSubjectClientConsentSession

func (p *Persister) RevokeSubjectClientConsentSession(ctx context.Context, user, client string) error

func (*Persister) RevokeSubjectConsentSession

func (p *Persister) RevokeSubjectConsentSession(ctx context.Context, user string) error

func (*Persister) RevokeSubjectLoginSession

func (p *Persister) RevokeSubjectLoginSession(ctx context.Context, subject string) error

func (*Persister) Rollback

func (p *Persister) Rollback(ctx context.Context) error

func (*Persister) SetClientAssertionJWT

func (p *Persister) SetClientAssertionJWT(ctx context.Context, jti string, exp time.Time) error

func (*Persister) SetClientAssertionJWTRaw

func (p *Persister) SetClientAssertionJWTRaw(ctx context.Context, jti *oauth2.BlacklistedJTI) error

func (*Persister) UpdateClient

func (p *Persister) UpdateClient(ctx context.Context, cl *models.Client) error

func (*Persister) VerifyAndInvalidateConsentRequest

func (p *Persister) VerifyAndInvalidateConsentRequest(ctx context.Context, verifier string) (*consent.HandledConsentRequest, error)

func (*Persister) VerifyAndInvalidateLoginRequest

func (p *Persister) VerifyAndInvalidateLoginRequest(ctx context.Context, verifier string) (*consent.HandledLoginRequest, error)

func (*Persister) VerifyAndInvalidateLogoutRequest

func (p *Persister) VerifyAndInvalidateLogoutRequest(ctx context.Context, verifier string) (*consent.LogoutRequest, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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