=== RUN   TestAuthMiddleware_ValidToken
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ValidToken.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ValidToken
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:339
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:341: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:341
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_ValidToken
    auth_middleware_test.go:342: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:317]
    auth_middleware_test.go:342: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:342]
--- FAIL: TestAuthMiddleware_ValidToken (0.00s)
=== RUN   TestAuthMiddleware_MissingHeader
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:71	Missing Authorization header	{"ip": "", "user_agent": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:71
veza-backend-api/internal/middleware.TestAuthMiddleware_MissingHeader.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_MissingHeader
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:358
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_MissingHeader (0.00s)
=== RUN   TestAuthMiddleware_InvalidHeaderFormat
=== RUN   TestAuthMiddleware_InvalidHeaderFormat/No_Bearer_prefix
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:82	Invalid Authorization header format	{"ip": "", "header": "token123"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:82
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:397
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidHeaderFormat/Wrong_prefix
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:82	Invalid Authorization header format	{"ip": "", "header": "Basic token123"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:82
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:397
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidHeaderFormat/Multiple_spaces
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:82	Invalid Authorization header format	{"ip": "", "header": "Bearer  token123"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:82
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:397
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidHeaderFormat/Empty_token
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token is malformed: token contains an invalid number of segments", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:397
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidHeaderFormat/Empty_header
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:71	Missing Authorization header	{"ip": "", "user_agent": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:71
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidHeaderFormat.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:397
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_InvalidHeaderFormat (0.00s)
    --- PASS: TestAuthMiddleware_InvalidHeaderFormat/No_Bearer_prefix (0.00s)
    --- PASS: TestAuthMiddleware_InvalidHeaderFormat/Wrong_prefix (0.00s)
    --- PASS: TestAuthMiddleware_InvalidHeaderFormat/Multiple_spaces (0.00s)
    --- PASS: TestAuthMiddleware_InvalidHeaderFormat/Empty_token (0.00s)
    --- PASS: TestAuthMiddleware_InvalidHeaderFormat/Empty_header (0.00s)
=== RUN   TestAuthMiddleware_InvalidToken
=== RUN   TestAuthMiddleware_InvalidToken/Invalid_token_string
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token is malformed: could not JSON decode header: invalid character '\\u008a' looking for beginning of value", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:433
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidToken/Malformed_token
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token is malformed: token contains an invalid number of segments", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:433
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
=== RUN   TestAuthMiddleware_InvalidToken/Empty_token
2025-12-12T16:03:49.055-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token is malformed: token contains an invalid number of segments", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.(*AuthMiddleware).RequireAuth.func3
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:433
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_InvalidToken (0.00s)
    --- PASS: TestAuthMiddleware_InvalidToken/Invalid_token_string (0.00s)
    --- PASS: TestAuthMiddleware_InvalidToken/Malformed_token (0.00s)
    --- PASS: TestAuthMiddleware_InvalidToken/Empty_token (0.00s)
=== RUN   TestAuthMiddleware_ExpiredToken
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ExpiredToken.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ExpiredToken
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:462
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_ExpiredToken (0.00s)
=== RUN   TestAuthMiddleware_ContextValues
=== RUN   TestAuthMiddleware_ContextValues/Regular_user
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1.(*AuthMiddleware).RequireAuth.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:526
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:528: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:528
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_ContextValues/Regular_user
    auth_middleware_test.go:529: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:504]
    auth_middleware_test.go:529: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:529]
=== RUN   TestAuthMiddleware_ContextValues/Admin_user
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1.(*AuthMiddleware).RequireAuth.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:526
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:528: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:528
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_ContextValues/Admin_user
    auth_middleware_test.go:529: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:504]
    auth_middleware_test.go:529: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:529]
=== RUN   TestAuthMiddleware_ContextValues/Moderator
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1.(*AuthMiddleware).RequireAuth.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ContextValues.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:526
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:528: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:528
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_ContextValues/Moderator
    auth_middleware_test.go:529: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:504]
    auth_middleware_test.go:529: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:529]
