Commit Graph
68 Commits
Author SHA1 Message Date
Jordan Dominion 9e8bdde30c Remove HttpClient abstractions
Now implement mocked `HttpMessageHandler`s as recommended: https://stackoverflow.com/a/36427274/3976486
2025-07-27 15:34:33 -04:00
Jordan Dominion 07a317ed81 Apply some code suggestions 2024-09-21 16:39:17 -04:00
Jordan Dominion c6f30f7f7e Fix a CA1506 warning 2024-09-21 12:21:08 -04:00
Jordan Dominion f37883a438 Hopefully fix issues with auth pipeline for good 2024-09-21 10:58:17 -04:00
Jordan Dominion 5c5b54e094 Update to beta Stylecop
Cleanup warnings
2023-11-23 16:50:52 -05:00
Jordan Dominion 9e1806a2b4 Move all API functionality to /api.
Move `BridgeController` route but BYOND forces us to support the legacy one as well.
Add a basic homepage if it's not obvious where to redirect the user.

Closes #1689
2023-11-10 23:18:20 -05:00
Jordan Dominion 1e1c5fddf8 Merge branch 'V6' into 1693-Shrimple 2023-11-07 08:44:30 -05:00
Jordan Dominion 4b49e072db Merge branch 'dev' into V6 2023-11-07 08:26:38 -05:00
Jordan Dominion 90d41cc88d Replace HTTP 426 with 400
Notable exception is the swarm API, which still uses 426 for version mismatches and would be a pain in the ass to change correctly.

Closes #1693
2023-11-06 17:56:03 -05:00
Jordan Dominion 72388f8035 Add necessary ObjectDisposedException to client 2023-11-06 17:44:45 -05:00
Jordan Dominion 5f6e3d340c Merge branch 'dev' into V6 2023-11-06 17:37:48 -05:00
Jordan Dominion 9bea7686b2 Add automatic reconnect to client hubs 2023-11-06 16:39:23 -05:00
Jordan Dominion d85e2b8d36 Add SignalR
- Add one hub `/hubs/jobs`, strongly typed API included.
- Adjust request pipeline to support SignalR.
- Allow `Accept: text/event-stream` for SSE requests.
- Add client library support for hubs.
- Add integration tests.
- Add IPermissionSetNotifyee to support dynamic changes based on perms.
- Keep job state in `JobService` for pushing updates.
2023-11-04 19:22:48 -04:00
Jordan Dominion 29579a351d Fix JWT compliance issues.
- `nbf` and `exp` should be numbers, not strings.
- Parse JWT in `ApiHeaders` fully for errors.
- Use `iat` and increment `nbf` by one second if equal and may trigger the `LastPasswordUpdate` bug.
  - Make client aware of this change and move the delay there.
- Deprecated `TokenResponse.ExpiresAt`.
2023-10-31 23:16:18 -04:00
Jordan Dominion 30f57d28da Store TokenResponse in ApiHeaders
- Decode it from JWT if necessary.
2023-10-29 16:22:51 -04:00
Jordan Dominion 4c07495ba4 One less async ValueTask 2023-08-13 23:36:36 -04:00
Jordan Dominion 3b6f4e947a Merge branch 'dev' into ValueTasks 2023-08-13 23:36:21 -04:00
Jordan Dominion fa50b61b8f Activating more style analyzers 2023-07-03 22:36:26 -04:00
Jordan Dominion 6695cbd168 Fix failing tests 2023-06-27 23:43:01 -04:00
Dominion 4471391b96 ValueTask Tgstation.Server.Client 2023-06-14 12:30:00 -04:00
Dominion e596110018 Clean up Tgstation.Server.Common
- Move classes to `Http` namespace.
- Give it a unique package version.
- Comment to make me not rage update Nuget libs to .NET 6.
2023-06-10 17:04:04 -04:00
Dominion 22c3f591fe Allow specifying HttpCompletionOption in IHttpClient 2023-06-10 11:18:21 -04:00
Dominion eaf641648a Fixes streams being passed into IByondClient getting disposed 2023-05-29 10:55:06 -04:00
Dominion 96d3269836 Fix using without await 2023-04-29 16:18:41 -04:00
Dominion 4793012413 Test resistance to rate limit issues
- Unsealed ApiClient to allow tests to override with rate limit aware client that waits for rate limits to clear.
- Allowed injecting into ServerClientFactory's static ApiClientFactory.
- Use Octokit provided function for calculating retry delays.
- Fixed a rogue newline semicolon.
- Moved downgrade migrations test out of live tests.
- Admin tests now check for V5 releases.
- Fixed not disposing a StringContent in ApiClient.
- Bump client patch version.
- Added missing .ConfigureAwait(false) to async ApiClient call.
2023-04-29 15:14:22 -04:00
Dominion 1d6cc3bc74 Add missing Delete<TBody, TResult> overload to IApiClient 2023-04-24 14:03:16 -04:00
Dominion a1b5dbe6ac Abstract HttpClient and FileDownloader
- Set all requests to use assemblyInformationProvider UserAgent by default.
- Removed DefaultIOManager's dependency on IAssemblyInformationProvider.
- Fixed bad Dispose scope for requests under construction in SwarmService.
2023-04-21 03:15:39 -04:00
Dominion 9e72e47bbc Various cleanups and test parallelization
- Fix a bunch of linter messages
- Document whitebox testing
- Fix race condition in deployment test with BYOND install
2023-04-16 23:28:18 -04:00
Jordan Brown 80e6eb2b10 Fix backwards compatibility issues 2022-09-27 00:41:24 -04:00
Jordan Brown ec5ec847d3 Fix client [TGSDeploy][NugetDeploy] 2021-10-07 18:49:55 -04:00
Jordan Brown cd71d77841 Added OAuth login methods to client[NugetDeploy][TGSDeploy] 2021-10-07 15:13:18 -04:00
Jordan Brown b9586c7fee The great stylecop update
Beware those that read into this commit. Here there be style conformance...

