mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-05 12:23:03 +02:00
proxy: add userinfo and webauthn endpoints (#3755)
* 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>
This commit is contained in:
parent
81053ac8ef
commit
c1a522cd82
33 changed files with 498 additions and 216 deletions
31
pkg/webauthnutil/webauthnutil_test.go
Normal file
31
pkg/webauthnutil/webauthnutil_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package webauthnutil
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetEffectiveDomain(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, tc := range []struct {
|
||||
in string
|
||||
expect string
|
||||
}{
|
||||
{"https://www.example.com/some/path", "example.com"},
|
||||
{"https://www.example.com:8080/some/path", "example.com"},
|
||||
{"https://www.subdomain.example.com/some/path", "example.com"},
|
||||
{"https://example.com/some/path", "example.com"},
|
||||
} {
|
||||
tc := tc
|
||||
t.Run(tc.expect, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
r, err := http.NewRequest(http.MethodGet, tc.in, nil)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, tc.expect, GetEffectiveDomain(r))
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue