Commit Graph

185 Commits

Author SHA1 Message Date
spiral
318b9b5b66
fix(api): don't require '@me' string on own-system-only endpoints 2021-11-28 18:33:41 -05:00
spiral
e85073665e
fix(api): re-ignore PKErrors in Serilog 2021-11-28 18:28:10 -05:00
spiral
6919d10953
fix: correctly parse member data as v2 model in POST /members 2021-11-28 07:20:35 -05:00
spiral
4450ae4214
feat: go through some TODOs 2021-11-26 22:02:58 -05:00
spiral
1918c56937
feat: upgrade to .NET 6, refactor everything 2021-11-26 21:10:56 -05:00
spiral
a4a5f5c17a
feat: move PKMessage JSON to PluralKit.Core 2021-11-26 14:23:57 -05:00
spiral
b8e2ebd470
Merge branch 'feat/webhooks' into main 2021-11-25 17:15:42 -05:00
spiral
bc7e0df872
feat(webhooks): SUCCESSFUL_IMPORT event, better behaviour when creating entities 2021-11-25 15:33:02 -05:00
spiral
85c095a115
fix: check 'with_members' in /systems/:ref/groups against member list privacy 2021-11-19 10:18:12 -05:00
spiral
b4b83f2c94
fix(api): have correct behaviour for 'before' param 2021-11-17 09:52:58 -05:00
spiral
1d5943b6e1
fix(api): properly ignore exceptions that result in 400 status code 2021-11-17 09:45:34 -05:00
spiral
b273b49533
fix: throw SystemNotFound in SystemGet instead of 404ing 2021-11-07 13:56:15 -05:00
spiral
bdb6b61903
fix: asp.net doesn't automatically complete the response writer 2021-11-03 23:27:44 -04:00
spiral
e1a5310a3a
fix: check member/group limits before creating 2021-11-03 02:42:37 -04:00
spiral
44ccf01f93
feat: with_members query string on /systems/:ref/members endpoint 2021-11-01 00:12:11 -04:00
spiral
c7126840ed
refactor(apiv2): rewrite group member endpoints to be cleaner 2021-10-30 18:16:18 -04:00
spiral
93eef82a83
refactor(apiv2): fix nonsense behaviour with error objects/arrays 2021-10-29 20:06:09 -04:00
spiral
8e0e393f52
feat(apiv2): docs fixes 2021-10-22 17:54:47 -04:00
spiral
2bf1617737
feat(apiv2): reorganize controllers, add stats to meta endpoint 2021-10-15 07:08:41 -04:00
spiral
611fc65a99
fix(apiv2): don't erroneously expose helper methods as endpoints
asp.net why
2021-10-15 04:29:04 -04:00
spiral
8e1409bd17
fix(apiv2): get rid of large asp.net bad request errors
should also fix it for v1 :)
2021-10-14 10:24:44 -04:00
spiral
e367ed6808
feat(apiv2): post/patch endpoints 2021-10-14 09:35:20 -04:00
spiral
fd49e7e4ea
refactor(apiv2): rename APIErrors to Errors, move IsUserError to helper method 2021-10-13 09:08:17 -04:00
spiral
431f7e8931
fix(apiv2): correctly parse timestamp in SwitchPatch 2021-10-13 08:59:42 -04:00
spiral
098d804344
feat(apiv2): better model validation error UX 2021-10-13 08:37:34 -04:00
spiral
5add31c77e
feat(apiv2): switch endpoints 2021-10-13 05:29:33 -04:00
spiral
f602f22a3d
feat(apiv2): guild endpoints 2021-10-13 01:02:34 -04:00
spiral
eb05cbf76c
feat(apiv2): ignore exception caused by invalid user-provided JSON
return 400 bad request instead
2021-10-12 08:34:28 -04:00
spiral
a20276f6e6
feat(apiv2): group member endpoints 2021-10-12 08:33:31 -04:00
spiral
2d72fd6aa1
fix(apiv2): don't ISE on invalid entity references 2021-10-12 08:10:20 -04:00
spiral
0aefafb62d
feat(apiv2): delete endpoints 2021-10-12 06:41:38 -04:00
spiral
c164fad2ac
fix(apiv2): correctly apply privacy settings on switch get 2021-10-12 06:18:54 -04:00
spiral
e2a56a198f
feat(apiv2): GET endpoints except guilds
- ResolveT methods in ControllerBase
- ContextFor methods in ControllerBase
2021-10-12 05:17:54 -04:00
spiral
9d47bfe0d8
feat(apiv2): basic error handling 2021-10-12 03:01:02 -04:00
spiral
9bafc732ab Merge branch 'main' into feat/apiv2 2021-10-12 02:33:47 -04:00
spiral
0dd20c64ce
feat: update lock files 2021-10-03 05:34:33 -04:00
spiral
57722e035b
feat(apiv2): group stubs, authentication middleware, /systems/:id endpoint 2021-10-01 21:50:01 -04:00
spiral
8a88b23021
feat(apiv2): stubs 2021-09-29 22:30:20 -04:00
spiral
92e45a07ff
refactor: add SqlKata for SQL generation, move connection handling into ModelRepository 2021-09-29 21:51:38 -04:00
spiral
ac2671452d
run dotnet format 2021-08-27 11:03:47 -04:00
spiral
4b944e2b20
feat: refactor external input handling code
- refactor import/export code
- make import/export use the same JSON parsing as API
- make Patch.AssertIsValid actually useful
2021-08-25 21:43:31 -04:00
spiral
11bd66e8d8
refactor: move JsonModelExt to PluralKit.Core (in individual model/patch files) 2021-08-08 16:10:53 -04:00
spiral
e144571904
Add banner (large) image 2021-08-02 13:46:12 -04:00
spiral
1cb4bc9287
Expose git version in 'pk;stats' and '/v1/meta' 2021-08-01 15:22:23 -04:00
spiral
dcc15dc847
Move mediaproxy URL rewriting to ProxyService
This shows full size avatars in API / cards.

