11 Commits

Author SHA1 Message Date
Evan Goode
4b1d9d420b Defaults for array-of-tables config settings
Due to https://github.com/BurntSushi/toml/issues/169, we can't simply
use IsDefined to check whether a user supplied a config value in an
array of tables, as in:

[[FallbackAPIServers]]
    CacheTTLSeconds = 123

We can work around this by using *T instead of T in the config
file schema. If the TOML key is not set, it will be parsed as nil.
2025-04-06 23:48:36 +00:00
Evan Goode
770ceededb Batch and rate-limit POST /profiles/minecraft to fallback API servers
For https://github.com/unmojang/drasl/issues/112
2025-04-04 21:00:08 -04:00
Evan Goode
d7ffab2612 Update config examples and test them 2025-03-28 20:53:45 -04:00
Evan Goode
6fe35be090 Punycode IDNs while reading config file
It's safest to work with punycoded IDNs everywhere. Neither
authlib-injector nor Minecraft's `-Dminecraft.api.*.host` arguments play
nice with Unicode IDNs. Related:
https://github.com/yushijinhun/authlib-injector/issues/270
2025-03-24 17:21:09 -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
Evan Goode
25c0404514 config: allow unlimited max player count (-1) 2025-01-19 22:55:37 -05:00
Evan Goode
ca081f8519 Run tests in parallel 2024-12-28 21:07:32 -05:00
Evan Goode
2313fee3fe Fix config test 2023-09-04 16:59:04 -04:00
Evan Goode
15559209ca Create config, state directories if they don't exist
We might want to gate this behind a flag in build_config.go, the Docker
build will want this but maybe not other distributions.
2023-09-03 17:51:20 -04:00
Evan Goode
50a0b95121 Dockerfile, template config file 2023-09-02 19:12:28 -04:00
Evan Goode
d750dacdbb Config validation/cleaning, cleanup 2023-08-29 00:26:21 -04:00