mocks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthStateInMemoryStore

type AuthStateInMemoryStore struct {
	AuthIDIssuer     *cosigner.AuthIDIssuer
	AuthStateMap     map[string]*cosigner.AuthState
	AuthCodeMap      map[string]string
	AuthStateMapLock sync.RWMutex
	AuthcodeMapLock  sync.RWMutex
}

This is intended for testing purposes. The locking strategy used is not particularly efficient. Anyone building a Cosigner should use the interface above to replace this in-memory store with a database.

func NewAuthStateInMemoryStore

func NewAuthStateInMemoryStore(hmacKey []byte) *AuthStateInMemoryStore

func (*AuthStateInMemoryStore) CreateAuthcode

func (s *AuthStateInMemoryStore) CreateAuthcode(authID string) (string, error)

func (*AuthStateInMemoryStore) CreateNewAuthSession

func (s *AuthStateInMemoryStore) CreateNewAuthSession(pkt *pktoken.PKToken, ruri string, nonce string) (string, error)

func (*AuthStateInMemoryStore) LookupAuthState

func (s *AuthStateInMemoryStore) LookupAuthState(authID string) (*cosigner.AuthState, bool)

Writes to the AuthState are not concurrency safe, do not write

func (*AuthStateInMemoryStore) RedeemAuthcode

func (s *AuthStateInMemoryStore) RedeemAuthcode(authcode string) (cosigner.AuthState, string, error)

func (*AuthStateInMemoryStore) UpdateAuthState

func (s *AuthStateInMemoryStore) UpdateAuthState(authID string, authState cosigner.AuthState) error

Jump to

Keyboard shortcuts

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