summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-09-25Verify Test: Use callStr on errorjwijenbergh
2023-09-25OAuth Token: Set previous refresh token if new refresh token is emptyjwijenbergh
This is for 2.x servers that return an empty refresh token after refreshing
2023-09-25Custom: Use the hostname for custom servers display namejwijenbergh
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-25Server: Support unmarshalling server as a stringjwijenbergh
This is for V1 configs
2023-09-25Wrappers Python: Get rid of optional as returnjwijenbergh
If an error is non-nil, the data is guaranteed to contain a value For discovery we do not explicitly forward errors (TODO, log in the wrapper?). However, when building in release mode, we have embedded disco so even if we get an error we should have guaranteed that it contains a value
2023-09-25Client: Re-create failover object on new calljwijenbergh
This additional bookkeeping is not needed now because we have contexts
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-25Python: Get rid of token callbackjwijenbergh
2023-09-25Exports: Remove token updaterjwijenbergh
2023-09-25CLI: Implement newest API using cookiesjwijenbergh
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-25Wrappers Python: Update to newest API by implementing cookiesjwijenbergh
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-25Types Server: Implement required ask transition needed for clientjwijenbergh
2023-09-25Types: Add a new cookie typejwijenbergh
Used as a specialized context in state callbacks and for cancellation
2023-09-25OAuth: Implement the Public() method for tokensjwijenbergh
2023-09-25Refactor: Split internal server into multiple packagesjwijenbergh
- Pass contexts - Have separate packages for e.g. custom, institute and secure - internet servers, profiles.... - Return types from the public ./types package with a Public() method
2023-09-25HTTP: Pass context around and optionally trail path in urljwijenbergh
2023-09-25OAuth: Pass a context aroundjwijenbergh
2023-09-25Failover: Pass a context aroundjwijenbergh
2023-09-25Types Server: Pass locations to secure internetjwijenbergh
2023-09-25Format: Run gofumpt (Go) + black (py)jwijenbergh
2023-09-25Discovery: Pass a context aroundjwijenbergh
2023-09-25Client: Improve Let's Connect! not supported errorsjwijenbergh
2023-09-25Client: failover cancel error should be lowercasejwijenbergh
2023-09-25Client: Remove OpenVPN check for failover and check if in progressjwijenbergh
2023-09-25Wrappers Python: Separate BoolError data type to get rid of decode_funcjwijenbergh
2023-09-25Fix connection monitoring on WindowsSimon Rozman
Linux requires su for `ip4:icmp` pings. Windows does not support `udp4` pings. Signed-off-by: Simon Rozman <simon@rozman.si>
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-25API Overview: Typosjwijenbergh
2023-09-25API Overview: Add notes about freeing and deregisteringjwijenbergh
2023-09-25Docs API: Add link to types/serverjwijenbergh
2023-09-25Wrappers Python: Delete version number requirementsjwijenbergh
Otherwise we have to constantly update this doc if we change it
2023-09-25Docs + Types server: Add comments about script-securityjwijenbergh
2023-09-25Docs API: Update links to .mdjwijenbergh
2023-09-25Docs Debugging: Link to API staatesjwijenbergh
2023-09-25Docs Debugging: Update FSM SVGjwijenbergh
2023-09-25Docs API: Fix go boolean, add errors section and renew transitionjwijenbergh
2023-09-25Exports: Return nil on nil errorjwijenbergh
Co-authored-by: rozmansi <simon@rozman.si>
2023-09-25Types: Add comments describing the fields, types, packages and functionsjwijenbergh
2023-09-25Python Tests: Handle OAuth Started transitionjwijenbergh
2023-09-25Docs API: Fix Got Config descriptionjwijenbergh
2023-09-25Docs API: Add more state explanationjwijenbergh
2023-09-25Exports + Python: Compare booleans with != 0 instead of == 1jwijenbergh
Reported by: Simon Rozman <simon@rozman.si>
2023-09-25Docs: Remove outdated documentsjwijenbergh