summaryrefslogtreecommitdiff
path: root/exports
AgeCommit message (Collapse)Author
2023-09-25Exports: Remove unused error.hjwijenbergh
2023-09-25Version: Update to 2.0.0jwijenbergh
2023-09-25Exports: Fix void signature for TokenGetterjwijenbergh
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-25Exports: Remove token updaterjwijenbergh
2023-09-25Exports: Implement newest API using cookie handlersjwijenbergh
BREAKING CHANGES: - The following functions need a special "cookie" as the first argument - Add server (also now has an extra int as last argument, if non 0 run no callbacks, useful for preprovisioned servers) - Get config - Set secure location - Disco servers - Disco organizations - Cleanup - Renew session - Start failover Removed functions: - "CancelOAuth", "CancelFailover" replaced by "CookieCancel" - SecureLocationList, removed because the secure internet server from ServerList() now has the locations embedded in the JSON A cookie is a specialized context that can be used for cancellation and sending values across a channel. Cancel OAuth and Cancel failover functions have thus been removed. Instead, create a cookie with "CookieNew", pass it to the function as the first argument and when you want to cancel, run "CookieCancel". The functions mentioned above use network requests, or some other long running procedure. Even though we have a timeout set to 10 seconds for failover and network requests, it might make sense to make this longer and just have clients cancel the request. Cookies that have been created with "CookieNew" must be freed with CookieDelete, which cancels the cookie and then deletes the underlying handle. Because cookies have a channel associated with them, they are used for replying to state callbacks. When you receive an ASK_PROFILE or ASK_LOCATION request, you get the same cookie back that you have created when passed to the function (key "cookie" in the state data). Reply with your answer (the profile or location) with "CookieReply" passing in the cookie as first argument and the data as second. This means that SetProfileID and SetSecureLocation should now only be used when not in a state callback. E.g. just changing the profile or location when triggered by the user. Finally, when a cookie is canceled, the error that is returned by the function inherits from the Go context cancellation error: https://pkg.go.dev/context#pkg-variables ("context canceled")
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-25Exports: Return nil on nil errorjwijenbergh
Co-authored-by: rozmansi <simon@rozman.si>
2023-09-25Exports + Python: Compare booleans with != 0 instead of == 1jwijenbergh
Reported by: Simon Rozman <simon@rozman.si>
2023-09-25Exports + Python + Server: Remove ShouldRenewButtonjwijenbergh
This is replace with expiry times
2023-09-25Tests: Pass for V2 APIjwijenbergh
2023-09-25Exports + Python: Use an enum for server typejwijenbergh
2023-09-25Types: Split server into subpackagejwijenbergh
2023-09-25Exports: Implement initial V2 APIjwijenbergh
The main change is that we now use JSON from types listed at the `types` package
2023-09-25Exports: Remove server.hjwijenbergh
2023-09-01Version: Update to 1.1.21.1.2jwijenbergh
2023-08-29Version: Update to 1.1.11.1.1jwijenbergh
2023-04-18Version: Update to 1.1.01.1.0jwijenbergh
2023-04-18Exports Disco: Safeguard against nil servers/organizationsjwijenbergh
2023-04-18Exports: Do not crash on invalid wrapped errorsjwijenbergh
2023-04-18Client + Server: Implement a token updater callbackjwijenbergh
2023-03-01Version: Update to 1.0.0jwijenbergh
2023-03-01Version: Downgrade to 0.99.0jwijenbergh
2023-03-01Client + Exports + HTTP: Set a user-agent using the client's versionjwijenbergh
2023-02-28Version: Prepare 1.0.0jwijenbergh
2023-02-28Refactor: Remove error leveljwijenbergh
Not useful enought just yet
2023-02-27Exports Disco + Python: Make sure we can always obtain the local cachejwijenbergh
2023-02-01Version: Bump to 0.3.0jwijenbergh
2023-01-13Client + Exports: Separate cleanup from disconnectjwijenbergh
2023-01-03Format: Run gofumptjwijenbergh
2023-01-02Exports: Use unsafe.Slice for C slice conversionjwijenbergh
This is possible now as we require Go 1.17
2022-12-21Version: Bump to 0.2.0jwijenbergh
2022-12-21Client + Exports: Forward tokens for /disconnectjwijenbergh
2022-12-21Exports + OAuth + Server: Forward tokens to getting a configjwijenbergh
2022-12-21Failover: Initial implementationjwijenbergh
2022-12-12Format: Run gofumptjwijenbergh
2022-12-12Server + Exports: Rename and simplify GetCurrentProfileIndexjwijenbergh
2022-12-12simplify error handlingAleksandar Pesic
fixes #6 Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
2022-11-28Linter: Fix dupword errorsjwijenbergh
2022-11-28Formatting: Run golinesjwijenbergh
2022-11-28Formatting: Run gofumpt -wjwijenbergh
2022-11-28Refactor: Fix revive linter errors by deleting redundant prefixesjwijenbergh
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-25Discovery + Exports: Rename variable to not clash with server pkgjwijenbergh
2022-11-24Style: Use stylecheck and fix errorsjwijenbergh
2022-11-23FSM: Check unhandled transitionsjwijenbergh
2022-11-10Exports + Python: Return locations for a secure internet serverjwijenbergh
2022-10-26Client + Exports + Python: Add a function for getting the current serverjwijenbergh