Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Mar 22, 2024
1 parent b37b465 commit 0ed9041
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 29 deletions.
64 changes: 41 additions & 23 deletions go/controller/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118024e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118024e+09),
Expand Down Expand Up @@ -354,9 +356,11 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118024e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118024e+09),
Expand Down Expand Up @@ -396,9 +400,11 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118024e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118024e+09),
Expand Down Expand Up @@ -438,9 +444,11 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118024e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118024e+09),
Expand Down Expand Up @@ -481,9 +489,11 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118024e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118024e+09),
Expand Down Expand Up @@ -573,10 +583,14 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118076e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-auth-elevated": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-auth-elevated": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118076e+09),
Expand Down Expand Up @@ -616,10 +630,14 @@ func TestMiddlewareFunc(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(1.0711118076e+10),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-auth-elevated": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("f90782de-f0a3-41fe-b778-01e4f80c2413"),
"x-hasura-allowed-roles": []any{"me", "user", "editor"},
"x-hasura-auth-elevated": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"f90782de-f0a3-41fe-b778-01e4f80c2413",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(1.711118076e+09),
Expand Down
16 changes: 10 additions & 6 deletions go/controller/post_signup_webauthn_verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ func TestPostSignupWebauthnVerify(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(time.Now().Add(900 * time.Second).Unix()),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"user", "me"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("cf91d1bc-875e-49bc-897f-fbccf32ede11"),
"x-hasura-allowed-roles": []any{"user", "me"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"cf91d1bc-875e-49bc-897f-fbccf32ede11",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(time.Now().Unix()),
Expand Down Expand Up @@ -328,9 +330,11 @@ func TestPostSignupWebauthnVerify(t *testing.T) { //nolint:maintidx
Claims: jwt.MapClaims{
"exp": float64(time.Now().Add(900 * time.Second).Unix()),
"https://hasura.io/jwt/claims": map[string]any{
"x-hasura-allowed-roles": []any{"user", "me"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string("cf91d1bc-875e-49bc-897f-fbccf32ede11"),
"x-hasura-allowed-roles": []any{"user", "me"},
"x-hasura-default-role": string("user"),
"x-hasura-user-id": string(
"cf91d1bc-875e-49bc-897f-fbccf32ede11",
),
"x-hasura-user-is-anonymous": string("false"),
},
"iat": float64(time.Now().Unix()),
Expand Down

0 comments on commit 0ed9041

Please sign in to comment.