Skip to content

Add Basic Authentication support to net_http_request table #108

@bob-bot

Description

@bob-bot

Is your feature request related to a problem? Please describe.
When querying APIs that require Basic Authentication, there's no straightforward way to pass credentials. Currently, I have to manually encode credentials to base64 and construct the Authorization header myself, which is cumbersome compared to tools like curl that handle this automatically with the --user username:password flag.

Describe the solution you'd like
Add a user_credentials column to the net_http_request table that accepts credentials in the format username:password. The plugin should automatically encode these credentials and add the appropriate Authorization: Basic header to the request, similar to curl's --user flag.

Example:

SELECT 
  response_body, response_status_code 
FROM 
  net_http_request 
WHERE 
  url = 'https://api.example.com/data' 
  AND user_credentials = 'myuser:mypassword'
  AND insecure = true;

Describe alternatives you've considered

  • Manually encoding credentials to base64 and passing via request_headers = '{"Authorization": "Basic base64string"}' - this works but requires extra steps and is error-prone
  • Creating a separate connection configuration for auth - would be overkill for simple Basic Auth
  • Using environment variables - less flexible in Pipes or other locations
  • I tried the example in the docs for using in request_body but was not passing correctly and was clunky with json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions