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

Add validation for namespace, metric and timestamp #135

Merged
merged 9 commits into from
Sep 15, 2022
Merged

Add validation for namespace, metric and timestamp #135

merged 9 commits into from
Sep 15, 2022

Conversation

markkuhn
Copy link
Contributor

@markkuhn markkuhn commented Aug 25, 2022

Related to: #131

Description of changes:
Adding validation for metrics and namespace since validating dimensions alone doesn't make sense.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@markkuhn markkuhn self-assigned this Aug 25, 2022
@markkuhn markkuhn added the enhancement New feature or request label Aug 25, 2022
@markkuhn markkuhn requested review from evanuk and removed request for giancarlokc August 25, 2022 23:34
src/utils/Validator.ts Outdated Show resolved Hide resolved
replace faker with non deprecated faker
update repo to comply with new eslint rules
change isNaN to Number.isNaN in validator
change metric max/min vals
@markkuhn
Copy link
Contributor Author

markkuhn commented Sep 2, 2022

Update:

  • The faker dependency currently used is deprecated/no longer maintained so I replaced it with @faker-js/faker.
  • Updated TypeScript to 4.8.2
  • Updated eslint to 8.23.0 and made some minor changes based on the new rules
  • Since the min/max Metric values specified in the specs are outside the Number range, we will be validating against Number.MAX_SAFE_INTEGER and -Number.MAX_SAFE_INTEGER
  • changed isNaN() to Number.isNaN()

Interesting read on what happened to faker and how the creator starting pushing malicious updates.

@markkuhn markkuhn requested a review from evanuk September 2, 2022 00:33
@markkuhn markkuhn changed the title Add validation for namespace and metric Add validation for namespace, metric and timestamp Sep 2, 2022
@markkuhn markkuhn merged commit cc8ac0e into awslabs:master Sep 15, 2022
@markkuhn markkuhn linked an issue Sep 15, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime Validations
3 participants