refactor
This commit is contained in:
parent
d0ea6e9eec
commit
2967f1a5af
31 changed files with 469 additions and 165 deletions
|
|
@ -70,7 +70,7 @@ func newUnauthenticatedRouter(t *testing.T) http.Handler {
|
|||
t.Helper()
|
||||
cfg := testConfig(t)
|
||||
cfg.AuthMode = config.AuthModeOIDC
|
||||
cfg.OIDCIssuer = "https://auth-dev.urpi.be/realms/urpi"
|
||||
cfg.OIDCIssuer = "https://auth.lcl-urpi.be/realms/urpi"
|
||||
cfg.OIDCClientID = "go-bananas"
|
||||
cfg.OIDCClientSecret = "test-client-secret"
|
||||
cfg.SessionSecure = false
|
||||
|
|
@ -278,7 +278,7 @@ func TestRuntimeIsReadableCrossOrigin(t *testing.T) {
|
|||
// not testing the policy — it is testing the same-origin path under a
|
||||
// misleading name.
|
||||
req := httptest.NewRequestWithContext(context.Background(), http.MethodGet, path, nil)
|
||||
req.Header.Set("Origin", "https://tell-dev.urpi.be")
|
||||
req.Header.Set("Origin", "https://tell.lcl-urpi.be")
|
||||
rec := httptest.NewRecorder()
|
||||
router.ServeHTTP(rec, req)
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ func TestAdminAPIIsNotOpenedByTheRuntimePolicy(t *testing.T) {
|
|||
for _, path := range []string{"/api/v1/session", "/api/v1/themes"} {
|
||||
t.Run(path, func(t *testing.T) {
|
||||
req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, path, nil)
|
||||
req.Header.Set("Origin", "https://tell-dev.urpi.be")
|
||||
req.Header.Set("Origin", "https://tell.lcl-urpi.be")
|
||||
rec := httptest.NewRecorder()
|
||||
router.ServeHTTP(rec, req)
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ func TestAdminAPIAllowsAConfiguredOrigin(t *testing.T) {
|
|||
func TestRuntimeAnswersPreflight(t *testing.T) {
|
||||
req := httptest.NewRequestWithContext(
|
||||
context.Background(), http.MethodOptions, "/rt/v1/contract.json", nil)
|
||||
req.Header.Set("Origin", "https://tell-dev.urpi.be")
|
||||
req.Header.Set("Origin", "https://tell.lcl-urpi.be")
|
||||
// A real preflight names the method it wants to use. Without this header the
|
||||
// request is not a preflight, and asserting 204 on it would be asserting on a
|
||||
// case no browser ever sends — which is how this test passed against a 405.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue