Skip to content

feat: add support for BearerToken and TOTP authentication#351

Merged
zitsen merged 8 commits intomainfrom
feat/token
Jan 9, 2026
Merged

feat: add support for BearerToken and TOTP authentication#351
zitsen merged 8 commits intomainfrom
feat/token

Conversation

@huskar-t
Copy link
Copy Markdown
Collaborator

@huskar-t huskar-t commented Dec 31, 2025

Description

feat: add support for BearerToken and TOTP authentication

Issue(s)

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 93.54839% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.74%. Comparing base (6f61f25) to head (d179de0).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
common/testtool/sql.go 69.23% 2 Missing and 2 partials ⚠️
taosRestful/connection.go 50.00% 0 Missing and 1 partial ⚠️
ws/schemaless/schemaless.go 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #351      +/-   ##
==========================================
+ Coverage   85.68%   85.74%   +0.05%     
==========================================
  Files          80       83       +3     
  Lines        9077     9149      +72     
==========================================
+ Hits         7778     7845      +67     
- Misses        790      792       +2     
- Partials      509      512       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings December 31, 2025 06:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for BearerToken and TOTP (Time-based One-Time Password) authentication mechanisms to the TDengine driver, enhancing security options for enterprise users. The implementation includes connector information tracking for better observability.

Key changes:

  • Added TOTP code generation and validation utilities
  • Implemented bearer token authentication support across WebSocket and RESTful interfaces
  • Added connector information tracking to identify client connections in performance monitoring

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
common/totp.go New TOTP utility functions for generating secrets and codes
common/totp_test.go Unit tests for TOTP generation functions
common/process.go Added GetConnectorInfo function for client identification
common/testenv/env.go New test environment utilities for enterprise feature detection
common/testenv/env_test.go Tests for enterprise test environment detection
version/version.go New version information file with tag and commit
taosWS/proto.go Extended connection request with TOTP and bearer token fields
taosWS/connection.go Integrated TOTP and bearer token into connection logic
taosWS/dsn.go Added DSN parameter parsing for bearerToken and totpCode
taosWS/dsn_test.go Tests for DSN parsing with new authentication parameters
taosWS/connector_test.go Integration tests for TOTP and bearer token authentication
taosRestful/dsn.go Added bearer token DSN parameter support
taosRestful/dsn_test.go Tests for bearer token DSN parsing
taosRestful/connection.go Integrated bearer token authorization header
taosRestful/connector_test.go Integration test for bearer token authentication
ws/stmt/proto.go Extended connection request with authentication fields
ws/stmt/config.go Added configuration setters for TOTP and bearer token
ws/stmt/connector.go Updated connection logic with new authentication
ws/stmt/stmt_test.go Tests for connector info, TOTP, and bearer token
ws/schemaless/proto.go Extended connection request with authentication fields
ws/schemaless/config.go Added configuration options for TOTP and bearer token
ws/schemaless/schemaless.go Updated connection logic with authentication support
ws/schemaless/schemaless_test.go Tests for connector info, TOTP, and bearer token
ws/tmq/proto.go Added app and connector fields to subscribe request
ws/tmq/consumer.go Integrated connector info into TMQ consumer
ws/tmq/consumer_test.go Test for connector info tracking in TMQ
.github/workflows/enterprise.yml New CI workflow for enterprise edition testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread taosWS/connector_test.go
Comment thread common/totp.go
Comment thread ws/tmq/consumer_test.go Outdated
Comment thread ws/stmt/stmt_test.go
Comment thread ws/stmt/stmt_test.go
Comment thread common/totp.go
Comment thread common/totp.go
Comment thread ws/stmt/stmt_test.go Outdated
Comment thread ws/stmt/stmt_test.go Outdated
Comment thread common/process.go
@zitsen zitsen merged commit 96e0e3b into main Jan 9, 2026
9 checks passed
@zitsen zitsen deleted the feat/token branch January 9, 2026 06:45
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.

5 participants