--- FAIL: TestAuthMiddleware_ContextValues (0.00s)
    --- FAIL: TestAuthMiddleware_ContextValues/Regular_user (0.00s)
    --- FAIL: TestAuthMiddleware_ContextValues/Admin_user (0.00s)
    --- FAIL: TestAuthMiddleware_ContextValues/Moderator (0.00s)
=== RUN   TestAuthMiddleware_NextCalled
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_NextCalled.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_NextCalled
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:569
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:571: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:571
        	Error:      	Should be true
        	Test:       	TestAuthMiddleware_NextCalled
        	Messages:   	Next handler should be called with valid token
    auth_middleware_test.go:572: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:572
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_NextCalled
    auth_middleware_test.go:573: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:555]
    auth_middleware_test.go:573: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:573]
--- FAIL: TestAuthMiddleware_NextCalled (0.00s)
=== RUN   TestAuthMiddleware_NextNotCalledOnError
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:71	Missing Authorization header	{"ip": "", "user_agent": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:71
veza-backend-api/internal/middleware.TestAuthMiddleware_NextNotCalledOnError.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_NextNotCalledOnError
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:591
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_NextNotCalledOnError (0.00s)
=== RUN   TestAuthMiddleware_TokenExpired
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_TokenExpired.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_TokenExpired
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:614
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_TokenExpired (0.00s)
=== RUN   TestAuthMiddleware_TokenExpired_NextNotCalled
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_TokenExpired_NextNotCalled.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_TokenExpired_NextNotCalled
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:643
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_TokenExpired_NextNotCalled (0.00s)
=== RUN   TestAuthMiddleware_InvalidToken_NoExpiredHeader
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token is malformed: could not JSON decode header: invalid character '\\u008a' looking for beginning of value", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken_NoExpiredHeader.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_InvalidToken_NoExpiredHeader
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:667
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
--- PASS: TestAuthMiddleware_InvalidToken_NoExpiredHeader (0.00s)
=== RUN   TestAuthMiddleware_ValidToken_NoExpiredHeader
2025-12-12T16:03:49.056-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": ""}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_ValidToken_NoExpiredHeader.(*AuthMiddleware).RequireAuth.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:184
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_ValidToken_NoExpiredHeader
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:710
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    auth_middleware_test.go:712: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:712
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_ValidToken_NoExpiredHeader
    auth_middleware_test.go:713: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:698]
    auth_middleware_test.go:713: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth_middleware_test.go:713]
--- FAIL: TestAuthMiddleware_ValidToken_NoExpiredHeader (0.00s)
=== RUN   TestRequirePlaylistOwner
--- PASS: TestRequirePlaylistOwner (0.00s)
=== RUN   TestRequireAdmin_WithAdminRole
2025-12-12T16:03:49.057-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireAdmin_WithAdminRole.(*AuthMiddleware).RequireAdmin.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:248
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireAdmin_WithAdminRole
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:125
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:127: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:127
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireAdmin_WithAdminRole
    rbac_auth_middleware_test.go:128: FAIL:	HasRole(string,uuid.UUID,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:93]
    rbac_auth_middleware_test.go:128: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:128]
    rbac_auth_middleware_test.go:129: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:113]
    rbac_auth_middleware_test.go:129: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:129]
--- FAIL: TestRequireAdmin_WithAdminRole (0.00s)
=== RUN   TestRequireAdmin_WithNonAdminRole
2025-12-12T16:03:49.057-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireAdmin_WithNonAdminRole.(*AuthMiddleware).RequireAdmin.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:248
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireAdmin_WithNonAdminRole
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:174
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:177: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:177
        	Error:      	Not equal: 
        	            	expected: 403
        	            	actual  : 401
        	Test:       	TestRequireAdmin_WithNonAdminRole
        	Messages:   	Non-admin user should be denied access
    rbac_auth_middleware_test.go:196: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:196
        	Error:      	Not equal: 
        	            	expected: "Insufficient permissions"
        	            	actual  : "Invalid token"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-Insufficient permissions
        	            	+Invalid token
        	Test:       	TestRequireAdmin_WithNonAdminRole
    rbac_auth_middleware_test.go:201: FAIL:	HasRole(string,uuid.UUID,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:139]
    rbac_auth_middleware_test.go:201: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:201]
    rbac_auth_middleware_test.go:202: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:159]
    rbac_auth_middleware_test.go:202: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:202]
