Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Connection with InfluxDB needs Authorization API key, not user/password authentification (βœ“ Sandbox Passed) #46

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Feb 12, 2024

PR Feedback (click)

  • πŸ‘ Sweep Did Well
  • πŸ‘Ž Sweep Needs Improvement

Description

This pull request updates the HttpService class in the src/http.service.js file to make the necessary changes for connecting with InfluxDB using an API token for authentication instead of username and password. It also updates the _buildInfluxDBUrl and _writeData methods to handle the changes in authentication based on the InfluxDB version.

Summary

  • Setting Authorization header for API token-based authentication in HttpService class
  • Updating _buildInfluxDBUrl method to handle authentication changes based on InfluxDB version
  • Updating _writeData method to handle authentication changes based on InfluxDB version

Fixes #45.


πŸŽ‰ Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

πŸ’‘ To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

Copy link
Contributor Author

sweep-ai bot commented Feb 12, 2024

Rollback Files For Sweep

  • Rollback changes to src/http.service.js

This is an automated message generated by Sweep AI.

Copy link
Contributor Author

sweep-ai bot commented Feb 12, 2024

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Use let or const instead of var to declare variables.
  • Apply: Use single line if-statements only when it improves readability.
  • Apply: Ensure that the InfluxDB Measurement Name is provided.
  • Apply: Use strict equality (===) when comparing values.
  • Apply: Use template literals instead of concatenation for string interpolation.

This is an automated message generated by Sweep AI.

@sweep-ai sweep-ai bot added the sweep Sweep your software chores label Feb 12, 2024
@@ -79,6 +85,11 @@ class HttpService {
u: this.context.username,
p: this.context.password,
};
} else if (this.context.version == 2) {
const params = {
Copy link

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

p: this.context.password,
};

let params = {};
Copy link

Choose a reason for hiding this comment

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

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

// Setting Authorization header for API token-based authentication
if(this.context.apiToken) {
axiosOptions.headers = {
Authorization: `Token ${this.context.apiToken}`,
Copy link

Choose a reason for hiding this comment

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

'template literal syntax' is only available in ES6 (use 'esversion: 6').

Copy link

sonarcloud bot commented Feb 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Sweep your software chores
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants