tursodatabase / tursodatabase/libsql

[Go]: Not providing an `authToken` leads to opaque "Authorization header not provided"

Open
#794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

I just spent 2 days diagnosing this issue, so I'm putting this here so others are a bit luckier. I used https://github.com/joho/godotenv + a .env file with an authentication token to a Turso DB, but forgot to call godotenv.Load() so my DB URL looked something like:

"libsql://[name]-[user].turso.io?authToken="

I'd have expected something like this to lead to a more transparent error (e.g. "no auth token provided" or something), as "Authorization header not provided" led me to think there was something wrong with SQLx instead.

Not sure if there is anything to fix here, but I hope this helps someone avoid wasting days of sanity over such a stupid mistake, lol.

Great product btw!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified. Start by tracing the Go authentication handling for a database URL with an empty authToken and determine where the generic authorization error is produced. Done means the missing-token case reports a clear, actionable error and is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.