Documentation ¶
Index ¶
- Constants
- func RunOpaqueServer() error
- type ClientConfig
- func (c *ClientConfig) AddError(err error)
- func (c *ClientConfig) AddMessage(title string, msg interface{})
- func (c *ClientConfig) AddTitle(title string)
- func (c *ClientConfig) Get(endpoint string) (*http.Response, error)
- func (c *ClientConfig) ParseConfigMsg(r *http.Response) error
- func (c *ClientConfig) ParseExporterKeyMsg(r *http.Response) (expauth.ExportedKeyGetter, crypto.Hash, error)
- func (c *ClientConfig) Post(endpoint string, request []byte) (*http.Response, error)
- func (c *ClientConfig) RequestCiphersuite() error
- func (c *ClientConfig) RequestExportedKeys() (expauth.ExportedKeyGetter, crypto.Hash, error)
- func (c *ClientConfig) RunOpaqueLoginClient(username, password string, getExportedKey expauth.ExportedKeyGetter, ...) error
- func (c *ClientConfig) RunOpaqueRegisterClient(username, password string) error
- func (c *ClientConfig) SendLoginRequest(client *opaqueea.Client, sessionID []byte, password string) (*http.Response, error)
- func (c *ClientConfig) SendLoginResponse(client *opaqueea.Client, sessionID []byte, httpResponse *http.Response) (*http.Response, error)
- func (c *ClientConfig) SendRegisterRequest(client *opaqueea.Client, sessionID []byte, password string) (*http.Response, error)
- func (c *ClientConfig) SendRegisterResponse(client *opaqueea.Client, sessionID []byte, httpResponse *http.Response) (*http.Response, error)
- func (c *ClientConfig) SetupClient(username string, getExportedKey expauth.ExportedKeyGetter, ...) (*opaqueea.Client, error)
- type HTTPMessage
- type OPAQUEAuth
- func (oa *OPAQUEAuth) AddSession(ctx []byte, session *opaqueea.Server) error
- func (oa *OPAQUEAuth) CloseSession(ctx []byte)
- func (oa *OPAQUEAuth) HandleAuthRequest(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleAuthResponse(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleConfigRequest(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleExportedKeyRequest(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleExportedKeyTestRequest(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleRegistrationRequest(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) HandleRegistrationUpload(w http.ResponseWriter, req *http.Request)
- func (oa *OPAQUEAuth) NewSession(ctx []byte, connState *tls.ConnectionState) (*opaqueea.Server, error)
- func (oa *OPAQUEAuth) Populate(domain string) error
- func (oa *OPAQUEAuth) RetrieveSession(ctx []byte) (*opaqueea.Server, error)
Constants ¶
const ( // SessionIDLength represents the lenght of the session ID. SessionIDLength = 32 // ErrorBadPasswordLikely represents an when when the password is wrong. ErrorBadPasswordLikely = "Server provided a bad envelope. This likely indicates a mistyped password." // ErrorUsernameTaken represents an error when the username is already taken. ErrorUsernameTaken = "Username already registered. Try again with a new username." // ErrorUsernameNotRegistered represents and error when the username is not yet registered. ErrorUsernameNotRegistered = "Username not registered. Register your username before logging in." // ErrorGeneric represents a generic error. ErrorGeneric = "Something went wrong. Try again." // SuccessLogin represents a message for when the login is successful. SuccessLogin = "Login successful!" // SuccessRegistration represents a message for when the registration is successful. SuccessRegistration = "Registration successful!" // LocalDomain represents the domain for local view. LocalDomain = "127.0.0.1:8080" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientConfig ¶
ClientConfig represents a client configuration for http.
func (*ClientConfig) AddError ¶
func (c *ClientConfig) AddError(err error)
AddError adds a library error.
func (*ClientConfig) AddMessage ¶
func (c *ClientConfig) AddMessage(title string, msg interface{})
AddMessage adds a message to the DOM.
func (*ClientConfig) AddTitle ¶
func (c *ClientConfig) AddTitle(title string)
AddTitle adds a title to the string.
func (*ClientConfig) Get ¶
func (c *ClientConfig) Get(endpoint string) (*http.Response, error)
Get gets an http Response.
func (*ClientConfig) ParseConfigMsg ¶
func (c *ClientConfig) ParseConfigMsg(r *http.Response) error
ParseConfigMsg parses the config message for a Client.
func (*ClientConfig) ParseExporterKeyMsg ¶
func (c *ClientConfig) ParseExporterKeyMsg(r *http.Response) (expauth.ExportedKeyGetter, crypto.Hash, error)
ParseExporterKeyMsg parses into a ExportedKey.
func (*ClientConfig) RequestCiphersuite ¶
func (c *ClientConfig) RequestCiphersuite() error
RequestCiphersuite request a ciphersuite for a Client.
func (*ClientConfig) RequestExportedKeys ¶
func (c *ClientConfig) RequestExportedKeys() (expauth.ExportedKeyGetter, crypto.Hash, error)
RequestExportedKeys requests the exported keys.
func (*ClientConfig) RunOpaqueLoginClient ¶
func (c *ClientConfig) RunOpaqueLoginClient(username, password string, getExportedKey expauth.ExportedKeyGetter, authHash crypto.Hash) error
RunOpaqueLoginClient runs an opaque login client.
func (*ClientConfig) RunOpaqueRegisterClient ¶
func (c *ClientConfig) RunOpaqueRegisterClient(username, password string) error
RunOpaqueRegisterClient runs an opaque register client.
func (*ClientConfig) SendLoginRequest ¶
func (c *ClientConfig) SendLoginRequest(client *opaqueea.Client, sessionID []byte, password string) (*http.Response, error)
SendLoginRequest sends a login request.
func (*ClientConfig) SendLoginResponse ¶
func (c *ClientConfig) SendLoginResponse(client *opaqueea.Client, sessionID []byte, httpResponse *http.Response) (*http.Response, error)
SendLoginResponse sends a client login response.
func (*ClientConfig) SendRegisterRequest ¶
func (c *ClientConfig) SendRegisterRequest(client *opaqueea.Client, sessionID []byte, password string) (*http.Response, error)
SendRegisterRequest sends a client register request.
func (*ClientConfig) SendRegisterResponse ¶
func (c *ClientConfig) SendRegisterResponse(client *opaqueea.Client, sessionID []byte, httpResponse *http.Response) (*http.Response, error)
SendRegisterResponse sends a client register response.
func (*ClientConfig) SetupClient ¶
func (c *ClientConfig) SetupClient(username string, getExportedKey expauth.ExportedKeyGetter, authHash crypto.Hash) (*opaqueea.Client, error)
SetupClient sets up a client.
type HTTPMessage ¶
HTTPMessage represents an HTTP Message.
type OPAQUEAuth ¶
type OPAQUEAuth struct {
// contains filtered or unexported fields
}
OPAQUEAuth represents an OPAQUE authentication struct.
func (*OPAQUEAuth) AddSession ¶
func (oa *OPAQUEAuth) AddSession(ctx []byte, session *opaqueea.Server) error
AddSession adds a session to the OPAQUEAuth.
func (*OPAQUEAuth) CloseSession ¶
func (oa *OPAQUEAuth) CloseSession(ctx []byte)
CloseSession closes/deletes a session from the OPAQUE Auth.
func (*OPAQUEAuth) HandleAuthRequest ¶
func (oa *OPAQUEAuth) HandleAuthRequest(w http.ResponseWriter, req *http.Request)
HandleAuthRequest handles an auth request.
func (*OPAQUEAuth) HandleAuthResponse ¶
func (oa *OPAQUEAuth) HandleAuthResponse(w http.ResponseWriter, req *http.Request)
HandleAuthResponse handles an auth response.
func (*OPAQUEAuth) HandleConfigRequest ¶
func (oa *OPAQUEAuth) HandleConfigRequest(w http.ResponseWriter, req *http.Request)
HandleConfigRequest handles a request for config.
func (*OPAQUEAuth) HandleExportedKeyRequest ¶
func (oa *OPAQUEAuth) HandleExportedKeyRequest(w http.ResponseWriter, req *http.Request)
HandleExportedKeyRequest handles an exported key request.
func (*OPAQUEAuth) HandleExportedKeyTestRequest ¶
func (oa *OPAQUEAuth) HandleExportedKeyTestRequest(w http.ResponseWriter, req *http.Request)
HandleExportedKeyTestRequest handles an exported key test request.
func (*OPAQUEAuth) HandleRegistrationRequest ¶
func (oa *OPAQUEAuth) HandleRegistrationRequest(w http.ResponseWriter, req *http.Request)
HandleRegistrationRequest handles a registration request.
func (*OPAQUEAuth) HandleRegistrationUpload ¶
func (oa *OPAQUEAuth) HandleRegistrationUpload(w http.ResponseWriter, req *http.Request)
HandleRegistrationUpload handles a registration upload.
func (*OPAQUEAuth) NewSession ¶
func (oa *OPAQUEAuth) NewSession(ctx []byte, connState *tls.ConnectionState) (*opaqueea.Server, error)
NewSession creates a new session and adds it to the OPAQUE Auth.
func (*OPAQUEAuth) Populate ¶
func (oa *OPAQUEAuth) Populate(domain string) error
Populate populates the OPAQUEAuth with the needed fields.
func (*OPAQUEAuth) RetrieveSession ¶
func (oa *OPAQUEAuth) RetrieveSession(ctx []byte) (*opaqueea.Server, error)
RetrieveSession retrieves a session from the OPAQUE Auth.