--- FAIL: TestRequireAdmin_WithNonAdminRole (0.00s)
=== RUN   TestAuthMiddleware_RequirePermission_WithValidPermission
2025-12-12T16:03:49.057-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_RequirePermission_WithValidPermission.(*AuthMiddleware).RequirePermission.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:287
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_RequirePermission_WithValidPermission
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:244
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:246: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:246
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_RequirePermission_WithValidPermission
    rbac_auth_middleware_test.go:247: FAIL:	HasPermission(string,uuid.UUID,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:212]
    rbac_auth_middleware_test.go:247: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:247]
    rbac_auth_middleware_test.go:248: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:232]
    rbac_auth_middleware_test.go:248: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:248]
--- FAIL: TestAuthMiddleware_RequirePermission_WithValidPermission (0.00s)
=== RUN   TestAuthMiddleware_RequirePermission_WithInvalidPermission
2025-12-12T16:03:49.057-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestAuthMiddleware_RequirePermission_WithInvalidPermission.(*AuthMiddleware).RequirePermission.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:287
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestAuthMiddleware_RequirePermission_WithInvalidPermission
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:291
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:293: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:293
        	Error:      	Not equal: 
        	            	expected: 403
        	            	actual  : 401
        	Test:       	TestAuthMiddleware_RequirePermission_WithInvalidPermission
    rbac_auth_middleware_test.go:300: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:300
        	Error:      	Not equal: 
        	            	expected: "Insufficient permissions"
        	            	actual  : "Invalid token"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-Insufficient permissions
        	            	+Invalid token
        	Test:       	TestAuthMiddleware_RequirePermission_WithInvalidPermission
    rbac_auth_middleware_test.go:302: FAIL:	HasPermission(string,uuid.UUID,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:258]
    rbac_auth_middleware_test.go:302: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:302]
    rbac_auth_middleware_test.go:303: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:277]
    rbac_auth_middleware_test.go:303: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:303]
--- FAIL: TestAuthMiddleware_RequirePermission_WithInvalidPermission (0.00s)
=== RUN   TestRequireContentCreatorRole_WithCreatorRole
=== RUN   TestRequireContentCreatorRole_WithCreatorRole/Creator_role
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1.(*AuthMiddleware).RequireContentCreatorRole.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:362
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:364: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:364
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithCreatorRole/Creator_role
        	Messages:   	Should allow creator role
    rbac_auth_middleware_test.go:366: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:350]
    rbac_auth_middleware_test.go:366: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:366]
=== RUN   TestRequireContentCreatorRole_WithCreatorRole/Premium_role
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1.(*AuthMiddleware).RequireContentCreatorRole.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:362
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:364: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:364
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithCreatorRole/Premium_role
        	Messages:   	Should allow premium role
    rbac_auth_middleware_test.go:366: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:350]
    rbac_auth_middleware_test.go:366: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:366]
=== RUN   TestRequireContentCreatorRole_WithCreatorRole/Admin_role
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1.(*AuthMiddleware).RequireContentCreatorRole.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:362
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:364: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:364
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithCreatorRole/Admin_role
        	Messages:   	Should allow admin role
    rbac_auth_middleware_test.go:366: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:350]
    rbac_auth_middleware_test.go:366: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:366]
=== RUN   TestRequireContentCreatorRole_WithCreatorRole/Artist_role
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1.(*AuthMiddleware).RequireContentCreatorRole.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:362
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:364: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:364
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithCreatorRole/Artist_role
        	Messages:   	Should allow artist role
    rbac_auth_middleware_test.go:366: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:350]
    rbac_auth_middleware_test.go:366: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:366]
