diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-04-13 15:25:42 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | f6f4396a81ce662eb5fb50c4f9fef92ffaadb333 (patch) | |
| tree | 3e6b1c3ecc049c1aa377c8ca813f00b96437d2f3 /types/server | |
| parent | 5610dca6c5e391ee62874c4d6cb25072d9c3c1d9 (diff) | |
All: Implement a token handler
This implements a token handler for OAuth tokens. Clients can use the SetTokenHandler
function in exports to set a token handler.
It needs two arguments, a getter and a setter. The getter is a callback with three arguments:
- The server to get the tokens for, in types.server.current as JSON
- The output buffer
- The output buffer maximum length
The tokens should be written to the output buffer with maximum
length. The type should be types.server.Tokens and be marshalled as
JSON. If no tokens are available, leave the output buffer intact
The token setter is a callback with two arguments:
- The server for which to set the tokens for, in types.server.Current as JSON
- The tokens, defined in types.server.Tokens as JSON
Breaking changes:
- No more tokens as arguments, was already deprecated in previous commits
- Tokens are no longer returned in types.server.Configuration
Diffstat (limited to 'types/server')
| -rw-r--r-- | types/server/server.go | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/types/server/server.go b/types/server/server.go index 1578f29..aea496d 100644 --- a/types/server/server.go +++ b/types/server/server.go @@ -130,9 +130,6 @@ type Configuration struct { Protocol protocol.Protocol `json:"protocol"` // DefaultGateway is a boolean that indicates whether or not this configuration should be configured as a default gateway DefaultGateway bool `json:"default_gateway"` - // Tokens is the updated tokens that we get back from the VPN configuration - // They should be used by the client to save them in e.g. the keyring - Tokens Tokens `json:"tokens"` } // Current is the struct that defines the current server |
