nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16.08k stars 1.42k forks source link

Add minimum allowable client library version configuration block #3215

Open phho opened 2 years ago

phho commented 2 years ago

Feature Request

Provide minimum allowable client library version configuration block feature, so that NATS server can deny outdated client library connections to avoid unexpected server and client behaviors.

Use Case:

NATS server administrator can configure programming language and minimum allowable client library version to protect NATS servers.

Proposed Change:

As slack discussion with Derek, Byron, Todd and Jeremy. All NATS client libraries should already follow semver rule. It will be helpful to provide configuration block feature like below.

allow_client_lang_verions :[
{ lang: "java" , min_version: "2.15.0"},
{ lang: "go" , min_version: "1.15.0"},
...
]

Who Benefits From The Change(s)?

All NATS user

Alternative Approaches

Slack thread link and attach discussion snapshot.

lang-version-configuration-block-suggestion
tbeets commented 2 years ago

This is a good ER @phho . Thank you for submitting. I will be creating an ADR for some design discuss of syntax and functionality.

I believe there is probably room for a non-inclusive "max" option as well, e.g. As an operator I want to specify that a client of type Java must be of version 1.15.6 or greater but in any case less than version 2.0.0.

phho commented 2 years ago

Thank @tbeets for your reply. Your design is indeed more complete. The max options can avoid the unexpected behavior of the client when the server is running in a previous stable version, but the client uses the new version of libray to connect to the server and wants to use the latest server functionality.

tbeets commented 2 years ago

@phho I have started ADR-27.

h20220025 commented 2 years ago

hi @derekcollison i am looking forward to work in order to resolve the issue.

derekcollison commented 2 years ago

We like the idea, won't make it into 2.9 but is on our radar.