-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add IP metrics to REST #2174
Add IP metrics to REST #2174
Conversation
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Codecov Report
@@ Coverage Diff @@
## main #2174 +/- ##
=======================================
Coverage ? 81.82%
Complexity ? 2130
=======================================
Files ? 414
Lines ? 11131
Branches ? 945
=======================================
Hits ? 9108
Misses ? 1714
Partials ? 309 Continue to review full report at Codecov.
|
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
A sample of what the metrics will look like (tested locally). |
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
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.
Clarification requests
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
After changes, this is the look: |
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
hedera-mirror-rest/package-lock.json
Outdated
@@ -1,8 +1,11722 @@ | |||
{ | |||
"name": "hedera-mirror-rest", | |||
"version": "0.37.0-SNAPSHOT", | |||
"lockfileVersion": 1, | |||
"lockfileVersion": 2, |
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.
Fix
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
describe('Utils ipMask tests', () => { | ||
test('Verify ipV4', () => { | ||
const maskedIp = utils.ipMask('12.214.31.144'); | ||
expect(maskedIp).toStrictEqual('12.214.31.0'); | ||
}); | ||
test('Verify ipV6', () => { | ||
const maskedIp = utils.ipMask('2001:0db8:85a3:a13c:0000:8a2e:0370:7334'); | ||
expect(maskedIp).toStrictEqual('2001:db8:85a3::'); | ||
}); | ||
test('Verify ipV6 short form back', () => { | ||
const maskedIp = utils.ipMask('1::'); | ||
expect(maskedIp).toStrictEqual('1::'); | ||
}); | ||
test('Verify ipV6 short form front', () => { | ||
const maskedIp = utils.ipMask('::ffff'); | ||
expect(maskedIp).toStrictEqual('::'); | ||
}); | ||
test('Verify ipV6 dual', () => { | ||
const maskedIp = utils.ipMask('2001:db8:3333:4444:5555:6666:1.2.3.4'); | ||
expect(maskedIp).toStrictEqual('2001:db8:3333::0.0.0.0'); | ||
}); |
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.
These IPs were taken from examples for the library, some made up, none are sensitive.
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.
LGTM
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.
LGTM
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
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.
LGTM
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
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.
LGTM
Signed-off-by: Ian Jungmann <ian.jungmann@hedera.com>
687f89e
SonarCloud Quality Gate failed. |
Detailed description:
Add a metric to track which IPs hit which endpoints.
The intention is to use this metric for environments where we have whitelisted IPs and already know who is accessing the API, it is not meant for public environments.
Which issue(s) this PR fixes:
Fixes #2130
Special notes for your reviewer:
Checklist