diff --git a/example/docker-caddy/docker-compose.yaml b/example/docker-caddy/docker-compose.yaml index 3e468ad..e5a7edd 100644 --- a/example/docker-caddy/docker-compose.yaml +++ b/example/docker-caddy/docker-compose.yaml @@ -1,6 +1,6 @@ services: caddy: - image: caddy + image: docker.io/caddy ports: - "80:80" - "443:443" @@ -9,7 +9,7 @@ services: - ./caddy/data:/data - ./caddy/config:/config drasl: - image: unmojang/drasl + image: docker.io/unmojang/drasl volumes: - ./config:/etc/drasl - ./data:/var/lib/drasl diff --git a/example/docker/docker-compose.yaml b/example/docker/docker-compose.yaml index e6beb62..5f049e9 100644 --- a/example/docker/docker-compose.yaml +++ b/example/docker/docker-compose.yaml @@ -1,5 +1,3 @@ -version: "3" - services: drasl: image: unmojang/drasl diff --git a/front.go b/front.go index fc6ab39..782fe31 100644 --- a/front.go +++ b/front.go @@ -1314,7 +1314,7 @@ func frontChallenge(app *App, action string) func(c echo.Context) error { } if provider.Config.AllowChoosingPlayerName { - playerName = c.FormValue("playerName") + playerName = c.QueryParam("playerName") } else { if preferredPlayerName, ok := app.getPreferredPlayerName(claims.GetUserInfo()).Get(); ok { playerName = preferredPlayerName @@ -1323,11 +1323,7 @@ func frontChallenge(app *App, action string) func(c echo.Context) error { } } } else { - username := c.QueryParam("username") - if err := app.ValidateUsername(username); err != nil { - return NewWebError(returnURL, "Invalid username: %s", err) - } - playerName = username + playerName = c.QueryParam("playerName") } } else if action == ChallengeActionCreatePlayer { playerName = c.QueryParam("playerName") diff --git a/front_test.go b/front_test.go index 3f7d62f..44ce65b 100644 --- a/front_test.go +++ b/front_test.go @@ -589,7 +589,7 @@ func (ts *TestSuite) testRegistrationNewPlayerInvite(t *testing.T) { func (ts *TestSuite) solveRegisterChallenge(t *testing.T, username string) *http.Cookie { // Get challenge skin - req := httptest.NewRequest(http.MethodGet, "/web/register-challenge?username="+username, nil) + req := httptest.NewRequest(http.MethodGet, "/web/register-challenge?playerName="+username, nil) rec := httptest.NewRecorder() ts.Server.ServeHTTP(rec, req) assert.Equal(t, http.StatusOK, rec.Code) @@ -972,12 +972,12 @@ func (ts *TestSuite) testRegistrationExistingPlayerVerification(t *testing.T) { ts.registrationShouldFail(t, rec, "Couldn't verify your skin, maybe try again: player does not have a skin", returnURL) } { - // Get challenge skin with invalid username should fail - req := httptest.NewRequest(http.MethodGet, "/web/register-challenge?username=AReallyReallyReallyLongUsername&returnUrl="+ts.App.FrontEndURL+"/web/registration", nil) + // Get challenge skin with invalid player name should fail + req := httptest.NewRequest(http.MethodGet, "/web/register-challenge?playerName=AReallyReallyReallyLongPlayerName&returnUrl="+ts.App.FrontEndURL+"/web/registration", nil) rec := httptest.NewRecorder() ts.Server.ServeHTTP(rec, req) assert.Equal(t, http.StatusSeeOther, rec.Code) - assert.Equal(t, "Invalid username: neither a valid player name (can't be longer than 16 characters) nor an email address", getErrorMessage(rec)) + assert.Equal(t, "Invalid player name: can't be longer than 16 characters", getErrorMessage(rec)) assert.Equal(t, returnURL, rec.Header().Get("Location")) } { diff --git a/main.go b/main.go index 41e9540..d1cb3c9 100644 --- a/main.go +++ b/main.go @@ -496,6 +496,7 @@ func setup(config *Config) *App { playerCertificateKeys = append(playerCertificateKeys, *publicKey) } } + log.Printf("Fetched public keys from fallback API server %s", fallbackAPIServer.Nickname) } // OIDC providers