mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 10:56:28 +02:00
* proxy: add userinfo and webauthn endpoints * use TLD for RP id * use EffectiveTLDPlusOne * upgrade webauthn * fix test * Update internal/handlers/jwks.go Co-authored-by: bobby <1544881+desimone@users.noreply.github.com> Co-authored-by: bobby <1544881+desimone@users.noreply.github.com>
24 lines
610 B
Go
24 lines
610 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestWellKnownPomeriumHandler(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
t.Run("cors", func(t *testing.T) {
|
|
authenticateURL, _ := url.Parse("https://authenticate.example.com")
|
|
w := httptest.NewRecorder()
|
|
r := httptest.NewRequest(http.MethodOptions, "/", nil)
|
|
r.Header.Set("Origin", authenticateURL.String())
|
|
r.Header.Set("Access-Control-Request-Method", "GET")
|
|
WellKnownPomerium(authenticateURL).ServeHTTP(w, r)
|
|
assert.Equal(t, http.StatusNoContent, w.Result().StatusCode)
|
|
})
|
|
}
|