From 8bb41cff9f47895e00d7773dfd9372a7e17fae59 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 31 Jan 2020 12:15:06 -0600 Subject: [refactor] refactor auth files --- pkg/vpn/bonafide/auth.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pkg/vpn/bonafide/auth.go') 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) +} -- cgit v1.2.3