janl commented on pull request #3425:
URL: https://github.com/apache/couchdb/pull/3425#issuecomment-800150924
@nickva I remembered that we report that in the header but thought we might
want to not add info to each request that never changes per server.
That kick-started a few more thoughts:
1. some users treat build versions as security sensitive. This is of course
folly, and I have to admit that it hasn’t come up in quite a while.
2. What is the use of reporting these? The initial request is for diagnostic
reasons, but there is another use case: client libraries adjusting behaviour
based on what capabilities a server has.
3. For diagnosis, one can easily argue that an admin-required endpoint is a
natural choice (hence _system), but for the client-library use-case, we’d
ideally want a public endpoint.
4. I still think we shouldn’t add static info to each request, even if just
2-3 bytes.
Then I though we should just re-use the existing capabilities mechanism in
`/`, but that gets us to the problem that existing capabilities are a list of
strings. But now we’d have tagged strings, something like `"otp-20.3.8.25"`,
which folks then need to know how to parse. If we made them proper JSON, say
`{"otp":"20.3.8.25"}`, then we might break capabilities parsers that expect
strings.
So I think we should just add this to the server info JSON from `/`:
```
{
"couchdb": "Welcome",
"version": "3.1.1",
"otp":"20.3.8.25",
"spidermonkey": "68",
"git_sha": "ce596c65d",
"uuid": "d077378b841f6b2c5d2f9c6ae753c769",
"features": [
"access-ready",
"partitioned",
"pluggable-storage-engines",
"reshard",
"scheduler"
],
"vendor": {
"name": "The Apache Software Foundation"
}
}
```
(the SpiderMonkey version should be a string, so we can express `"1.8.5"`,
and not have to switch this field between numbers and strings, and it makes us
future-proof against version scheme changes)
That way:
1. client libraries can get the server config once and behave accordingly,
2. we don’t add any overhead to responses (we could even deprecate the
existing OTP section of the `Server` header, but one thing at a time ;)
3. diagnostics can get at the data easily as well
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]