summaryrefslogtreecommitdiff
path: root/docs/src/api
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-05-07 11:51:34 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-05-29 14:36:10 +0200
commit3ecfc012e2db8b464596faf2c3bd4db1cab8697b (patch)
treeb234ee9aa6729e56232786fee83f92cc5bbb63e3 /docs/src/api
parentb1033a6a39fe21fec99be5318ba3536af148a79b (diff)
Discovery: Implement search and do not return keywords
This patch implements search by adding a second argument to DiscoOrganizations and DiscoServers. A search string of = "" returns everything. This also makes the subset that is returned to the client even fewer, no keywords.
Diffstat (limited to 'docs/src/api')
-rw-r--r--docs/src/api/functiondocs.md52
1 files changed, 46 insertions, 6 deletions
diff --git a/docs/src/api/functiondocs.md b/docs/src/api/functiondocs.md
index 58134f7..5d7d9ac 100644
--- a/docs/src/api/functiondocs.md
+++ b/docs/src/api/functiondocs.md
@@ -289,19 +289,21 @@ Example Output:
## DiscoOrganizations
Signature:
```go
-func DiscoOrganizations(c C.uintptr_t) (*C.char, *C.char)
+func DiscoOrganizations(c C.uintptr_t, search *C.char) (*C.char, *C.char)
```
DiscoOrganizations gets the organizations from discovery, returned as
types/discovery/discovery.go Organizations marshalled as JSON
`c` is the Cookie that needs to be passed. Create a new Cookie using
-`CookieNew`
+`CookieNew` `search` is the search string for filtering the list. It checks
+for keywords and display name case insensitive as a substring matching.
+If search is empty it returns ALL organizations currently known in common
If it was unsuccessful, it returns an error. Note that when the lib was
built in release mode the data is almost always non-nil, even when an error
has occurred This means it has just returned the cached list
-Example Input: ```DiscoOrganizations(myCookie)```
+Example Input: ```DiscoOrganizations(myCookie, "")```
Example Output:
@@ -332,22 +334,41 @@ Example Output:
"secure_inte .....................
}, null
+Example Input: ```DiscoOrganizations(myCookie, "rash")```
+
+Example Output:
+
+ {
+ "v": 1695291170,
+ "organization_list": [
+ {
+ "display_name": {
+ "en": "Academic Network of Albania - RASH"
+ },
+ "org_id": "https://idp.rash.al/simplesaml/saml2/idp/metadata.php",
+ "secure_internet_home": "https://eduvpn.rash.al/"
+ },
+ }, null
+
## DiscoServers
Signature:
```go
-func DiscoServers(c C.uintptr_t) (*C.char, *C.char)
+func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char)
```
DiscoServers gets the servers from discovery, returned as
types/discovery/discovery.go Servers marshalled as JSON
`c` is the Cookie that needs to be passed. Create a new Cookie using
-`CookieNew`
+`CookieNew` `search` is the search string for filtering the list. It checks
+for keywords and display name case insensitive as a substring matching.
+If search is empty it returns ALL servers currently known in common,
+including secure internet servers that do not have a display name set
If it was unsuccessful, it returns an error. Note that when the lib was
built in release mode the data is almost always non-nil, even when an error
has occurred This means it has just returned the cached list
-Example Input: ```DiscoServers(myCookie)```
+Example Input: ```DiscoServers(myCookie, "")```
Example Output:
@@ -373,6 +394,25 @@ Example Output:
], ..................
} , null
+Example Input: ```DiscoServers(myCookie, "heanet")```
+
+Example Output:
+
+ {
+ "v": 1695291170,
+ "server_list": [
+ {
+ "base_url": "https://eduvpn.heanet.ie/",
+ "display_name": "HEAnet Staff",
+ "server_type": "institute_access",
+ "support_contact": [
+ "mailto:noc@heanet.ie",
+ "tel:+35316609040"
+ ]
+ },
+ ]
+ } , null
+
## ExpiryTimes
Signature:
```go