Documentation
¶
Index ¶
- type BakeryConfigState
- func (st *BakeryConfigState) GetExternalUsersThirdPartyKey(ctx context.Context) (*bakery.KeyPair, error)
- func (st *BakeryConfigState) GetLocalUsersKey(ctx context.Context) (*bakery.KeyPair, error)
- func (st *BakeryConfigState) GetLocalUsersThirdPartyKey(ctx context.Context) (*bakery.KeyPair, error)
- func (st *BakeryConfigState) GetOffersThirdPartyKey(ctx context.Context) (*bakery.KeyPair, error)
- func (st *BakeryConfigState) InitialiseBakeryConfig(ctx context.Context, ...) error
- type ExternalUsersThirdPartyKeyPair
- type FullConfig
- type LocalUsersKeyPair
- type LocalUsersThirdPartyKeyPair
- type OffersThirdPartyKeyPair
- type RootKeyState
- func (st *RootKeyState) FindLatestKey(ctx context.Context, createdAfter, expiresAfter, expiresBefore, now time.Time) (macaroon.RootKey, error)
- func (st *RootKeyState) GetKey(ctx context.Context, id []byte, now time.Time) (macaroon.RootKey, error)
- func (st *RootKeyState) InsertKey(ctx context.Context, key macaroon.RootKey) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BakeryConfigState ¶
BakeryConfigState describes the persistence layer for the macaroon bakery config
func NewBakeryConfigState ¶
func NewBakeryConfigState(factory coredatabase.TxnRunnerFactory) *BakeryConfigState
NewBakeryConfigState returns a new config state reference
func (*BakeryConfigState) GetExternalUsersThirdPartyKey ¶
func (st *BakeryConfigState) GetExternalUsersThirdPartyKey(ctx context.Context) (*bakery.KeyPair, error)
GetExternalUsersThirdPartyKey returns the third party key pair used with the external users bakery.
func (*BakeryConfigState) GetLocalUsersKey ¶
GetLocalUsersKey returns the key pair used with the local users bakery.
func (*BakeryConfigState) GetLocalUsersThirdPartyKey ¶
func (st *BakeryConfigState) GetLocalUsersThirdPartyKey(ctx context.Context) (*bakery.KeyPair, error)
GetLocalUsersThirdPartyKey returns the third party key pair used with the local users bakery.
func (*BakeryConfigState) GetOffersThirdPartyKey ¶
GetOffersThirdPartyKey returns the key pair used with the cross model offers bakery.
func (*BakeryConfigState) InitialiseBakeryConfig ¶
func (st *BakeryConfigState) InitialiseBakeryConfig( ctx context.Context, localUsersKey, localUsersThirdPartyKey, externalUsersThirdPartyKey, offersThirdPartyKey *bakery.KeyPair, ) error
InitialiseBakeryConfig creates and fills in the bakery config in state.
type ExternalUsersThirdPartyKeyPair ¶
type ExternalUsersThirdPartyKeyPair struct { ExternalUsersThirdPartyPrivateKey *keyScanner `db:"external_users_third_party_private_key"` ExternalUsersThirdPartyPublicKey *keyScanner `db:"external_users_third_party_public_key"` }
type FullConfig ¶
type FullConfig struct { LocalUsersPrivateKey *keyScanner `db:"local_users_private_key"` LocalUsersPublicKey *keyScanner `db:"local_users_public_key"` LocalUsersThirdPartyPrivateKey *keyScanner `db:"local_users_third_party_private_key"` LocalUsersThirdPartyPublicKey *keyScanner `db:"local_users_third_party_public_key"` ExternalUsersThirdPartyPrivateKey *keyScanner `db:"external_users_third_party_private_key"` ExternalUsersThirdPartyPublicKey *keyScanner `db:"external_users_third_party_public_key"` OffersThirdPartyPrivateKey *keyScanner `db:"offers_third_party_private_key"` OffersThirdPartyPublicKey *keyScanner `db:"offers_third_party_public_key"` }
FullConfig holds the full macaroon bakery config data
type LocalUsersKeyPair ¶
type LocalUsersKeyPair struct { LocalUsersPrivateKey *keyScanner `db:"local_users_private_key"` LocalUsersPublicKey *keyScanner `db:"local_users_public_key"` }
type LocalUsersThirdPartyKeyPair ¶
type LocalUsersThirdPartyKeyPair struct { LocalUsersThirdPartyPrivateKey *keyScanner `db:"local_users_third_party_private_key"` LocalUsersThirdPartyPublicKey *keyScanner `db:"local_users_third_party_public_key"` }
type OffersThirdPartyKeyPair ¶
type OffersThirdPartyKeyPair struct { OffersThirdPartyPrivateKey *keyScanner `db:"offers_third_party_private_key"` OffersThirdPartyPublicKey *keyScanner `db:"offers_third_party_public_key"` }
type RootKeyState ¶
RootKeyState describes the persistence layer for macaroon root keys
func NewRootKeyState ¶
func NewRootKeyState(factory coredatabase.TxnRunnerFactory) *RootKeyState
NewRootKeyState return a new macaroon root key state reference
func (*RootKeyState) FindLatestKey ¶
func (st *RootKeyState) FindLatestKey(ctx context.Context, createdAfter, expiresAfter, expiresBefore, now time.Time) (macaroon.RootKey, error)
FindLatestKey returns the most recently created root key k following all the conditions:
k.Created >= createdAfter k.Expires >= expiresAfter k.Expires <= expiresBefore
If no such key was found, return a macaroonerrors.KeyNotFound error
type State ¶
type State struct { *BakeryConfigState *RootKeyState }
State describes the persistence layer for macaroon bakery bakery storage
func NewState ¶
func NewState(factory database.TxnRunnerFactory) *State
NewState returns a new state reference