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

align connection options and allow override of protocol from env #305

Merged
merged 3 commits into from
Oct 21, 2023

Conversation

line-o
Copy link
Member

@line-o line-o commented Oct 18, 2023

Features

aligned connection options allows to use the same options for both APIs, REST and XML-RPC

The legacy option { secure: true|false } will now work for both APIs as setting the protocol does.
{ protocol: "https:"|"http:" } is now the preferred way to switch between encrypted and unencrypted
connections and works for both APIs.

Fixes

REST connection options read from environment can override default protocol (https:)

Documentation

clarify connection options and usage - fixes #240

@line-o line-o requested a review from a team October 18, 2023 10:20
Copy link
Contributor

@duncdrum duncdrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its necessary it should be mentioned here https://github.com/eXist-db/node-exist#rest . Having both environmentOptions.secure and environmentOptions.protocol isn't self-evident

This is needed to allow REST connections using
`http:` to override the default (`https:`).
@line-o
Copy link
Member Author

line-o commented Oct 18, 2023

@duncdrum I just re-read the section explaining the REST endpoint and agree that it should include a section how to configure that connection - by hand - and also point out that the options returned from readOptionsFromEnv can be used there, too.

Both REST and XML-RPC now have the same set of default options.
The boolean option `secure` can still be used
to control XMLRPC client, but `protocol` is the preferred way.
This allows to use the same set of options for both client constructors.

Add test to ensure legacy option is still working.
- fix TOC
- rename and improve Configuration section to Connection Options
- clarify wording in Use - REST
- clarify that Components is using XML-RPC
@line-o
Copy link
Member Author

line-o commented Oct 19, 2023

@duncdrum your demand to better document connection options lead to a serious quality of life improvement :)

@line-o line-o requested a review from duncdrum October 19, 2023 21:27
@line-o line-o changed the title fix(connection): readOptionsFromEnv sets protocol align connection options and allow override of protocol from env Oct 19, 2023
Copy link
Contributor

@duncdrum duncdrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice this looks much better now

@duncdrum duncdrum merged commit 1a37ec2 into eXist-db:main Oct 21, 2023
12 of 13 checks passed
@github-actions
Copy link

🎉 This PR is included in version 5.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] misleading authentication error message
2 participants