InfluxCommunity / influxdb3-go

The go package that provides a simple and convenient way to interact with InfluxDB 3.
https://pkg.go.dev/github.com/InfluxCommunity/influxdb3-go
MIT License
24 stars 13 forks source link

feat: add a token prefix for config #88

Closed wj-stack closed 2 months ago

wj-stack commented 3 months ago

When I use client to write data, influxv3 displays a message indicating

 panic: {"error":"Authorization header was malformed and should be in the form 'Authorization: Bearer <token>'"}

, so I submit this pr

Proposed Changes

Briefly describe your proposed changes:

Checklist

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.24%. Comparing base (b4f432a) to head (86458a2). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #88 +/- ## ========================================== - Coverage 83.90% 78.24% -5.67% ========================================== Files 13 13 Lines 1044 1048 +4 ========================================== - Hits 876 820 -56 - Misses 138 199 +61 + Partials 30 29 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bednar commented 3 months ago

Hi @wj-stack, thanks for your PR. Which version of the InfluxDB do you use?

wj-stack commented 3 months ago

Hi @wj-stack, thanks for your PR. Which version of the InfluxDB do you use?

use influxdb v3

bednar commented 3 months ago

Which type? Serverless, Dedicated, or custom build of OSS?

wj-stack commented 3 months ago

Which type? Serverless, Dedicated, or custom build of OSS?

edge version (pre-release)? I just cloned the latest code and compiled it for use

alespour commented 3 months ago

I suggest TokenPrefix to be renamed to AuthScheme, acc. terminology used in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization.

alespour commented 2 months ago

For your consideration: refactored in #91