Also, rewrite URLs currently stored with media.discordapp.net "back" to
cdn.discordapp.com before sending them to users.
2021-08-01 12:51:54 -04:00
spiral
dd020d8aa8
Update license in openapi.yaml 2021-07-08 09:07:45 -04:00
spiral
a03b5a0c95
Add NuGet lock files
Co-authored-by: Katelyn Gigante <clockwork.singularity@gmail.com>
2021-07-08 09:04:20 -04:00
spiral
b82dad2b9f
api: correctly parse 'null' privacy as public 2021-07-06 18:07:17 -04:00
spiral
deedb61d41
Add /v1/meta endpoint (shows shard state) 2021-06-21 09:19:47 -04:00
Ske
dd2c669cd2 Fix some compiler warnings
Signed-off-by: Ske <voltasalt@gmail.com>
2021-05-07 10:48:19 +02:00
spiral
7f3f81a111
Update error string 2021-04-21 23:09:45 +01:00
spiral
b34ed5c4c0
API patch improvements
- add PatchObject.CheckIsValid
- use transaction when creating member, as to not create a member if the
patch is invalid
- return edited system in `PATCH /s` endpoint
2021-04-21 22:57:19 +01:00
Ske
8a04ace5c7 Target .NET 5 2020-12-19 12:01:09 +01:00
Ske
8c12b3f037 Update library versions (still on .NET 3.1 though) 2020-11-15 14:15:30 +01:00
Ske
1fda6ec919 Add per-system member/group limit override 2020-10-09 12:18:29 +02:00
Ske
c7612df37e Major database refactor (again) 2020-08-29 13:46:27 +02:00
Ske
f89ca4c867 Use Serilog in API 2020-08-27 23:36:02 +02:00
Ske
3617d5e894 Add API listen port configuration 2020-08-27 23:35:47 +02:00
Ske
0d04725a19 Include full debug symbols when building in Release mode 2020-08-25 20:36:38 +02:00
Ske
45775f2e8e Remove unversioned API endpoints 2020-07-28 19:59:28 +02:00
Grey Himmel
0d2777c1d1
Return new member after member PATCH (#191) 2020-07-05 12:54:51 +02:00
Ske
467ce78522 Retire more IDataStore methods 2020-06-29 14:54:11 +02:00
Ske
9c1efc7886 Move system updates to the same patch system as members 2020-06-29 14:39:19 +02:00
Ske
c5697b33e2 Finally retire the PKMember setters! 2020-06-29 14:15:30 +02:00
Ske
281b669391 Refactor member updates to use a patch object 2020-06-29 13:57:48 +02:00
Ske
d3cf382e3b Migrate to date/time format extension methods 2020-06-21 16:05:04 +02:00
Ske
dcffbef805 Migrate to more privacy helper extensions 2020-06-21 15:51:08 +02:00
Ske
ae4e8f97d0 Add member avatar privacy 2020-06-20 16:00:50 +02:00
Ske
56eae82b0a Move most references to PKMember.Name to go through helper extepsions for privacy 2020-06-18 17:08:36 +02:00
Ske
244815d6c3 Update OpenAPI specification 2020-06-17 22:12:00 +02:00
Ske
e92700f339 Comment out color privacy stuff for now (revisit later?) 2020-06-17 21:51:40 +02:00
BeeFox-sys
721a4502bb
Feature/granular member privacy (#174)
* Some reasons this needs to exist for it to run on my machine? I don't think it would hurt to have it in other machines so

* Add options to member model

* Add Privacy to member embed

* Added member privacy display list

* Update database settings

* apparetnly this is nolonger needed?

* Fix sql call

* Fix more sql errors

* Added in settings control

* Add all subject to system privacy

* Basic API Privacy

* Name privacy in logs

* update todo

* remove CheckReadMemberPermission

* Added name privacy to log embed

* update todo

* Update todo

* Update api to handle privacy

* update todo

* Update systemlist full to respect privacy (as well as system list)

* include colour as option for member privacy subject

* move todo file (why was it there?)

* Update TODO.md

* Update TODO.md

* Update TODO.md

* Deleted to create pr

* Update command usage and add to the command tree

* Make api respect created privacy

* Add editing privacy through the api

* Fix pronoun privacy field in api

* Fix info leak of display name in api

* deprecate privacy field in api

* Deprecate privacy diffrently

* Update API

* Update documentation

* Update documentation

* Remove comment in yml

* Update userguide

* Update migration (fix typo in 5.sql too)

* Sanatize names

* some full stops

* Fix after merge

* update migration

* update schema version

* update edit command

* update privacy filter

* fix a dumb mistake

* clarify on what name privacy does

* make it easier on someone else

* Update docs

* Comment out unused code

* Add aliases for `member privacy all public` and `member privacy all private`
2020-06-17 21:31:39 +02:00
Ske
627f544ee8 Migrate API to ASP.NET Core Auth services + refactor 2020-06-16 01:15:59 +02:00
Ske
1d1b7b8716 Migrate GetSystemByToken 2020-06-13 19:44:01 +02:00
Ske
90ac186183 Extract Database to interface 2020-06-13 19:36:43 +02:00
Ske
70df9cd893 Fix API project build 2020-06-13 19:21:24 +02:00
Ske
c875c8af9f Various small fixes, setting guild config now works 2020-06-13 19:15:50 +02:00
Ske
e176ccbab5 Several more database-y refactors
- DbConnectionFactory renamed to "Database", will now be the primary entry point for DB stuff
- Created IPKConnection interface mostly containing async extensions to IDbConnection, use this going forward
- Reworked the Connection/Command wrappers (that have performance/logging extensions)
- Probably more stuff that I forgot???
2020-06-13 18:31:20 +02:00
Ske
ba441a15cc Too many refactors in one:
- Allowed adding ephemeral(ish) views and functions
- Moved message_count to a concrete database field
- Moved most proxy logic to a stored procedure
- Moved database files around and refactored schema manager
2020-06-12 20:29:50 +02:00
Ske
599dfcc071 Enable XML comment support for Swashbuckle 2020-05-07 06:10:29 +02:00
Ske
5cc5a5b4a7 Add basic Swagger integration into ASP.NET
Only enabled in Development mode for now.
2020-05-07 05:14:31 +02:00
Ske
c4c3eaf954 Integrate ApiVersioning library for ASP.NET 2020-05-07 04:40:08 +02:00
Ske
db1ebd0a1d Fix OpenAPI schema ref examples for ReDoc 2020-05-07 01:45:13 +02:00
Ske
38e65b3971 Properly publish OpenAPI spec 2020-05-07 01:36:00 +02:00
Ske
1badfd9020 Add draft OpenAPI v3 definitions 2020-05-06 19:37:08 +02:00
Ske
0f64086c75 Properly save avatar_url in the API 2020-05-05 16:14:21 +02:00
Ske
f803b9a392 Add a character limit to avatar URLs (256 for now) 2020-05-05 16:04:17 +02:00
Ske
ab8382dffe Load proper config file for non-Docker API 2020-04-16 22:03:23 +02:00
Ske
45c5e5ed42 Normalize colors to lowercase hex 2020-02-25 16:37:52 +01:00
Ske
d596cbc4e8 Clean up privacy handling in API 2020-02-13 23:11:21 +01:00
Ske
bef3f5c79a Merge branch 'api-privacy' of https://github.com/greysdawn/PluralKit into greysdawn-api-privacy 2020-02-13 22:55:10 +01:00
Ske
6d5004bf54 Large refactor and project restructuring 2020-02-12 15:16:19 +01:00
Ske
fde03538e0 Fix API token handling 2020-02-01 22:17:13 +01:00
Ske
1ea0526ef8 Migrate DI container to Autofac 2020-01-26 01:27:45 +01:00
Ske
b347d2d557 Add front history pagination; upgrade more store methods 2020-01-18 00:58:35 +01:00
Ske
8a689ac0f2 Upgrade various store methods to IAsyncEnumerable 2020-01-18 00:02:17 +01:00
Ske
98613c4287 Add system and member privacy support 2020-01-11 16:51:13 +01:00
Ske
0f22285824 Upgrade API serialisation code to enable potential context-based serialisation 2019-12-28 15:52:59 +01:00
Ske
ebc688ae54 Add original message ID to API response 2019-12-22 12:54:37 +01:00
Ske
9c9e48a799 Upgrade to .NET Core 3.1 2019-12-22 00:40:57 +01:00