Documentation
¶
Index ¶
- Constants
- func DecodeBase64RSAKey(req *Request, base64PrivateKey string) error
- func EncodeBase64RSAKey(privateKeyByte []byte) string
- func GenTimestamp(req *Request)
- func GetClientInitHttpHeaders(req *Request) http.Header
- func New(cfg *config.Config, kv util.KVStore) (*signingAgent, error)
- func NewFeed(feedUrl string, agent SigningAgentClient, serveFu ServeCB) *feed
- func SignRequest(req *Request) error
- type Agent
- type ErrHandler
- type Handler
- type MockSigningAgentClient
- func (m *MockSigningAgentClient) ActionApprove(actionID string) error
- func (m *MockSigningAgentClient) ActionReject(actionID string) error
- func (m *MockSigningAgentClient) ClientInit(register *api.QredoRegisterInitRequest, ref, apikey, b64PrivateKey string) (*api.QredoRegisterInitResponse, error)
- func (m *MockSigningAgentClient) ClientRegister(name string) (*api.ClientRegisterResponse, error)
- func (m *MockSigningAgentClient) ClientRegisterFinish(req *api.ClientRegisterFinishRequest, ref string) (*api.ClientRegisterFinishResponse, error)
- func (m *MockSigningAgentClient) GetAgentID() string
- func (m *MockSigningAgentClient) GetAgentName(agentID string) string
- func (m *MockSigningAgentClient) GetAgentZKPOnePass() ([]byte, error)
- func (m *MockSigningAgentClient) GetSystemAgentID() string
- func (m *MockSigningAgentClient) ReadAction(string, ServeCB) *feed
- func (m *MockSigningAgentClient) SetSystemAgentID(agetID string) error
- type Request
- type ServeCB
- type SigningAgentClient
- type Storage
- func (s *Storage) AddAgent(id string, c *Agent) error
- func (s *Storage) AddPending(ref string, c *Agent) error
- func (s *Storage) GetAgent(id string) *Agent
- func (s *Storage) GetPending(ref string) *Agent
- func (s *Storage) GetSystemAgentID() string
- func (s *Storage) RemoveAgent(id string) error
- func (s *Storage) RemovePending(ref string) error
- func (s *Storage) SetSystemAgentID(agentID string) error
- type WsActionInfoEvent
- type WsActionInfoHandler
Constants ¶
View Source
const WsTimeout = time.Second * 60
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64RSAKey ¶
func EncodeBase64RSAKey ¶
func GenTimestamp ¶
func GenTimestamp(req *Request)
func NewFeed ¶
func NewFeed(feedUrl string, agent SigningAgentClient, serveFu ServeCB) *feed
func SignRequest ¶
Types ¶
type ErrHandler ¶
type ErrHandler func(err error)
type MockSigningAgentClient ¶
type MockSigningAgentClient struct {
GetSystemAgentIDCalled bool
GetAgentZKPOnePassCalled bool
ClientRegisterCalled bool
ClientInitCalled bool
ClientRegisterFinishCalled bool
ActionApproveCalled bool
GetAgentIDCalled bool
GetAgentNameCalled bool
ActionRejectCalled bool
Counter int
NextError error
NextClientInitError error
NextRegisterError error
NextRegisterFinishError error
NextZKPOnePass []byte
NextAgentID string
NextAgentName string
LastRegisteredName string
NextClientRegisterResponse *api.ClientRegisterResponse
NextRegisterInitResponse *api.QredoRegisterInitResponse
NextRegisterFinishResponse *api.ClientRegisterFinishResponse
LastRegisterRequest *api.QredoRegisterInitRequest
LastRegisterFinishRequest *api.ClientRegisterFinishRequest
LastRef string
LastApiKey string
Last64PrivateKey string
LastActionId string
LastRejectActionId string
LastAgentID string
}
func NewMockSigningAgentClient ¶
func NewMockSigningAgentClient(agentId string) *MockSigningAgentClient
func (*MockSigningAgentClient) ActionApprove ¶
func (m *MockSigningAgentClient) ActionApprove(actionID string) error
func (*MockSigningAgentClient) ActionReject ¶
func (m *MockSigningAgentClient) ActionReject(actionID string) error
func (*MockSigningAgentClient) ClientInit ¶
func (m *MockSigningAgentClient) ClientInit(register *api.QredoRegisterInitRequest, ref, apikey, b64PrivateKey string) (*api.QredoRegisterInitResponse, error)
func (*MockSigningAgentClient) ClientRegister ¶
func (m *MockSigningAgentClient) ClientRegister(name string) (*api.ClientRegisterResponse, error)
func (*MockSigningAgentClient) ClientRegisterFinish ¶
func (m *MockSigningAgentClient) ClientRegisterFinish(req *api.ClientRegisterFinishRequest, ref string) (*api.ClientRegisterFinishResponse, error)
func (*MockSigningAgentClient) GetAgentID ¶
func (m *MockSigningAgentClient) GetAgentID() string
func (*MockSigningAgentClient) GetAgentName ¶ added in v1.0.1
func (m *MockSigningAgentClient) GetAgentName(agentID string) string
func (*MockSigningAgentClient) GetAgentZKPOnePass ¶
func (m *MockSigningAgentClient) GetAgentZKPOnePass() ([]byte, error)
func (*MockSigningAgentClient) GetSystemAgentID ¶
func (m *MockSigningAgentClient) GetSystemAgentID() string
func (*MockSigningAgentClient) ReadAction ¶
func (m *MockSigningAgentClient) ReadAction(string, ServeCB) *feed
func (*MockSigningAgentClient) SetSystemAgentID ¶
func (m *MockSigningAgentClient) SetSystemAgentID(agetID string) error
type SigningAgentClient ¶
type SigningAgentClient interface {
// ClientInit starts the agent registration process
ClientInit(register *api.QredoRegisterInitRequest, ref, apikey, b64PrivateKey string) (*api.QredoRegisterInitResponse, error)
// ClientRegister starts the simplified agent registration procedure
// by generating BLS and EC key pairs and returns the public keys
ClientRegister(name string) (*api.ClientRegisterResponse, error)
// ClientRegisterFinish concludes the agent registration process
ClientRegisterFinish(req *api.ClientRegisterFinishRequest, ref string) (*api.ClientRegisterFinishResponse, error)
// GetAgentID returns the agent id if registered
GetAgentID() string
// GetAgentName returns the agent name if registered
GetAgentName(agentID string) string
// ActionApprove signs actionID and sends it for approval to the Qredo backend
ActionApprove(actionID string) error
// ActionReject sends a rejection to the Qredo backend for actionID
ActionReject(actionID string) error
// SetSystemAgentID function to collect agent ID to storage, so the system will default to a single agent ID (AgentID)
SetSystemAgentID(agetID string) error
// GetSystemAgentID function to get agent ID that was stored during registration process.
GetSystemAgentID() string
// GetAgentZKPOnePass function to generate Zero Knowladge Proof one password (for auth header).
GetAgentZKPOnePass() ([]byte, error)
// ReadAction connect to qredo web socket stream by given feed url and return Feed object
ReadAction(string, ServeCB) *feed
}
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) GetPending ¶
func (*Storage) GetSystemAgentID ¶
func (*Storage) RemoveAgent ¶
func (*Storage) RemovePending ¶
func (*Storage) SetSystemAgentID ¶
type WsActionInfoEvent ¶
type WsActionInfoHandler ¶
type WsActionInfoHandler func(event *WsActionInfoEvent)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.