Skip to content

Conversation

@lmangani
Copy link
Collaborator

@lmangani lmangani commented Oct 15, 2024

PR adds support for #5

  • X-API-Key header: 'yoursecrettoken`
  • Basic Authentication header: username:password

Usage

Basic Auth

SELECT httpserve_start('localhost', 9999, 'your_api_key_or_user:pass');
curl -X POST -d "SELECT 'hello', version()" "http://user:pass@localhost:9999/"

Token Auth

SELECT httpserve_start('localhost', 9999, 'supersecretkey');
curl -X POST --header "X-API-Key: supersecretkey" -d "SELECT 'hello', version()" "http://localhost:9999/"

@lmangani
Copy link
Collaborator Author

Hey @carlopi just looking for expert opinion.... Do we think the auth parameter should be mandatory or an optional := param?

@lmangani lmangani changed the title Authentication (basic or x-header) API Authentication (basic or x-header) Oct 15, 2024
@lmangani lmangani merged commit ec47a4c into main Oct 15, 2024
@lmangani lmangani deleted the auth branch October 15, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant