summaryrefslogtreecommitdiff
path: root/docs/src/api/overview
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-04 22:00:41 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-04 22:00:41 +0100
commitb9b62c59dc99b63c5128f10a22774e3722b8b140 (patch)
tree1eacc6ada17c14eea1e3e566f481264426b139ca /docs/src/api/overview
parentac41bda1e059d24da08e584b81b4507cf781beb8 (diff)
Docs: Update to be closer in line with the latest API
Diffstat (limited to 'docs/src/api/overview')
-rw-r--r--docs/src/api/overview/discovery.md49
-rw-r--r--docs/src/api/overview/getconfig.md52
2 files changed, 11 insertions, 90 deletions
diff --git a/docs/src/api/overview/discovery.md b/docs/src/api/overview/discovery.md
index 0999912..4004ec4 100644
--- a/docs/src/api/overview/discovery.md
+++ b/docs/src/api/overview/discovery.md
@@ -4,7 +4,7 @@ Name: `Get Disco Servers` and `Get Disco Organizations`
Arguments: None
-Returns: `JSON string for servers/organizations` and `Error for servers/organizations`
+Returns: `structure for servers/organizations` and `Error for servers/organizations`
Note: Depending on the wrapper they may be combined into one function, the return value of this function is then the following:
`organizations, error for organizations, servers, errors for servers`
@@ -13,51 +13,6 @@ Used to obtain the servers and organizations list from the discovery server.
## Detailed information
Discovery is the aspect of eduVPN that allows a client to gather all the servers and organizations it can connect to. For this a discovery server is used, which is registered as `https://disco.eduvpn.org` in the library. We refer to the [official eduVPN documentation](https://github.com/eduvpn/documentation/blob/v3/SERVER_DISCOVERY.md) to learn more about the exact way that these organizations and servers are structured.
-The JSON data that this returns must be used by the client to build an UI. It is common for clients that the discovery functions get called on startup of the client. Note that there can be an error in retrieving the newest version of the servers/organizations. However, this library's goal is to ensure that a version is always available. Thus, a local copy is distributed with this library in the future.
+The data that this returns must be used by the client to build an UI. It is common for clients that the discovery functions get called on startup of the client. Note that there can be an error in retrieving the newest version of the servers/organizations. However, this library's goal is to ensure that a version is always available. Thus, a local copy is distributed with this library in the future.
This library also internally looks at the version of the servers and organizations such that rollbacks attacks are prevented. The client does not have to do any additional checks for this.
-
-The structure of the JSON data is the structure in the [official eduVPN documentation](https://github.com/eduvpn/documentation/blob/v3/SERVER_DISCOVERY.md) without the `v` (version) field. So, for example, the servers list has a possible JSON structure of this:
-
-```json
-[
- {
- "server_type": "institute_access",
- "base_url": "https://hku.eduvpn.nl/",
- "display_name": {
- "en-US": "Utrecht School of the Arts",
- "nl-NL": "Hogeschool voor de Kunsten Utrecht"
- },
- "keyword_list": "hku"
- },
- {
- "server_type": "secure_internet",
- "base_url": "https://eduvpn.rash.al/",
- "country_code": "AL",
- "support_contact": [
- "mailto:helpdesk@rash.al"
- ]
- }
-]
-```
-
-And the organizations list has a possible JSON structure of the following:
-
-```json
-[
- {
- "display_name": {
- "nl": "SURFnet bv",
- "en": "SURFnet bv"
- },
- "org_id": "https://idp.surfnet.nl",
- "secure_internet_home": "https://nl.eduvpn.org/",
- "keyword_list": {
- "en": "SURFnet bv SURF konijn surf surfnet powered by",
- "nl": "SURFnet bv SURF konijn powered by"
- }
- }
-]
-```
-
-
diff --git a/docs/src/api/overview/getconfig.md b/docs/src/api/overview/getconfig.md
index 4e1e9fb..2a05784 100644
--- a/docs/src/api/overview/getconfig.md
+++ b/docs/src/api/overview/getconfig.md
@@ -1,11 +1,11 @@
# Getting an OpenVPN/Wireguard config
## Summary
-name: `Get Config Institute Access` and `Get Config Secure Internet`
+name: `Get Config Institute Access`, `Get Config Custom Server` and `Get Config Secure Internet`
-| Arguments | Description | type |
-| --------- | ---------------------------------------- | -------- |
-| URL | The url of the VPN server to connect to | string |
-| Prefer TCP | Whether or not to prefer the use of TCP | string |
+| Arguments | Description | type |
+| --------- | ----------------------------------------------- | -------- |
+| Identifier | The url/org ID of the VPN server to connect to | string |
+| Prefer TCP | Whether or not to prefer the use of TCP | string |
Returns: `OpenVPN/Wireguard config (string)` `wireguard/openvpn type (string)`, `Error`
@@ -13,10 +13,10 @@ Used to obtain the OpenVPN/Wireguard config
## Detailed information
-To get a configuration that is used to actually establish a tunnel with the VPN server, we have the Get Config function for Institute Access and Secure Internet (the exact name depends on the language you're using) function in the library. This function has two parameters *URL* and *Prefer TCP*.
+To get a configuration that is used to actually establish a tunnel with the VPN server, we have the Get Config function for Institute Access, Custom Servers and Secure Internet (the exact name depends on the language you're using) function in the library. This function has two parameters *URL* and *Prefer TCP*.
-*URL* is the base url of the server to connect to
-e.g. `nl.eduvpn.org`. Use the correct function to indicate if it is an Institute Access server or a Secure Internet server. A user configured server is often an Institute Access server. In case of a Secure Internet server and no Secure Internet was configured previously, this URL is set as the home server. This means that this server is set as the authorization server for all secure internet servers.
+*URL/OrgID* is the base URL of the server to connect to
+e.g. `nl.eduvpn.org` in case of Institute Access or a Custom Server. In case of Secure Internet, the identifier is the Organization ID. Use the correct function to indicate if it is an Institute Access server or a Secure Internet server.
The *Prefer TCP* flag is a boolean that indicates whether or not we want to prefer TCP to connect over the VPN. This flag is useful if the user has enabled e.g. a setting that prefers the use of TCP, which is only supported by OpenVPN. Note that this setting may be ignored by the server.
@@ -38,39 +38,5 @@ This callback can be cancelled by using a `Cancel OAuth` function.
### Callback: Selecting a profile (Ask_Profile)
-Another aspect that needs to be taken into account is the fact that there can be multiple profiles that a client can connect to. When the function gets called for obtaining an OpenVPN/Wireguard configuration, it asks the client which profile it wants to connect to using the callback that gets triggered on the Ask Profile state. The data is the list of profiles in JSON format, e.g.
-
-```json
-{
- "info": {
- "profile_list": [
- {
- "profile_id": "internet",
- "default_gateway": true,
- "display_name": "IPv4 (NAT) IPv6 (GUA) Access",
- "vpn_proto_list": [
- "openvpn"
- ]
- },
- {
- "profile_id": "adblock",
- "default_gateway": true,
- "display_name": "Malware/Tracking-Blocker IPv4 (NAT) IPv6 (GUA)",
- "vpn_proto_list": [
- "openvpn"
- ]
- },
- {
- "profile_id": "dnsonly",
- "default_gateway": false,
- "display_name": "DNS-Only & Malware/Tracking-Blocker (experimental)",
- "vpn_proto_list": [
- "openvpn"
- ]
- }
- ]
- }
-}
-```
-
+Another aspect that needs to be taken into account is the fact that there can be multiple profiles that a client can connect to. When the function gets called for obtaining an OpenVPN/Wireguard configuration, it asks the client which profile it wants to connect to using the callback that gets triggered on the Ask Profile state. The data is the list of profiles
For actually selecting the profile, there is a separate function which takes care of this. This function takes as only argument the profile ID as a string.