Documentation ¶
Index ¶
- Constants
- type AccessDetails
- type App
- type Dev
- type Job
- type JobAction
- type Logger
- type OrderOp
- type Server
- func (s *Server) AddAccess(ad AccessDetails)
- func (s *Server) Addr() string
- func (s *Server) AssignAccess(username string, access *bosgo.Access) error
- func (s *Server) AssignRepeatedTransactions(username string, txs []bosgo.RepeatedTransaction) error
- func (s *Server) AssignScheduledTransactions(username string, txs []bosgo.Transaction) error
- func (s *Server) AssignTransactions(username string, txs []bosgo.Transaction) error
- func (s *Server) Client() *http.Client
- func (s *Server) Close()
- func (s *Server) GetUser(id string) (User, bool)
- func (s *Server) GetUserByName(name string) (User, bool)
- func (s *Server) Logf(format string, args ...interface{})
- func (s *Server) MakeAccess(providerID, name string) *bosgo.Access
- func (s *Server) ReadState(r io.Reader) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Server) SetConfirmSimilar(v bool)
- func (s *Server) SetLogger(logger Logger)
- func (s *Server) SetUser(user User)
- func (s *Server) URL() string
- func (s *Server) WriteState(w io.Writer) error
- type TransferAuth
- type TransferOrder
- type User
Constants ¶
const ( ChallengeLogin = "login" ChallengePIN = "pin" ChallengeTAN = "tan" DefaultDeveloperID = "default-dev" DefaultApplicationID = "default-app" DefaultUserID = "default-user" DefaultUsername = "username@example.com" DefaultPassword = "password" DefaultProviderID = "def-provider-id" DefaultAccessLogin = "user" DefaultAccessPIN = "1234" DefaultAuthMethod = "901" DefaultAuthMessage = "tan challenge - (enter 4321 as tan)" DefaultAuthAnswer = "4321" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDetails ¶
type AccessDetails struct { Access bosgo.Access Transactions []bosgo.Transaction ScheduledTransactions []bosgo.Transaction RepeatedTransactions []bosgo.RepeatedTransaction ChallengeMap map[string]string TransferAuths []TransferAuth StageProblems map[bosgo.JobStage][]bosgo.Problem }
type Server ¶
type Server struct { Svr *httptest.Server Devs map[string]Dev // map of developers indexed by ID Apps map[string]App // map of applications indexed by ID Users map[string]User // map of users indexed by ID UserTokens map[string]string // map of user IDs indexed by token Jobs map[string]Job // map of jobs indexed by ID Accesses map[string]AccessDetails // map of access details indexed by provider ID Transfers map[string]TransferOrder // map of transfer orders indexed by ID RecurringTransfers map[string]TransferOrder // map of recurrings transfers orders indexed by ID // contains filtered or unexported fields }
func NewWithDefaults ¶
func NewWithDefaults() *Server
NewWithDefaults creates a new test server with a default developer, application and user account
func (*Server) AddAccess ¶
func (s *Server) AddAccess(ad AccessDetails)
AddAccess adds configuration for an access with its transactions so it can be added to a user via the server API
func (*Server) AssignAccess ¶
AssignAccess assigns a known access to a user
func (*Server) AssignRepeatedTransactions ¶
func (s *Server) AssignRepeatedTransactions(username string, txs []bosgo.RepeatedTransaction) error
AssignRepeatedTransactions assigns a set of repeated transactions to a user, overwriting any existing transactions
func (*Server) AssignScheduledTransactions ¶
func (s *Server) AssignScheduledTransactions(username string, txs []bosgo.Transaction) error
AssignScheduledTransactions assigns a set of scheduled transactions to a user, overwriting any existing transactions
func (*Server) AssignTransactions ¶
func (s *Server) AssignTransactions(username string, txs []bosgo.Transaction) error
AssignTransactions assigns a set of transactions to a user, overwriting any existing transactions
func (*Server) MakeAccess ¶
MakeAccess makes an access with an account
func (*Server) ReadState ¶
ReadState reads a series of JSON documents from r and replaces the state of the server with the read data.
func (*Server) SetConfirmSimilar ¶
SetConfirmSimilar sets the server to respond with the confirm_similar state for subsequent transfers
type TransferAuth ¶
type TransferOrder ¶
type TransferOrder struct { UserID string Operation OrderOp Type bosgo.TransferType Transfer bosgo.Transfer AccessDetails AccessDetails ConfirmSimilar bool }
type User ¶
type User struct { ID string Username string Password string ApplicationID string Accesses []bosgo.Access Transactions []bosgo.Transaction ScheduledTransactions []bosgo.Transaction RepeatedTransactions []bosgo.RepeatedTransaction StoredAnswers map[string][]bosgo.ChallengeAnswer // map of challenge answers indexed by provider ID }