summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide/auth.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-01-31 12:15:06 -0600
committerkali kaneko (leap communications) <kali@leap.se>2020-08-20 20:27:41 +0200
commit8bb41cff9f47895e00d7773dfd9372a7e17fae59 (patch)
tree8c7658ec44f9df7af01aaf8391c3d66ab1686b4e /pkg/vpn/bonafide/auth.go
parentefdeba8e994669ccd21c50d2b7491905b47a217e (diff)
[refactor] refactor auth files
Diffstat (limited to 'pkg/vpn/bonafide/auth.go')
-rw-r--r--pkg/vpn/bonafide/auth.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/vpn/bonafide/auth.go b/pkg/vpn/bonafide/auth.go
index b6b3eec..62d3d8f 100644
--- a/pkg/vpn/bonafide/auth.go
+++ b/pkg/vpn/bonafide/auth.go
@@ -15,7 +15,16 @@
package bonafide
-type Credentials struct {
+type credentials struct {
User string
Password string
}
+
+// The authentication interface allows to get a Certificate in Pem format.
+// We implement Anonymous Authentication (Riseup et al), and Sip (Libraries).
+
+type authentication interface {
+ needsCredentials() bool
+ getToken(cred *credentials) ([]byte, error)
+ getPemCertificate(cred *credentials) ([]byte, error)
+}