Closes #1252
2021-05-09 19:27:09 -04:00
Jordan Brown ac4a1c7f9b Add the Request/Response namespaces to Api.Models 2021-02-10 22:10:22 -05:00
Jordan Brown 47ea890040 WIP: Redoing request/response models 2021-02-10 11:07:08 -05:00
Jordan Brown 01d4a05c0d Mass Package Upgrade
- Bump all packages as high as possible
  - ASP .NET Core packages to 3.1.10
- Add a warning about the annoying LoggerFactory issue in host watchdog project
- Add missing exception constructors to client
- Switch to using the correct .NET analyzers
2020-12-16 18:46:40 -05:00
Jordan Brown 3e62191257 Adds UserGroups
- Added MinimumLength to several existing and new
StringLengthAttributes.
- Refactored permissions off User model to new PermissionSet model.
- Added UserGroups, which contain their own PermissionSet. A user can
have either a UserGroup or dedicated PermissionSet.
- Added UserGroupController and client for handling groups.
- Renamed InstanceUser to InstancePermissionSet and associated it with
PermissionSets instead of Users.
- Inject active permission sets into AuthenticationContext.
- Sanitize away top level child properties of client request bodies
(hopefully).
- Added groups integration tests. Main test now runs in a group context.
- Added migrations with hand-written transition SQL.
- Resetting the admin user disassociates them from any groups.

Fuck this huge commit
2020-12-14 17:07:59 -05:00
Jordan Brown bb0f2bc068 Additional testing 2020-12-03 00:02:33 -05:00
Jordan Brown 7f5de5118b Fixes and tests for new transfer service 2020-12-02 22:07:26 -05:00
Jordan Brown a8f910692d Casually replaces base64 file transfers
- Now uses a proper streaming service
2020-11-25 23:25:53 -05:00
Jordan Brown ef7c1f3a47 Document 406 response
- Remove ApiHeaders.ApplicationJson
2020-07-04 14:28:31 -04:00
Jordan Brown 4db03eab75 Add a dedicated action and permission for granting instance user permissions on an instance 2020-06-13 23:16:39 -04:00
Jordan Brown 0ddd47ce71 Fix build errors 2020-06-08 14:02:22 -04:00
Jordan Brown 6455aa1ed0 Improve client token refreshing 2020-05-25 12:33:21 -04:00
Jordan Brown e9d1ff89e0 Fix client issues 2020-05-24 22:46:03 -04:00
Jordan Brown 5d00e23a97 Add auto refresh functionality to IServerClient 2020-05-24 17:57:28 -04:00
Jordan Brown 823dab7b85 Port client/api libraries to .netstandard 2.1
- Enable nullable references
- Client v7, API v6.4.1
2020-05-24 16:42:31 -04:00
Jordan Brown 795bec18ab Big chungus commit
- API and client to version 5.0.0
- Added a bunch more model validations
- Added error codes
- Added limits to database strings
- Redid client exceptions to be more sane
- Added configurable instance and user limits
- Always clamp rights to their valid ranges
- Add an error if the minimum password length is more than the string limit
- Fixed chat bot name contraints crossing instances
- Enforce that SIDs be unique globally
- Normalize instance paths to forward slashes on windows. Added to sanitizer
- Added migrations
- Added ApiAssert for testing error codes
2020-04-11 13:14:55 -04:00
Jordan Brown b53562a667 Remove developer exception page in production
- Replace it with an ErrorMessage payload
- Adjust the client to account for this
2020-01-09 20:29:14 -05:00
Jordan Brown 6ffad8af21 Finish stylecop cleanup on Client 2018-11-28 10:35:59 -05:00
Jordan Brown 08f6c48574 ApiHeaders of IApiClient can now be set 2018-10-13 09:14:46 -04:00