handler

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteIncoming

func CompleteIncoming(w http.ResponseWriter, req *http.Request)

CompleteIncoming is called whenever everything from a message has been uploaded and can be actually send

func CreateAPIKey

func CreateAPIKey(w http.ResponseWriter, req *http.Request)

CreateAPIKey is a handler that will create a new API key (non-admin keys only)

func CreateAccount

func CreateAccount(w http.ResponseWriter, req *http.Request)

CreateAccount will create a new account

func CreateAuthKey

func CreateAuthKey(w http.ResponseWriter, req *http.Request)

CreateAuthKey is a handler that will create a new auth key

func CreateBox

func CreateBox(w http.ResponseWriter, req *http.Request)

CreateBox creates a new box under a specific parent box or 0 for a root box

func CreateWebhook

func CreateWebhook(w http.ResponseWriter, req *http.Request)

CreateWebhook is a handler that will create a new webhook

func DeleteAPIKey

func DeleteAPIKey(w http.ResponseWriter, req *http.Request)

DeleteAPIKey will remove a key

func DeleteAuthKey

func DeleteAuthKey(w http.ResponseWriter, req *http.Request)

DeleteAuthKey will remove a key

func DeleteBox

func DeleteBox(w http.ResponseWriter, req *http.Request)

DeleteBox deletes a given box with all messages (note: what about child boxes??)

func DeleteIncoming

func DeleteIncoming(w http.ResponseWriter, req *http.Request)

DeleteIncoming is called whenever we want to completely remove a message by user request

func DeleteMessage

func DeleteMessage(w http.ResponseWriter, req *http.Request)

DeleteMessage will delete a message

func DeleteWebhook

func DeleteWebhook(w http.ResponseWriter, req *http.Request)

DeleteWebhook will remove a webhook

func DisableWebhook

func DisableWebhook(w http.ResponseWriter, req *http.Request)

DisableWebhook will enable a webhook

func EnableWebhook

func EnableWebhook(w http.ResponseWriter, req *http.Request)

EnableWebhook will enable a webhook

func GetAPIKey

func GetAPIKey(req *http.Request) *key.APIKeyType

GetAPIKey returns the api key stored in the request context. returns nil when not found

func GetAPIKeyDetails

func GetAPIKeyDetails(w http.ResponseWriter, req *http.Request)

GetAPIKeyDetails will get a key

func GetAuthKey

func GetAuthKey(req *http.Request) *key.AuthKeyType

GetAuthKey will return the auth key if any. Returns nil when not found

func GetAuthKeyDetails

func GetAuthKeyDetails(w http.ResponseWriter, req *http.Request)

GetAuthKeyDetails will get a key

func GetClientToServerTicket

func GetClientToServerTicket(w http.ResponseWriter, req *http.Request)

GetClientToServerTicket will try and retrieves a valid ticket so we can upload messages. It is allowed to have a remote destination address as this is used by clients to upload messages for remote servers (client-to-server communication). Tickets here are always validated, since we need client authentication in order to fetch them.

func GetMessage

func GetMessage(w http.ResponseWriter, req *http.Request)

GetMessage will return a message header and catalog

func GetMessageAttachment

func GetMessageAttachment(w http.ResponseWriter, req *http.Request)

GetMessageAttachment will return a message attachment

func GetMessageBlock

func GetMessageBlock(w http.ResponseWriter, req *http.Request)

GetMessageBlock will return a message block

func GetServerToServerTicket

func GetServerToServerTicket(w http.ResponseWriter, req *http.Request)

GetServerToServerTicket will try and retrieve a (valid) ticket so we can upload messages. It is only allowed to have a local destination address as this is used for local only (server-to-server communication)

func GetWebhookDetails

func GetWebhookDetails(w http.ResponseWriter, req *http.Request)

GetWebhookDetails will get a webhook

func HomePage

func HomePage(w http.ResponseWriter, req *http.Request)

HomePage Information header on root /

func IncomingMessageAttachment

func IncomingMessageAttachment(w http.ResponseWriter, req *http.Request)

IncomingMessageAttachment deals with uploading message attachments

func IncomingMessageBlock

func IncomingMessageBlock(w http.ResponseWriter, req *http.Request)

IncomingMessageBlock deals with uploading message blocks

func IncomingMessageCatalog

func IncomingMessageCatalog(w http.ResponseWriter, req *http.Request)

IncomingMessageCatalog deals with uploading message catalogs

func IncomingMessageHeader

func IncomingMessageHeader(w http.ResponseWriter, req *http.Request)

IncomingMessageHeader deals with uploading message headers

func IsAPIKeyAuthenticated

func IsAPIKeyAuthenticated(req *http.Request) bool

IsAPIKeyAuthenticated returns true when the given request is authenticated by a api key

func IsAuthKeyAuthenticated

func IsAuthKeyAuthenticated(req *http.Request) bool

IsAuthKeyAuthenticated returns true when the given request is authenticated by a auth key

func IsOriginServer

func IsOriginServer(addr hash.Hash) bool

IsOriginServer will return true when the sender of the header originates from this server. False otherwise

func ListAPIKeys

func ListAPIKeys(w http.ResponseWriter, req *http.Request)

ListAPIKeys returns a list of all keys for the given account

func ListAuthKeys

func ListAuthKeys(w http.ResponseWriter, req *http.Request)

ListAuthKeys returns a list of all keys for the given account

func ListWebhooks

func ListWebhooks(w http.ResponseWriter, req *http.Request)

ListWebhooks returns a list of all webhooks for the given account

func RetrieveBoxes

func RetrieveBoxes(w http.ResponseWriter, req *http.Request)

RetrieveBoxes retrieves all message boxes for the given account

func RetrieveKeys

func RetrieveKeys(w http.ResponseWriter, req *http.Request)

RetrieveKeys is the handler that will retrieve public keys directly from the mail server

func RetrieveMessagesFromBox

func RetrieveMessagesFromBox(w http.ResponseWriter, req *http.Request)

RetrieveMessagesFromBox retrieves info about the given mailbox

func RetrieveOrganisation added in v0.0.1

func RetrieveOrganisation(w http.ResponseWriter, req *http.Request)

RetrieveOrganisation is the handler that will retrieve organisation settings

func StoreDelete

func StoreDelete(w http.ResponseWriter, req *http.Request)

StoreDelete will remove a path or collection

func StoreGet

func StoreGet(w http.ResponseWriter, req *http.Request)

StoreGet will retrieve a path or collection

func StoreUpdate

func StoreUpdate(w http.ResponseWriter, req *http.Request)

StoreUpdate will update a path or collection

func UpdateWebhook

func UpdateWebhook(w http.ResponseWriter, req *http.Request)

UpdateWebhook is a handler that will update a webhook

func ValidateTicket

func ValidateTicket(w http.ResponseWriter, req *http.Request)

ValidateTicket will validate a ticket response

Types

type RequestType

type RequestType struct {
	Sender         hash.Hash `json:"sender"`
	Recipient      hash.Hash `json:"recipient"`
	SubscriptionID string    `json:"subscription_id"`
	Preference     []string  `json:"preference"`
}

RequestType is a request for a ticket

type UpdateType

type UpdateType struct {
	Path      hash.Hash       `json:"path"`
	Parent    *hash.Hash      `json:"parent"`
	Value     []byte          `json:"value"`
	Signature []byte          `json:"signature"`
	PubKey    bmcrypto.PubKey `json:"public_key"`
}

UpdateType is a request for a store entry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL