Repository navigation
Description
Is your feature request related to a problem? Please describe.
The logic to close streams where authentication has been revoked is currently implemented in the WebSocket layer.
Place of some part of the implementation:
Lines 239 to 255 in 8f351d1
| var authenticationIsRequired = | |
| methodStreamCallContext.endpoint.requireLogin || | |
| methodStreamCallContext.endpoint.requiredScopes.isNotEmpty; | |
| _AuthenticationContext? authenticationContext; | |
| if (authenticationIsRequired) { | |
| var authenticationInfo = await session.authenticated; | |
| if (authenticationInfo == null) { | |
| throw StateError( | |
| 'Authentication was required and passed but no authentication info could be retrieved.', | |
| ); | |
| } | |
| authenticationContext = _AuthenticationContext( | |
| methodStreamCallContext.endpoint.requiredScopes, | |
| authenticationInfo, | |
| ); | |
| } |
This creates a difference when replicating authentication revoked behavior in the test framework that is being developed.
Describe the solution you'd like
By moving the closing of streams that have their authentication revoked into the endpoint dispatch, this logic can be shared for all code paths that rely on a stream.
This also ensures that the framework behaves the same regardless of transport protocol.
Additional context
This issues is connected to the work being done with the new test framework: #2494
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone 🚀
Activity