ai-cfia / membrane-backend

Membrane Backend: A centralized authentication service for Single Sign-On (SSO) enabling seamless token-based email verification across multiple client applications.
MIT License
1 stars 0 forks source link

JWT Utility Tests Issue #7

Open CFIALeronB opened 1 year ago

CFIALeronB commented 1 year ago

There seem to be concerns regarding the JWT utility tests, specifically in the following test cases:

  1. test_decode_jwt_without_app_id
  2. test_decode_jwt_with_nonexistent_app_id
  3. test_decode_jwt_with_invalid_token

Details:

The test_decode_jwt_without_app_id is supposed to validate the behavior when a JWT doesn't have an app_id. We need to ensure the function gracefully handles this case and provides a meaningful error message.

In the test_decode_jwt_with_nonexistent_app_id test, it is expected that if a JWT contains an app_id that doesn't have a corresponding public key in our directory, an error should be raised. The current behavior doesn't seem to align with this expectation.

The test_decode_jwt_with_invalid_token test is designed to check our function's response to a completely malformed JWT. This needs to be rigorously tested to prevent potential vulnerabilities.