=== RUN   TestRequireContentCreatorRole_WithCreatorRole/Producer_role
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1.(*AuthMiddleware).RequireContentCreatorRole.2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithCreatorRole.func1
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:362
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:364: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:364
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithCreatorRole/Producer_role
        	Messages:   	Should allow producer role
    rbac_auth_middleware_test.go:366: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:350]
    rbac_auth_middleware_test.go:366: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:366]
--- FAIL: TestRequireContentCreatorRole_WithCreatorRole (0.00s)
    --- FAIL: TestRequireContentCreatorRole_WithCreatorRole/Creator_role (0.00s)
    --- FAIL: TestRequireContentCreatorRole_WithCreatorRole/Premium_role (0.00s)
    --- FAIL: TestRequireContentCreatorRole_WithCreatorRole/Admin_role (0.00s)
    --- FAIL: TestRequireContentCreatorRole_WithCreatorRole/Artist_role (0.00s)
    --- FAIL: TestRequireContentCreatorRole_WithCreatorRole/Producer_role (0.00s)
=== RUN   TestRequireContentCreatorRole_WithUserRole
2025-12-12T16:03:49.058-0500	WARN	middleware/auth.go:96	Invalid JWT token	{"error": "failed to parse token: token signature is invalid: signature is invalid", "ip": "192.0.2.1"}
veza-backend-api/internal/middleware.(*AuthMiddleware).authenticate
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:96
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithUserRole.(*AuthMiddleware).RequireContentCreatorRole.func2
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/auth.go:327
github.com/gin-gonic/gin.(*Context).Next
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/senke/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
veza-backend-api/internal/middleware.TestRequireContentCreatorRole_WithUserRole
	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:415
testing.tRunner
	/usr/lib/golang/src/testing/testing.go:1792
    rbac_auth_middleware_test.go:417: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:417
        	Error:      	Not equal: 
        	            	expected: 403
        	            	actual  : 401
        	Test:       	TestRequireContentCreatorRole_WithUserRole
    rbac_auth_middleware_test.go:424: 
        	Error Trace:	/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:424
        	Error:      	"Invalid token" does not contain "Insufficient permissions"
        	Test:       	TestRequireContentCreatorRole_WithUserRole
    rbac_auth_middleware_test.go:427: FAIL:	ValidateSession(string,string)
        		at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:401]
    rbac_auth_middleware_test.go:427: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/senke/git/talas/veza/veza-backend-api/internal/middleware/rbac_auth_middleware_test.go:427]
--- FAIL: TestRequireContentCreatorRole_WithUserRole (0.00s)
=== RUN   TestRequireRole_WithValidRole
--- PASS: TestRequireRole_WithValidRole (0.00s)
=== RUN   TestRequireRole_WithInvalidRole
--- PASS: TestRequireRole_WithInvalidRole (0.00s)
=== RUN   TestRequireRole_WithoutUserID
--- PASS: TestRequireRole_WithoutUserID (0.00s)
=== RUN   TestRequireRole_WithServiceError
--- PASS: TestRequireRole_WithServiceError (0.00s)
=== RUN   TestRequireRole_WithIntUserID
--- PASS: TestRequireRole_WithIntUserID (0.00s)
=== RUN   TestRequirePermission_WithValidPermission
--- PASS: TestRequirePermission_WithValidPermission (0.00s)
=== RUN   TestRequirePermission_WithInvalidPermission
--- PASS: TestRequirePermission_WithInvalidPermission (0.00s)
=== RUN   TestRequirePermission_WithoutUserID
--- PASS: TestRequirePermission_WithoutUserID (0.00s)
=== RUN   TestRequirePermission_WithServiceError
--- PASS: TestRequirePermission_WithServiceError (0.00s)
=== RUN   TestRequirePermission_WithIntUserID
--- PASS: TestRequirePermission_WithIntUserID (0.00s)
=== RUN   TestRequirePermission_WithInvalidUserIDType
--- PASS: TestRequirePermission_WithInvalidUserIDType (0.00s)
=== RUN   TestRequireRole_WithInvalidUserIDType
--- PASS: TestRequireRole_WithInvalidUserIDType (0.00s)
FAIL
FAIL	veza-backend-api/internal/middleware	0.013s
FAIL
