-
Notifications
You must be signed in to change notification settings - Fork 186
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
feat: config option to allow basic auth #263
Conversation
This can be useful for setups of InfluxDB 1.8 without authentication when authentication is handled by a proxy instead.
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
==========================================
- Coverage 91.93% 91.91% -0.02%
==========================================
Files 25 25
Lines 2033 2042 +9
==========================================
+ Hits 1869 1877 +8
- Misses 164 165 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR 👍
There is a few requirements that should be satisfy before we accept the PR:
- Please add documentation of
auth_basic
option to::key str ssl_ca_cert: Set this to customize the certificate file to verify the peer. - Add support for configuration by
config_file
:
def from_config_file(cls, config_file: str = "config.ini", debug=None, enable_gzip=False): - Add support for configuration by
env_properties
:
def from_env_properties(cls, debug=None, enable_gzip=False): - Add new configuration option to
README.rst
:
- Add tests:
def test_init_from_ini_file(self): def test_init_from_toml_file(self):
Regards
Thanks @bednar will do! I was just wondering, since this option would only apply when using the client in combination with the 1.8 compatibility API (AFAIK disabling auth for InfluxDB 2.0 is not an option?) if this configuration option should go into the [influx2] config section or if it makes sense to introduce a [influx1] compatibility section to make it more clear that this can/should only be used in combination with 1.8. kr |
Good point 👍 I think we can use
I don't think so. It is too tricky.
I think that a note in documentation that the option is suitable only for InfluxDB 1.8+ will be pretty enough. |
Done
I see, took a look and seems one can also use "-" as an org name in InfluxDB2. Indeed tricky. I'll leave it up to the user to read documentation and not use the option with 2.x
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reinhard-brandstaedter, thanks again for your PR 👍
Please update CHANGELOG.md
and we will be ready to merge PR into master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥇
feat: add option for basic auth when using influxdb 1.8 compatibility API
Closes #262
Proposed Changes
Add an additional option
auth_basic: True|False
for the InfluxDBClient, which allows to use the client in cases where reverse proxies are being used for authentication instead of InfluxDBs own authentication (applies only for InfluxDB 1.8 forward compatibility API).Using reverse proxies is quite a common setup, so this makes it easier to integrate in such scenarios.
Checklist
pytest tests
completes successfully