about summary refs log tree commit diff stats
path: root/worker/types
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-31 21:54:52 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-31 21:54:52 -0500
commit3139148c7b9ad6ed4fb9cd8cd3e4160a9b9ee46f (patch)
tree1bb500628bae5f6b64167e498b25ff09649a977c /worker/types
parenta21afdaa6bab8f6d05bbe9272700eef571548a59 (diff)
downloadaerc-3139148c7b9ad6ed4fb9cd8cd3e4160a9b9ee46f.tar.gz
Add certificate approval flow
Diffstat (limited to 'worker/types')
-rw-r--r--worker/types/messages.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go
index e83bd6b..5259342 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -1,6 +1,8 @@
 package types
 
 import (
+	"crypto/x509"
+
 	"git.sr.ht/~sircmpwn/aerc2/config"
 )
 
@@ -12,6 +14,16 @@ type Message struct {
 	inResponseTo WorkerMessage
 }
 
+func RespondTo(msg WorkerMessage) Message {
+	return Message{
+		inResponseTo: msg,
+	}
+}
+
+func (m Message) InResponseTo() WorkerMessage {
+	return m.inResponseTo
+}
+
 // Meta-messages
 
 type Ack struct {
@@ -27,7 +39,7 @@ type Unsupported struct {
 	Message
 }
 
-// Commands
+// Actions
 
 type Ping struct {
 	Message
@@ -46,12 +58,10 @@ type Disconnect struct {
 	Message
 }
 
-func RespondTo(msg WorkerMessage) Message {
-	return Message{
-		inResponseTo: msg,
-	}
-}
+// Messages
 
-func (m Message) InResponseTo() WorkerMessage {
-	return m.inResponseTo
+// Respond with an Ack to approve or Disconnect to reject
+type ApproveCertificate struct {
+	Message
+	CertPool *x509.CertPool
 }