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 detailed validation of metadata-server responses #2509

Merged
merged 7 commits into from
Feb 12, 2021

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Feb 11, 2021

Issue Number

ADP-413

Overview

  • Add detailed validation of metadata-server responses
  • Adds more json parsing and validation tests
  • Fixes the mock metadata server so that it supports invalid metadata, and only returns properties requested, rather than all properties available.

@rvl rvl self-assigned this Feb 11, 2021
| otherwise = Left $ "Length must be no more than " ++ show maxLen ++ " bytes, got " ++ show len
where
len = BS.length $ unAssetLogo logo
maxLen = 87400
Copy link
Member

Choose a reason for hiding this comment

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

maxLen should be 65535 (64KB) here right? 87400 is the max-length of the base64-encoded data payload.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

@rvl rvl force-pushed the rvl/adp-413/metadata-validation branch from b168fd6 to 066e6a2 Compare February 11, 2021 10:29
Base automatically changed from KtorZ/ADP-413/non-required-well-known-properties to master February 11, 2021 11:18
@KtorZ KtorZ force-pushed the rvl/adp-413/metadata-validation branch from 066e6a2 to 53ca900 Compare February 11, 2021 16:07
Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

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

LGTM. Not sure what's missing from the draft PR ?

@KtorZ KtorZ force-pushed the rvl/adp-413/metadata-validation branch 2 times, most recently from f9a4209 to 3ba56ce Compare February 11, 2021 19:20
@rvl rvl force-pushed the rvl/adp-413/metadata-validation branch from 3ba56ce to 4f2119b Compare February 12, 2021 01:33
@rvl rvl force-pushed the rvl/adp-413/metadata-validation branch from 4f2119b to c6a0486 Compare February 12, 2021 05:02
@rvl rvl force-pushed the rvl/adp-413/metadata-validation branch from d39e901 to a5cdbbe Compare February 12, 2021 05:46
@rvl rvl marked this pull request as ready for review February 12, 2021 05:47
@rvl rvl force-pushed the rvl/adp-413/metadata-validation branch from a5cdbbe to 7e3ea34 Compare February 12, 2021 05:48
@rvl
Copy link
Contributor Author

rvl commented Feb 12, 2021

It was still draft because there were test failures, which I eventually found were because I didn't update the mock metadata server after changing the types.

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 12, 2021
2509: Add detailed validation of metadata-server responses r=rvl a=rvl

### Issue Number

ADP-413

### Overview

- Add detailed validation of metadata-server responses
- Adds more json parsing and validation tests
- Fixes the mock metadata server so that it supports invalid metadata, and only returns properties requested, rather than all properties available.


Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 12, 2021

Build failed:

It failed on weeder, doh! Everything else passed.

#expected

@rvl rvl merged commit d98f708 into master Feb 12, 2021
@rvl rvl deleted the rvl/adp-413/metadata-validation branch February 12, 2021 06:34
KtorZ pushed a commit that referenced this pull request Feb 12, 2021
…lidation

Add detailed validation of metadata-server responses
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.

None yet

2 participants