Help us shape the future of Go! Take the 2026 Go Developer Survey

local

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRegistrationToken

func CheckRegistrationToken(store cache.Store, signature string) (string, error)

CheckRegistrationToken checks that the given signature is a valid registration token.

func CheckResetConsumerToken

func CheckResetConsumerToken(store cache.Store, signature string) (string, error)

CheckResetConsumerToken checks that the given signature is a valid reset consumer token.

func CleanResetConsumerToken

func CleanResetConsumerToken(store cache.Store, consumerID string)

CleanResetConsumerToken deletes a consumer reset token from cache if exists.

func CleanVerifyConsumerToken

func CleanVerifyConsumerToken(store cache.Store, consumerID string)

CleanVerifyConsumerToken deletes a consumer verify token from cache if exists.

func CompareHashAndPassword

func CompareHashAndPassword(hash []byte, password string) error

CompareHashAndPassword returns an error if given password don't match given hash.

func DeleteRegistrationByID

func DeleteRegistrationByID(db gorp.SqlExecutor, id string) error

DeleteRegistrationByID removes a user registration in database for given id.

func HashPassword

func HashPassword(password string) ([]byte, error)

HashPassword return a hash from given password.

func InsertRegistration

func InsertRegistration(ctx context.Context, db gorpmapper.SqlExecutorWithTx, ur *sdk.UserRegistration) error

InsertRegistration in database.

func LoadRegistrationByID

func LoadRegistrationByID(ctx context.Context, db gorp.SqlExecutor, id string) (*sdk.UserRegistration, error)

LoadRegistrationByID returns an user registration from database.

func NewConsumer

NewConsumer returns a new local consumer for given data.

func NewConsumerWithHash

func NewConsumerWithHash(ctx context.Context, db gorpmapper.SqlExecutorWithTx, userID, hash string) (*sdk.AuthUserConsumer, error)

NewConsumerWithHash returns a new local consumer with given hash.

func NewDriver

func NewDriver(ctx context.Context, signupDisabled bool, uiURL, allowedDomains string, orga string) sdk.AuthDriver

NewDriver returns a new initialized driver for local authentication.

func NewRegistrationToken

func NewRegistrationToken(store cache.Store, regID string, isFirstConnection bool) (string, error)

NewRegistrationToken returns a new token for given registration id.

func NewResetConsumerToken

func NewResetConsumerToken(store cache.Store, consumerID string) (string, error)

NewResetConsumerToken returns a new reset consumer token for given consumer id.

Types

type AuthDriver

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

AuthDriver for local authentication.

func (AuthDriver) GetDriver added in v0.53.0

func (d AuthDriver) GetDriver() sdk.Driver

func (AuthDriver) GetManifest

func (d AuthDriver) GetManifest() sdk.AuthDriverManifest

GetManifest .

func (AuthDriver) GetSessionDuration

func (d AuthDriver) GetSessionDuration() time.Duration

GetSessionDuration .

func (AuthDriver) GetUserInfo

GetUserInfo .

Jump to

Keyboard shortcuts

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