client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureIdentity

func EnsureIdentity(tx *gorm.DB, id *types.Identity, role types2.Role) (*types.User, error)

EnsureIdentity ensures that the given identity exists in the database, and returns the user associated with it.

Types

type Client

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

func New

func New(db *db.DB, adminEmails []string) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) EnsureIdentity

func (c *Client) EnsureIdentity(ctx context.Context, id *types.Identity) (*types.User, error)

EnsureIdentity ensures that the given identity exists in the database, and returns the user associated with it.

func (*Client) UpdateProfileIconIfNeeded

func (c *Client) UpdateProfileIconIfNeeded(ctx context.Context, user *types.User, authProviderID uint) error

func (*Client) User

func (c *Client) User(ctx context.Context, username string) (*types.User, error)

type UserDecorator

type UserDecorator struct {
	Next   authenticator.Request
	Client *Client
}

func NewUserDecorator

func NewUserDecorator(next authenticator.Request, client *Client) *UserDecorator

func (UserDecorator) AuthenticateRequest

func (u UserDecorator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)

Jump to

Keyboard shortcuts

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