summaryrefslogtreecommitdiff
path: root/internal/api/endpoints/endpoints.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-12 19:18:05 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit74e36f0ead717105f26087c2cab08b41ba5a7ce8 (patch)
tree1eb2b7516bea705c9b5a50ce0965e170414ed880 /internal/api/endpoints/endpoints.go
parent682d70091af2044ff6d8b350da9dff13163232e2 (diff)
All: Document everything to pass revive lint
Diffstat (limited to 'internal/api/endpoints/endpoints.go')
-rw-r--r--internal/api/endpoints/endpoints.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/api/endpoints/endpoints.go b/internal/api/endpoints/endpoints.go
index 11e244b..c98d2c7 100644
--- a/internal/api/endpoints/endpoints.go
+++ b/internal/api/endpoints/endpoints.go
@@ -1,3 +1,5 @@
+// Package endpoints defines a wrapper around the various
+// endpoints returned by an eduVPN server in well-known
package endpoints
import (
@@ -5,21 +7,30 @@ import (
"net/url"
)
+// List is the list of endpoints as returned by the eduVPN server
type List struct {
- API string `json:"api_endpoint"`
+ // API is the API endpoint which we use for calls such as /info, /connect, ...
+ API string `json:"api_endpoint"`
+ // Authorization is the authorization endpoint for OAuth
Authorization string `json:"authorization_endpoint"`
- Token string `json:"token_endpoint"`
+ // Token is the token endpoint for OAuth
+ Token string `json:"token_endpoint"`
}
+// Versions is the endpoints separated by API version
type Versions struct {
+ // V2 is the legacy V2 API, this is not used
V2 List `json:"http://eduvpn.org/api#2"`
+ // V3 is the newest API, which we use
V3 List `json:"http://eduvpn.org/api#3"`
}
// Endpoints defines the json format for /.well-known/vpn-user-portal".
type Endpoints struct {
+ // API defines the API endpoints, split by version
API Versions `json:"api"`
- V string `json:"v"`
+ // V is the version string for the server
+ V string `json:"v"`
}
// Validate validates the endpoints by parsing them and checking the scheme is HTTP