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

auto correct uri option #296

Merged
merged 11 commits into from
Mar 21, 2024
Merged

auto correct uri option #296

merged 11 commits into from
Mar 21, 2024

Conversation

t-ronmoneta
Copy link
Contributor

Added

  • Added auto correct uri option via flag to all ingestion clients

Changed

Fixed

Security

Copy link

github-actions bot commented Feb 28, 2024

Unit Test Results

    1 files  ±0    16 suites  ±0   3m 50s ⏱️ ±0s
275 tests +5  268 ✔️ +5  7 💤 ±0  0 ±0 
281 runs  +5  274 ✔️ +5  7 💤 ±0  0 ±0 

Results for commit 21bb578. ± Comparison against base commit 6715531.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 80.39%. Comparing base (c100182) to head (16d1e2a).

Files Patch % Lines
...ages/azure-kusto-ingest/src/abstractKustoClient.ts 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #296      +/-   ##
==========================================
+ Coverage   80.21%   80.39%   +0.18%     
==========================================
  Files          41       41              
  Lines        2128     2158      +30     
  Branches      474      485      +11     
==========================================
+ Hits         1707     1735      +28     
- Misses        407      409       +2     
  Partials       14       14              

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

Copy link
Collaborator

@AsafMah AsafMah left a comment

Choose a reason for hiding this comment

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

few comments

if (!authority) {
return true;
}
let is_ip;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Obviously I don't like this.

You could have used the Address4.IsValid static methods for this.

But since we only need to check /if/ it's an ip, we can just use this package - https://www.npmjs.com/package/is-ip, which has a very simple api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Address4.IsValid is deprected, and is-ip doesnt support browser. ended up using this module instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops. thought you meant a different one

}

isReservedHostname(clusterUrl: string): boolean {
const parsedUrl = new URL(clusterUrl);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if this fails? does it throw? will it throw further down the line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, i need to add a try catch here. if it throws though (not a valid url), we consider it as not a reserved hostname right? ill just return false

Copy link
Collaborator

@AsafMah AsafMah left a comment

Choose a reason for hiding this comment

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

Update CHANGELOG.md

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 80.39%. Comparing base (6715531) to head (16d1e2a).

❗ Current head 16d1e2a differs from pull request most recent head 21bb578. Consider uploading reports for the commit 21bb578 to get more accurate results

Files Patch % Lines
...ages/azure-kusto-ingest/src/abstractKustoClient.ts 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #296      +/-   ##
==========================================
+ Coverage   80.21%   80.39%   +0.18%     
==========================================
  Files          41       41              
  Lines        2128     2158      +30     
  Branches      474      485      +11     
==========================================
+ Hits         1707     1735      +28     
- Misses        407      409       +2     
  Partials       14       14              

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

@t-ronmoneta t-ronmoneta merged commit 6336581 into master Mar 21, 2024
5 checks passed
@t-ronmoneta t-ronmoneta deleted the t-ronmoneta/autocorrect_uri branch March 21, 2024 09:44
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.

3 participants