clientmanager

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClientsSegment         = "fosite_clients"
	BlacklistedJTIsSegment = "fosite_blacklisted_jtis"
)

Variables

View Source
var ErrDataNotFound = errors.New("data not found")

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(
	ctx context.Context,
	mongoClient *mongodb.Client,
) (*Store, error)

func (*Store) ClientAssertionJWTValid

func (s *Store) ClientAssertionJWTValid(ctx context.Context, jti string) error

ClientAssertionJWTValid returns an error if the JTI is known or the DB check failed and nil if the JTI is not known.

func (*Store) GetClient

func (s *Store) GetClient(ctx context.Context, id string) (fosite.Client, error)

GetClient loads the client by its ID or returns an error if the client does not exist or another error occurred.

func (*Store) InsertClient

func (s *Store) InsertClient(ctx context.Context, client *oauth2client.Client) (string, error)

func (*Store) SetClientAssertionJWT

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

SetClientAssertionJWT marks a JTI as known for the given expiry time. Before inserting the new JTI, it will clean up any existing JTIs that have expired as those tokens can not be replayed due to the expiry.

Jump to

Keyboard shortcuts

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