records

package
v0.0.0-...-2e485aa Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigtableRecordStore

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

func NewBigtableRecordStore

func NewBigtableRecordStore(ctx context.Context, realmID types.RealmID) (*BigtableRecordStore, error)

func (BigtableRecordStore) Close

func (bt BigtableRecordStore) Close()

func (BigtableRecordStore) GetRecord

func (bt BigtableRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)

func (BigtableRecordStore) WriteRecord

func (bt BigtableRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error

type DynamoDbRecordStore

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

func NewDynamoDbRecordStore

func NewDynamoDbRecordStore(ctx context.Context, cfg aws.Config, realmID types.RealmID) (*DynamoDbRecordStore, error)

func (DynamoDbRecordStore) GetRecord

func (db DynamoDbRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)

func (DynamoDbRecordStore) WriteRecord

func (db DynamoDbRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error

type MemoryRecordStore

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

func (*MemoryRecordStore) GetRecord

func (m *MemoryRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)

func (*MemoryRecordStore) WriteRecord

func (m *MemoryRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error

type MongoRecordStore

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

func NewMongoRecordStore

func NewMongoRecordStore(ctx context.Context, realmID types.RealmID) (*MongoRecordStore, error)

func (MongoRecordStore) GetRecord

func (m MongoRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)

func (MongoRecordStore) WriteRecord

func (m MongoRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error

type NoGuesses

type NoGuesses struct{}

type NotRegistered

type NotRegistered struct{}

type RecordStore

type RecordStore interface {
	// Returns a processed UserRecord deserialized from the database or a default
	// record if nothing is currently stored. Also returns the raw record read
	// from the database – this must be passed to WriteRecord to ensure atomic operation.
	GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)
	// The write will only be performed if the record in the database still matches
	// the record that was read.
	WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error
}

RecordStore represents a generic interface into the database storage provider of your choice.

func NewMemoryRecordStore

func NewMemoryRecordStore() RecordStore

func NewRecordStore

func NewRecordStore(ctx context.Context, provider types.ProviderName, opts types.ProviderOptions, realmID types.RealmID) (RecordStore, error)

type Registered

type Registered struct {
	Version                   types.RegistrationVersion       `cbor:"version"`
	OprfPrivateKey            types.OprfPrivateKey            `cbor:"oprf_private_key"`
	OprfSignedPublicKey       types.OprfSignedPublicKey       `cbor:"oprf_signed_public_key"`
	UnlockKeyCommitment       types.UnlockKeyCommitment       `cbor:"unlock_key_commitment"`
	UnlockKeyTag              types.UnlockKeyTag              `cbor:"unlock_key_tag"`
	EncryptionKeyScalarShare  types.EncryptionKeyScalarShare  `cbor:"encryption_key_scalar_share"`
	EncryptedSecret           types.EncryptedSecret           `cbor:"encrypted_secret"`
	EncryptedSecretCommitment types.EncryptedSecretCommitment `cbor:"encrypted_secret_commitment"`
	GuessCount                uint16                          `cbor:"guess_count"`
	Policy                    types.Policy                    `cbor:"policy"`
}

type UserRecord

type UserRecord struct {
	// oneof Registered, NotRegistered, NoGuesses
	RegistrationState interface{} `cbor:"registration_state"`
}

func DefaultUserRecord

func DefaultUserRecord() UserRecord

func (*UserRecord) MarshalCBOR

func (ur *UserRecord) MarshalCBOR() ([]byte, error)

func (*UserRecord) UnmarshalCBOR

func (ur *UserRecord) UnmarshalCBOR(data []byte) error

type UserRecordID

type UserRecordID string

func CreateUserRecordID

func CreateUserRecordID(tenantName string, userID string) (UserRecordID, error)

Jump to

Keyboard shortcuts

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