feat: add support for BearerToken and TOTP authentication#351
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
Description
feat: add support for BearerToken and TOTP authentication
Issue(s)
Checklist
Please check the items in the checklist if applicable.