54 Commits

Author SHA1 Message Date
Evan Goode
d7ffab2612 Update config examples and test them 2025-03-28 20:53:45 -04:00
Evan Goode
5252317a53 Lots of API cleanup, link to Swagger API docs 2025-03-22 23:05:38 -04:00
Evan Goode
5c1f6c1cfa
Implement SSO via OIDC (#127)
Resolves https://github.com/unmojang/drasl/issues/39

* Use __Host- cookie prefix instead of setting Domain

See https://stackoverflow.com/a/64735551

* Unlinking OIDC accounts

* AllowPasswordLogin, OIDC docs, cleanup

* YggdrasilError

* Migrate existing password users without login

* API query/create/delete user OIDC identities

* test APICreateOIDCIdentity

* test APIDeleteeOIDCIdentity

* API Create users with OIDC identities

* OIDC: PKCE

* Use YggdrasilError in authlib-injector routes

* OIDC: AllowChoosingPlayerName

* recipes.md: Update for OIDC and deprecated config options

* OIDC: fix APICreateUser without password, validate oidcIdentities

* OIDC: error at complete-registration if no preferred player name

* Proper error pages

* MC_ prefix for Minecraft Tokens
2025-03-22 16:40:26 -04:00
хлифи
fbc8f9d45a
APIs for login and register (#136)
* APIs for login and register

* return 403 instead of 423 if account is locked

* add login API route to ratelimiter

* APILogin remove browser token gen & return, give API token instead

* generalize login logic

* remove transient user handling

* remove APIRegisterChallenge due to unnecessary

* remove honeypot from APIRegister

* APIRegister remove browser token gen & return, give API token instead

* add register API route to ratelimiter

* add missing API godoc

* Clean up app.Login error handling

* Fix rate-limit errors for API routes

* Deduplicate APICreateUser and APIRegister

* Rate-limit all non-admin unsafe API requests

* APILogin test

* Make SetIsLocked write to the tx

* Add CORSAllowOrigins option

* Assert SetIsLocked without err variable

* Fix and test API rate limiting

---------

Co-authored-by: Evan Goode <mail@evangoo.de>
2025-02-15 21:43:02 -05:00
Evan Goode
32840a628e Set default data, state, config paths via env vars
Resolves https://github.com/unmojang/drasl/issues/119.

May be useful for some containerized deployments.
2024-12-28 23:23:13 -05:00
Evan Goode
5a58d24156 Automatic pre-migration DB backups 2024-12-28 21:07:32 -05:00
Evan Goode
0865865cd3 Player API routes, API tests/fixes 2024-12-28 21:07:32 -05:00
Evan Goode
faec464a4e Most Front tests passing 2024-12-28 21:07:32 -05:00
Evan Goode
1a8d312797 Tests passing except Front 2024-12-28 21:07:32 -05:00
Evan Goode
738d80538f Make multiple profiles usable from web front end 2024-12-28 21:07:32 -05:00
Evan Goode
f58ce99eae Initial changes to support multiple players per user 2024-12-28 21:07:32 -05:00
Evan Goode
e4819f621d Rework POST /profiles/minecraft
The authlib-injector spec only requires /profiles/minecraft to be
implemented, not necessarily /users/profiles/minecraft/:playerName, so
the /profiles/minecraft at least should query fallback API servers at
/profiles/minecraft.

Also fixes potential DoS by introducing a limit of 10 players per
request (also which prevents fallback API servers from being spammed)
2024-08-29 18:38:48 -04:00
Evan Goode
f02e4370a5 Rework error handling 2024-08-15 12:33:59 -04:00
Evan Goode
f27e0d75fb API descriptions 2024-08-15 12:33:59 -04:00
Evan Goode
65a5c5aff8 API Delete user 2024-08-15 12:33:59 -04:00
Evan Goode
8f1a87aa1a More API routes and refactoring 2024-08-15 12:33:59 -04:00
Evan Goode
f7ad78d8e9 refactor: CreateUser 2024-08-15 12:33:59 -04:00
Evan Goode
c70e266d57 Start implementing Drasl API 2024-08-15 12:33:59 -04:00
cat
3441839905 Add ApplicationName, use generic URLs in web UI 2024-08-15 12:33:59 -04:00
Evan Goode
c4384759dc Have InvalidateUser take a transaction 2024-06-27 12:47:18 -04:00
Evan Goode
19d51767d5 Fix slim skins and bump version to 1.0.1
Resolves https://github.com/unmojang/drasl/issues/37
2023-11-30 04:59:24 +00:00
Evan Goode
276f36c0e2 Default skins and capes, usage.md
Resolves https://github.com/unmojang/drasl/issues/27
2023-11-22 21:30:02 -05:00
Evan Goode
e8537ea54c OfflineSkins, also fix several skin issues 2023-11-10 20:19:07 -05:00
Evan Goode
a7679dce16 Log responses from fallback API servers 2023-09-18 20:29:43 -04:00
Evan Goode
de43a8068b Update usage on home page, add footer 2023-09-17 00:21:09 -04:00
Evan Goode
d750dacdbb Config validation/cleaning, cleanup 2023-08-29 00:26:21 -04:00
Evan Goode
fec8371816 Services tests 2023-08-20 00:47:54 -04:00
Evan Goode
3456e33085 Switch from 32-character hex accessTokens to JWTs 2023-08-20 02:15:04 +00:00
Evan Goode
fecd6e5daf Mostly cleanup, error handling, authlib-injector fixes 2023-07-28 16:33:45 -04:00
Evan Goode
1171d4024f Session server tests 2023-07-23 15:31:39 -04:00
Evan Goode
6405e36db7 Tests for authserver 2023-07-22 18:51:20 -04:00
Evan Goode
fad4a8498c Print initial invite link if necessary 2023-07-09 01:01:26 -04:00
Evan Goode
acbd22a011 DefaultAdmins, interface fixes 2023-07-07 20:39:19 -04:00
Evan Goode
f9c548bae1 rework setting skin/cape to hopefully avoid race conditions 2023-07-07 16:30:54 -04:00
Evan Goode
63fe0a2be3 update-users, delete-user tests, cleanup 2023-07-06 02:38:03 +00:00
Evan Goode
aca64b5acc invite existing player, mutex for setskin/setcape 2023-07-06 02:38:03 +00:00
Evan Goode
ca3821b2cd tests, allow viewing another profile as admin 2023-07-06 02:38:03 +00:00
Evan Goode
22d5f3525d initial work on invites, admin page 2023-07-06 02:38:03 +00:00
Evan Goode
ee701eac6e Cache certain responses from fallback API servers 2023-06-26 23:58:14 -04:00
Evan Goode
a8bb8832dd s/SkinForwarding/ForwardSkins/, allow setting fallback player 2023-06-25 15:32:24 -04:00
Evan Goode
ada118546f initial support for authlib-injector 2023-06-03 23:16:42 -04:00
Evan Goode
4fdb587119 Go all in on the unified server design 2023-06-03 19:39:35 -04:00
Evan Goode
360ff8edd7 SkinSizeLimit, not AllowHighResolutionSkins
Resolves https://github.com/unmojang/drasl/issues/5
2023-06-02 22:04:51 -04:00
Evan Goode
e99bbb51d6 rate limiting 2023-05-31 01:11:19 -04:00
Evan Goode
956e34dd2e Nix flake 2023-05-21 01:02:18 -04:00
Evan Goode
c9769328c6 Lots of front-end tests 2023-05-17 20:27:57 -04:00
Evan Goode
5476ea077a finish up the last of the miscellaneous API routes 2023-05-16 16:39:06 -04:00
Evan Goode
de40a0cde0 Delete skin/cape 2023-05-16 00:24:55 -04:00
Evan Goode
1ac386f206 Skin forwarding from fallback API servers 2023-05-13 15:07:56 -04:00
Evan Goode
5814a43caf A couple more tests 2023-04-06 00:08:24 -04:00