Fix auth tests

This commit is contained in:
Zoe Roux 2025-05-26 00:42:09 +02:00
parent 953ac5ffa8
commit af97c52e48
No known key found for this signature in database
3 changed files with 18 additions and 18 deletions

View File

@ -49,7 +49,7 @@ jobs:
run: | run: |
./keibi > logs & ./keibi > logs &
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
hurl --error-format long --variable host=http://localhost:4568 tests/* hurl --error-format long --variable host=http://localhost:4568/auth tests/*
env: env:
PGHOST: localhost PGHOST: localhost
FIRST_USER_CLAIMS: '{"permissions": ["users.read"]}' FIRST_USER_CLAIMS: '{"permissions": ["users.read"]}'

View File

@ -56,7 +56,7 @@ func GetCurrentSessionId(c echo.Context) (uuid.UUID, error) {
func CheckPermissions(c echo.Context, perms []string) error { func CheckPermissions(c echo.Context, perms []string) error {
token, ok := c.Get("user").(*jwt.Token) token, ok := c.Get("user").(*jwt.Token)
if !ok{ if !ok {
return echo.NewHTTPError(401, "Not logged in") return echo.NewHTTPError(401, "Not logged in")
} }
sub, err := token.Claims.GetSubject() sub, err := token.Claims.GetSubject()