Documentation
¶
Index ¶
- Constants
- type AllOf
- func (aoa AllOf) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AllOf) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AllOf) Initialize(config []byte) (types.Authenticator, error)
- func (aoa AllOf) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (aoa AllOf) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (aoa AllOf) StaticGas() uint64
- func (aoa AllOf) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AllOf) Type() string
- type AnyOf
- func (aoa AnyOf) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AnyOf) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AnyOf) Initialize(config []byte) (types.Authenticator, error)
- func (aoa AnyOf) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (aoa AnyOf) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (aoa AnyOf) StaticGas() uint64
- func (aoa AnyOf) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (aoa AnyOf) Type() string
- type AuthenticatorManager
- func (am *AuthenticatorManager) GetAuthenticatorByType(authenticatorType string) types.Authenticator
- func (am *AuthenticatorManager) GetRegisteredAuthenticators() []types.Authenticator
- func (am *AuthenticatorManager) InitializeAuthenticators(initialAuthenticators []types.Authenticator)
- func (am *AuthenticatorManager) IsAuthenticatorTypeRegistered(authenticatorType string) bool
- func (am *AuthenticatorManager) RegisterAuthenticator(authenticator types.Authenticator)
- func (am *AuthenticatorManager) ResetAuthenticators()
- func (am *AuthenticatorManager) UnregisterAuthenticator(authenticator types.Authenticator)
- type ClobPairIdFilter
- func (m ClobPairIdFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m ClobPairIdFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m ClobPairIdFilter) Initialize(config []byte) (types.Authenticator, error)
- func (m ClobPairIdFilter) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m ClobPairIdFilter) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m ClobPairIdFilter) StaticGas() uint64
- func (m ClobPairIdFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m ClobPairIdFilter) Type() string
- type MessageFilter
- func (m MessageFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m MessageFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m MessageFilter) Initialize(config []byte) (types.Authenticator, error)
- func (m MessageFilter) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m MessageFilter) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m MessageFilter) StaticGas() uint64
- func (m MessageFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m MessageFilter) Type() string
- type SignatureAssignment
- type SignatureVerification
- func (sva SignatureVerification) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (sva SignatureVerification) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (sva SignatureVerification) Initialize(config []byte) (types.Authenticator, error)
- func (sva SignatureVerification) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (sva SignatureVerification) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (sva SignatureVerification) StaticGas() uint64
- func (sva SignatureVerification) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (sva SignatureVerification) Type() string
- type SubaccountFilter
- func (m SubaccountFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m SubaccountFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m SubaccountFilter) Initialize(config []byte) (types.Authenticator, error)
- func (m SubaccountFilter) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m SubaccountFilter) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m SubaccountFilter) StaticGas() uint64
- func (m SubaccountFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
- func (m SubaccountFilter) Type() string
Constants ¶
const SEPARATOR = ","
SEPARATOR is the separator used to split the configuration string. This is used by MessageFilter, SubaccountFilter, and ClobPairIdFilter.
const ( // SignatureVerificationType represents a type of authenticator specifically designed for // secp256k1 signature verification. SignatureVerificationType = "SignatureVerification" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllOf ¶
type AllOf struct {
SubAuthenticators []types.Authenticator
// contains filtered or unexported fields
}
func NewAllOf ¶
func NewAllOf(am *AuthenticatorManager) AllOf
func NewPartitionedAllOf ¶
func NewPartitionedAllOf(am *AuthenticatorManager) AllOf
func (AllOf) Authenticate ¶
func (AllOf) ConfirmExecution ¶
func (AllOf) Initialize ¶
func (aoa AllOf) Initialize(config []byte) (types.Authenticator, error)
func (AllOf) OnAuthenticatorAdded ¶
func (AllOf) OnAuthenticatorRemoved ¶
type AnyOf ¶
type AnyOf struct {
SubAuthenticators []types.Authenticator
// contains filtered or unexported fields
}
func NewAnyOf ¶
func NewAnyOf(am *AuthenticatorManager) AnyOf
func NewPartitionedAnyOf ¶
func NewPartitionedAnyOf(am *AuthenticatorManager) AnyOf
func (AnyOf) Authenticate ¶
func (AnyOf) ConfirmExecution ¶
ConfirmExecution is called on all sub-authenticators, but only the changes made by the authenticator that succeeds are written.
func (AnyOf) Initialize ¶
func (aoa AnyOf) Initialize(config []byte) (types.Authenticator, error)
func (AnyOf) OnAuthenticatorAdded ¶
func (AnyOf) OnAuthenticatorRemoved ¶
type AuthenticatorManager ¶
type AuthenticatorManager struct {
// contains filtered or unexported fields
}
AuthenticatorManager is a manager for all registered authenticators.
func NewAuthenticatorManager ¶
func NewAuthenticatorManager() *AuthenticatorManager
NewAuthenticatorManager creates a new AuthenticatorManager.
func (*AuthenticatorManager) GetAuthenticatorByType ¶
func (am *AuthenticatorManager) GetAuthenticatorByType(authenticatorType string) types.Authenticator
GetAuthenticatorByType returns the base implementation of the authenticator type.
func (*AuthenticatorManager) GetRegisteredAuthenticators ¶
func (am *AuthenticatorManager) GetRegisteredAuthenticators() []types.Authenticator
GetRegisteredAuthenticators returns the list of registered authenticators in sorted order.
func (*AuthenticatorManager) InitializeAuthenticators ¶
func (am *AuthenticatorManager) InitializeAuthenticators(initialAuthenticators []types.Authenticator)
InitializeAuthenticators initializes authenticators. If already initialized, it will not overwrite.
func (*AuthenticatorManager) IsAuthenticatorTypeRegistered ¶
func (am *AuthenticatorManager) IsAuthenticatorTypeRegistered(authenticatorType string) bool
IsAuthenticatorTypeRegistered checks if the authenticator type is registered.
func (*AuthenticatorManager) RegisterAuthenticator ¶
func (am *AuthenticatorManager) RegisterAuthenticator(authenticator types.Authenticator)
RegisterAuthenticator adds a new authenticator to the map of registered authenticators.
func (*AuthenticatorManager) ResetAuthenticators ¶
func (am *AuthenticatorManager) ResetAuthenticators()
ResetAuthenticators resets all registered authenticators.
func (*AuthenticatorManager) UnregisterAuthenticator ¶
func (am *AuthenticatorManager) UnregisterAuthenticator(authenticator types.Authenticator)
UnregisterAuthenticator removes an authenticator from the map of registered authenticators.
type ClobPairIdFilter ¶
type ClobPairIdFilter struct {
// contains filtered or unexported fields
}
ClobPairIdFilter filters incoming messages based on a whitelist of clob pair ids. It ensures that only messages with whitelisted clob pair ids are allowed.
func NewClobPairIdFilter ¶
func NewClobPairIdFilter() ClobPairIdFilter
NewClobPairIdFilter creates a new ClobPairIdFilter with the provided EncodingConfig.
func (ClobPairIdFilter) Authenticate ¶
func (m ClobPairIdFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
Authenticate checks if the message's clob pair ids are in the whitelist.
func (ClobPairIdFilter) ConfirmExecution ¶
func (m ClobPairIdFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
ConfirmExecution confirms the execution of a message. Currently, it always confirms.
func (ClobPairIdFilter) Initialize ¶
func (m ClobPairIdFilter) Initialize(config []byte) (types.Authenticator, error)
Initialize sets up the authenticator with the given configuration, which should be a list of clob pair ids separated by a predefined separator.
func (ClobPairIdFilter) OnAuthenticatorAdded ¶
func (m ClobPairIdFilter) OnAuthenticatorAdded( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorAdded is currently a no-op but can be extended for additional logic when an authenticator is added.
func (ClobPairIdFilter) OnAuthenticatorRemoved ¶
func (m ClobPairIdFilter) OnAuthenticatorRemoved( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorRemoved is a no-op in this implementation but can be used when an authenticator is removed.
func (ClobPairIdFilter) StaticGas ¶
func (m ClobPairIdFilter) StaticGas() uint64
StaticGas returns the static gas amount for the authenticator. Currently, it's set to zero.
func (ClobPairIdFilter) Track ¶
func (m ClobPairIdFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
Track is a no-op in this implementation but can be used to track message handling.
func (ClobPairIdFilter) Type ¶
func (m ClobPairIdFilter) Type() string
Type returns the type of the authenticator.
type MessageFilter ¶
type MessageFilter struct {
// contains filtered or unexported fields
}
MessageFilter filters incoming messages based on a predefined JSON pattern. It allows for complex pattern matching to support advanced authentication flows.
func NewMessageFilter ¶
func NewMessageFilter() MessageFilter
NewMessageFilter creates a new MessageFilter with the provided EncodingConfig.
func (MessageFilter) Authenticate ¶
func (m MessageFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
Authenticate checks if the provided message conforms to the set JSON pattern. It returns an AuthenticationResult based on the evaluation.
func (MessageFilter) ConfirmExecution ¶
func (m MessageFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
ConfirmExecution confirms the execution of a message. Currently, it always confirms.
func (MessageFilter) Initialize ¶
func (m MessageFilter) Initialize(config []byte) (types.Authenticator, error)
Initialize sets up the authenticator with the given data, which should be a valid JSON pattern for message filtering.
func (MessageFilter) OnAuthenticatorAdded ¶
func (m MessageFilter) OnAuthenticatorAdded( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorAdded performs additional checks when an authenticator is added. Specifically, it ensures numbers in JSON are encoded as strings.
func (MessageFilter) OnAuthenticatorRemoved ¶
func (m MessageFilter) OnAuthenticatorRemoved( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorRemoved is a no-op in this implementation but can be used when an authenticator is removed.
func (MessageFilter) StaticGas ¶
func (m MessageFilter) StaticGas() uint64
StaticGas returns the static gas amount for the authenticator. Currently, it's set to zero.
func (MessageFilter) Track ¶
func (m MessageFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
Track is a no-op in this implementation but can be used to track message handling.
func (MessageFilter) Type ¶
func (m MessageFilter) Type() string
Type returns the type of the authenticator.
type SignatureAssignment ¶
type SignatureAssignment string
const ( Single SignatureAssignment = "single" Partitioned SignatureAssignment = "partitioned" )
type SignatureVerification ¶
type SignatureVerification struct {
PubKey cryptotypes.PubKey
// contains filtered or unexported fields
}
signature authenticator
func NewSignatureVerification ¶
func NewSignatureVerification(ak authante.AccountKeeper) SignatureVerification
NewSignatureVerification creates a new SignatureVerification
func (SignatureVerification) Authenticate ¶
func (sva SignatureVerification) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
Authenticate takes a SignaturesVerificationData struct and validates each signer and signature using signature verification
func (SignatureVerification) ConfirmExecution ¶
func (sva SignatureVerification) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
func (SignatureVerification) Initialize ¶
func (sva SignatureVerification) Initialize(config []byte) (types.Authenticator, error)
Initialize sets up the public key to the data supplied from the account-authenticator configuration
func (SignatureVerification) OnAuthenticatorAdded ¶
func (sva SignatureVerification) OnAuthenticatorAdded( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
func (SignatureVerification) OnAuthenticatorRemoved ¶
func (sva SignatureVerification) OnAuthenticatorRemoved( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
func (SignatureVerification) StaticGas ¶
func (sva SignatureVerification) StaticGas() uint64
func (SignatureVerification) Track ¶
func (sva SignatureVerification) Track(ctx sdk.Context, request types.AuthenticationRequest) error
func (SignatureVerification) Type ¶
func (sva SignatureVerification) Type() string
type SubaccountFilter ¶
type SubaccountFilter struct {
// contains filtered or unexported fields
}
SubaccountFilter filters incoming messages based on a whitelist of subaccount numbers. It ensures that only messages with whitelisted subaccount numbers are allowed.
func NewSubaccountFilter ¶
func NewSubaccountFilter() SubaccountFilter
NewSubaccountFilter creates a new SubaccountFilter with the provided EncodingConfig.
func (SubaccountFilter) Authenticate ¶
func (m SubaccountFilter) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
Authenticate checks if the message's subaccount numbers are in the whitelist.
func (SubaccountFilter) ConfirmExecution ¶
func (m SubaccountFilter) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
ConfirmExecution confirms the execution of a message. Currently, it always confirms.
func (SubaccountFilter) Initialize ¶
func (m SubaccountFilter) Initialize(config []byte) (types.Authenticator, error)
Initialize sets up the authenticator with the given data, which should be a string of subaccount numbers separated by the specified separator.
func (SubaccountFilter) OnAuthenticatorAdded ¶
func (m SubaccountFilter) OnAuthenticatorAdded( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorAdded is currently a no-op but can be extended for additional logic when an authenticator is added.
func (SubaccountFilter) OnAuthenticatorRemoved ¶
func (m SubaccountFilter) OnAuthenticatorRemoved( ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string, ) error
OnAuthenticatorRemoved is a no-op in this implementation but can be used when an authenticator is removed.
func (SubaccountFilter) StaticGas ¶
func (m SubaccountFilter) StaticGas() uint64
StaticGas returns the static gas amount for the authenticator. Currently, it's set to zero.
func (SubaccountFilter) Track ¶
func (m SubaccountFilter) Track(ctx sdk.Context, request types.AuthenticationRequest) error
Track is a no-op in this implementation but can be used to track message handling.
func (SubaccountFilter) Type ¶
func (m SubaccountFilter) Type() string
Type returns the type of the authenticator.