Skip to content

Wrong status code returned for unauthorized requests #903

@matthewbeckett25

Description

@matthewbeckett25

Bug description

Proxy returns 200 instead of 403 for unauthorised requests

How to reproduce

Steps to reproduce the behavior:
Install capsule proxy through helm chart. Expose via ingress or gateway api and connect (or connect via proxy) do not provide any authentication. The body returned is {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"cannot retrieve user and group: unauthenticated users not supported","reason":"Forbidden","code":403} but the attatched status code is 200.

Expected behavior

Errors like {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"cannot retrieve user and group: unauthenticated users not supported","reason":"Forbidden","code":403} should return the correct status code

Additional context

  • Capsule-Proxy version: v0.9.13
  • Helm Chart version: 0.9.13
  • Kubernetes version: v1.32.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions