Skip to content

Conversation

@vietj
Copy link
Member

@vietj vietj commented Sep 6, 2024

Motivation:

The scram dependency is optional and the module descriptor declares it as static, however in practice when the scram dependency is not available the client cannot be used because the ScramAuthentication is unavailable due to a classloading error. The client should be resilient to this common case and continue to work when scram is not available.

Changes:

Introduce an indirection level, the scram interactions are now handled by a ScramSession and the ScramAuthentication is a factory for sessions. When the scram dependency is not available the ScramAuthentication instance is null, the InitCommandCodec can check this field and throw an exception that will close the connection (as per the protocol requirements).

Result:

The client runs fine without the scram dependency on the class/module path.

Motivation:

The scram dependency is optional and the module descriptor declares it as static, however in practice when the scram dependency is not available the client cannot be used because the ScramAuthentication is unavailable due to a classloading error. The client should be resilient to this common case and continue to work when scram is not available.

Changes:

Introduce an indirection level, the scram interactions are now handled by a ScramSession and the ScramAuthentication is a factory for sessions. When the scram dependency is not available the ScramAuthentication instance is null, the InitCommandCodec can check this field and throw an exception that will close the connection (as per the protocol requirements).

Result:

The client runs fine without the scram dependency on the class/module path.
@vietj vietj added this to the 5.0.0 milestone Sep 6, 2024
@vietj vietj self-assigned this Sep 6, 2024
@vietj vietj changed the title Let the client run fine when the scram dependency is not available. Let the client run fine when the scram dependency is not available Sep 6, 2024
@vietj vietj merged commit e309fe0 into master Sep 6, 2024
@vietj vietj deleted the missing-scram-dependency-handling branch September 6, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants