-
Notifications
You must be signed in to change notification settings - Fork 64
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
Improve logging and validation for license keys. #2982
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tippmar-nr
reviewed
Feb 3, 2025
src/Agent/NewRelic/Agent/Core/Configuration/DefaultConfiguration.cs
Outdated
Show resolved
Hide resolved
chynesNR
reviewed
Feb 3, 2025
src/Agent/NewRelic/Agent/Core/Configuration/DefaultConfiguration.cs
Outdated
Show resolved
Hide resolved
…wrelic/newrelic-dotnet-agent into other/expanded-license-key-validation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2982 +/- ##
==========================================
- Coverage 82.19% 82.17% -0.02%
==========================================
Files 473 473
Lines 30362 30391 +29
Branches 3388 3392 +4
==========================================
+ Hits 24955 24975 +20
- Misses 4606 4617 +11
+ Partials 801 799 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
chynesNR
approved these changes
Feb 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
feat: Improve logging and validation for license keys. (#2982)
END_COMMIT_OVERRIDE
Description
Adds an additional warning when the agent receives a HTTP 401 Unauthorized response from the collector. This occurs when the key is not valid (for many reasons).
Expands the validation logic from the license key in DefaultConfiguration to:
Unit tests have been expanded to cover the new logic.
Note: valid in this context means that it is not null or whitespace, exactly 40 ASCII characters from 0x21 to 0x7E, or string contains "license" (case insensitive)).
Fixes #2969
Fixes #2783
Author Checklist
Reviewer Checklist