Documentation ¶
Index ¶
- func LoadSchema(_db *sql.DB, path string) error
- type AuthConfig
- type Config
- type PublicWallet
- type Server
- func (server *Server) AcceptDeviceHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) AddRoute(method string, pattern string, h http.HandlerFunc) error
- func (server *Server) AuthorizeHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) CustomAuth(authServerUrl, token string) (string, error)
- func (server *Server) DkgHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) ExportHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) GetInterHandlersChannels(userId string) (chan string, chan string, chan string, chan string, chan *tss.ServerAdd, ...)
- func (server *Server) IdentifyHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) RegisterDeviceHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) Router() http.Handler
- func (server *Server) RpcHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) ServeWasm(w http.ResponseWriter, r *http.Request)
- func (server *Server) SignHandler(w http.ResponseWriter, r *http.Request)
- func (server *Server) Start()
- func (server *Server) Supabase(supabaseUrl, supabaseApiKey, jwt string) (string, error)
- func (server *Server) UpdateGetAuthConfig(getAuthConfig func(context.Context, *Server) (*AuthConfig, error))
- func (server *Server) Vault() Vault
- type SupabaseUser
- type Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶ added in v1.1.0
type PublicWallet ¶ added in v1.2.0
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AcceptDeviceHandler ¶ added in v1.2.0
func (server *Server) AcceptDeviceHandler(w http.ResponseWriter, r *http.Request)
AcceptDeviceHandler is called by a device already part of the TSS wallet. In collaboration with the server and the new device, a new share is created for the new device
func (*Server) AddRoute ¶ added in v1.1.0
AddRoute adds an endpoint to the server. Note that it will go through authMiddleware for security reasons.
func (*Server) AuthorizeHandler ¶
func (server *Server) AuthorizeHandler(w http.ResponseWriter, r *http.Request)
AuthorizeHandler is responsible for creating an access token allowing for a tss request to be performed It uses identityMiddleware to get the userId from auth provider based on a generic bearer token provided by the client It then creates an access token linked to that userId, stores it in cache and returns it
func (*Server) CustomAuth ¶
CustomAuth gets the userId from a generic CustomAuth auth provider, based on a token representing a session or connexion Calls the generic CustomAuth auth provider using the webhook provided (auth config) with agreed upon API contract
func (*Server) DkgHandler ¶
func (server *Server) DkgHandler(w http.ResponseWriter, r *http.Request)
DkgHandler performs the dkg process from the server side goes through the authMiddleware to confirm the access token and get the userId
func (*Server) ExportHandler ¶ added in v1.2.0
func (server *Server) ExportHandler(w http.ResponseWriter, r *http.Request)
ExportHandler exports the private key from the server and client shares goes through the authMiddleware to confirm the access token and get the userId requires the client share (provided in URL parameter)
func (*Server) GetInterHandlersChannels ¶ added in v1.2.0
func (server *Server) GetInterHandlersChannels(userId string) (chan string, chan string, chan string, chan string, chan *tss.ServerAdd, chan struct{}, chan struct{}, chan struct{}, error)
Returns channels : metadata, adder, new device done, existing device done
func (*Server) IdentifyHandler ¶
func (server *Server) IdentifyHandler(w http.ResponseWriter, r *http.Request)
IdentifyHandler is responsible for getting a unique identifier of a user from the auth provider It uses identityMiddleware to get the userId from auth provider based on a generic bearer token provided by the client, then returns it
func (*Server) RegisterDeviceHandler ¶ added in v1.2.0
func (server *Server) RegisterDeviceHandler(w http.ResponseWriter, r *http.Request)
RegisterDeviceHandler is called by a new device wanting to "join" the wallet by creating a new share for itself, in collaboration with existing peers
func (*Server) RpcHandler ¶
func (server *Server) RpcHandler(w http.ResponseWriter, r *http.Request)
RpcHandler is used for debug operations : it logs every RPC-JSON requests and the return value
func (*Server) ServeWasm ¶
func (server *Server) ServeWasm(w http.ResponseWriter, r *http.Request)
ServeWasm is responsible for serving the wasm module
func (*Server) SignHandler ¶
func (server *Server) SignHandler(w http.ResponseWriter, r *http.Request)
SignHandler performs the signing process from the server side goes through the authMiddleware to confirm the access token and get the userId requires a hex-encoded message to be signed (provided in URL parameter)
func (*Server) Supabase ¶
Supabase calls Supabase server to get the userId, based on the Supabase JWT provided
func (*Server) UpdateGetAuthConfig ¶ added in v1.1.0
func (server *Server) UpdateGetAuthConfig(getAuthConfig func(context.Context, *Server) (*AuthConfig, error))
UpdateGetAuthConfig changes the auth config getter
type SupabaseUser ¶
type SupabaseUser struct {
ID string `json:"id"`
}
type Vault ¶ added in v1.1.0
type Vault interface { WalletExists(ctx context.Context, foreignKey string) error StoreWallet(ctx context.Context, foreignKey string, peerID string, userAgent string, dkgResult *tss.DkgResult) (string, error) RetrieveWallet(ctx context.Context, foreignKey string) (*tss.DkgResult, error) AddPeer(ctx context.Context, foreignKey string, peerID string, userAgent string, updatedDkgResult *tss.DkgResult) error }