Skip to content

Fix /validate_token to use server-configured validation instance#472

Merged
leoschwarz merged 3 commits intomainfrom
fix/validate-token-use-server-settings
Apr 13, 2026
Merged

Fix /validate_token to use server-configured validation instance#472
leoschwarz merged 3 commits intomainfrom
fix/validate-token-use-server-settings

Conversation

@leoschwarz
Copy link
Copy Markdown
Member

@leoschwarz leoschwarz commented Apr 13, 2026

Fixes #415

  • The /validate_token endpoint was incorrectly using the client-provided BfabricInstanceDep as the base_url for token validation
  • Now uses the validate_token() helper from bfabric.rest.token_data, which reads validation_bfabric_instance from server settings
  • Also gains the bonus check that the token's caller is in supported_bfabric_instances

The endpoint was using the client-provided BfabricInstanceDep as the
base_url for token validation. It now uses the validate_token() helper
which reads validation_bfabric_instance from server settings and also
checks that the token's caller is in supported_bfabric_instances.

Closes #415
Tests now mock validate_token instead of get_token_data_async, no longer
pass bfabric_instance as a query param, and verify settings are passed.
Added test for unsupported instance rejection.
@leoschwarz leoschwarz merged commit 5a78671 into main Apr 13, 2026
3 checks passed
@leoschwarz leoschwarz deleted the fix/validate-token-use-server-settings branch April 13, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bfabric-rest-proxy should respect validation instance url

1 participant