Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't require context (#1471) #1472

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Conversation

aardvarkk
Copy link
Contributor

Description

  • Fixes WebSocket Authorization requires policy to contain a context #1471
  • The policy's context should be optional, but the code crashed if the context wasn't provided
  • Followed a model similar to createAuthScheme where the context is properly checked for existence before being validated and used
  • Add a test to verify the websocket authorizer works when the policy doesn't contain a context. This test fails with the existing code.
  • Un-skipped the tests so they're actually run and verified the test now passes.

Motivation and Context

Policy context should be optional, and I was getting mysterious 500s by not providing it in a websocket authorizer.

How Has This Been Tested?

I added a test to ensure websocket authorizers run properly without a policy context.

- Fixes dherault#1471
- The policy's context should be *optional*, but the code crashed if the context wasn't provided
- Followed a model similar to createAuthScheme where the context is properly checked for existence before being validated and used
- Add a test to verify the websocket authorizer works when the policy doesn't contain a context. This test fails with the existing code.
- Un-skipped the tests so they're actually run and verified the test now passes.
@dnalborczyk dnalborczyk merged commit aaccf96 into dherault:master Jun 14, 2022
@dnalborczyk
Copy link
Collaborator

thank you @aardvarkk !

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.

WebSocket Authorization requires policy to contain a context
2 participants