summaryrefslogtreecommitdiff
path: root/client/client.go
AgeCommit message (Collapse)Author
2023-09-25Client: Relax state requirements for No Server on addjwijenbergh
2023-09-25Client: Fix institute servers map typojwijenbergh
2023-09-25Client: Return on refresh endpoints context errorjwijenbergh
2023-09-25Client: Re-create failover object on new calljwijenbergh
This additional bookkeeping is not needed now because we have contexts
2023-09-25All: Implement a token handlerjwijenbergh
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
2023-09-25Refactor: Move client implementation to one filejwijenbergh
Much easier to oversee and it forces me to keep the client type as small as possible. This also uses the cookie for cancellation We also no longer require tokens inside arguments. We will later implement them with callbacks
2023-09-25Exports + Client: Refactor registering a clientjwijenbergh
- Make sure the global exports state is only set on successful creating - Only call discovery when adding a server to ensure we get the most up to date args. Creating a client should have no network calls. Fixes #12 - Split creating a client in New and Register in the GO api
2023-09-25Exports + Client Register: Make sure to only update state if no errjwijenbergh
2023-09-25Client: Check if the base time is zero when getting expiry timesjwijenbergh
2023-09-25Client: Remove servers argument to transitionjwijenbergh
2023-09-25Types: Split server into subpackagejwijenbergh
2023-09-25Types: Split discovery into its own packagejwijenbergh
2023-09-25Format: Run gofumptjwijenbergh
2023-09-25Types: Split protocol into its ownjwijenbergh
2023-09-25Client: Add functions to convert to public typesjwijenbergh
2023-04-18Client: Fix ask profile linter errorjwijenbergh
2023-04-18Client + Server: Implement a token updater callbackjwijenbergh
2023-03-01Client: Allow max version to be 20 charactersjwijenbergh
Bit long maybe but we shouldn't limit it too much
2023-03-01Client: Make user agent equal to client ID namesjwijenbergh
See https://git.sr.ht/~fkooman/vpn-user-portal/tree/v3/item/src/OAuth/VpnClientDb.php
2023-03-01Format: Run black and gofumptjwijenbergh
2023-03-01Client + Exports + HTTP: Set a user-agent using the client's versionjwijenbergh
2023-02-28Log: Use a global logger instancejwijenbergh
2023-01-31Client: Check if client ID is validjwijenbergh
2023-01-10Client + Discovery: Implement further organizations expiryjwijenbergh
2023-01-05Logger: Do not interpret error string as format specifier argumentjwijenbergh
2022-12-21Failover: Initial implementationjwijenbergh
2022-12-14Client: If debug, log with stacktracejwijenbergh
2022-12-12simplify error handlingAleksandar Pesic
fixes #6 Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
2022-11-28Log: Define f prefix for log functions to indicate printf likejwijenbergh
2022-11-28Formatting: Run gofumpt -wjwijenbergh
2022-11-28Refactor: Fix revive linter errors by deleting redundant prefixesjwijenbergh
2022-11-28Lint: Run godot fixjwijenbergh
Full command: golangci-lint run --disable-all -E godot --fix
2022-11-28Refactor: Remove most get prefixes for receiver functionsjwijenbergh
2022-11-28Document: Add comments for most functions and packagesjwijenbergh
Errors and test files still need to be done. Also some getters are changed by removing the 'get' prefix
2022-11-24Style: Use stylecheck and fix errorsjwijenbergh
2022-11-23FSM: Check unhandled transitionsjwijenbergh
2022-11-17Log: Add additional params to get rid of Sprintf callsjwijenbergh
2022-11-10Logging: Add a Debug leveljwijenbergh
This makes the levels more logical
2022-10-25Client + FSM: Remove background argument from transitionjwijenbergh
This fixes a race condition reported by Go's -race flag In the future we should use waitgroups to ensure the OAuth local listener is started before we sent the URL
2022-10-24Log: Rename log file to go.logjwijenbergh
2022-10-24Client + Server + Exports: Implement optional WireGuard supportjwijenbergh
2022-10-19Refactor: Make errors use the parent's error leveljwijenbergh
- All wrapped errors have to be created with types.NewWrappedError to inherit the error level from the parent - Or types.NewWrappedErrorLevel can be used which means a custom error level is given. For example this is done with cancelling OAuth - Client public errors are forwarded with handleError that also logs it with the error's level
2022-10-19Client: Separate into different filesjwijenbergh
2022-10-18Client: Move to its own packagejwijenbergh