Skip to content

Bug: PATCH /credentials/{provider}/{user_id} returns 500 error #325

@nycomp

Description

@nycomp

Bug Description

The PATCH /auth/v1/credentials/{provider}/{user_id} endpoint returns a 500 server error when attempting to update credentials.

Location

  • Route: campus/auth/routes/credentials.py:91-112
  • Resource: campus/auth/resources/credentials.py

Error

# Returns 500 with internal server error
PATCH /auth/v1/credentials/campus/user@example.com
Content-Type: application/json
Authorization: Bearer <token>

{
  "token": {
    "id": "token_id",
    "scopes": ["read", "write"],
    "expiry_seconds": 7200
  }
}

Expected Behavior

Should return 200 with the updated credentials resource, or appropriate error codes (400/404) for invalid requests.

Contract Test Blocked

  • tests/contract/test_auth_credentials.py::TestAuthCredentialsContract::test_update_credentials is skipped due to this bug

Investigation Needed

  • Verify the expected request payload format for updating credentials
  • Check if the issue is with the token object structure
  • May need to pass an OAuthToken model object instead of a dict

Related

  • Found during Phase 3 of integration test refactor
  • HTTP contract test coverage expansion

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