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

CBG-4459 validate cv when passed in #7293

Open
wants to merge 2 commits into
base: release/anemone
Choose a base branch
from
Open

Conversation

torcolvin
Copy link
Collaborator

CBG-4459 validate cv when passed in

  • validate that sourceID is base64, requires some test changes
  • pass back better error messages if hlv was not found

The sourceID from CBL/CBS never include padding, so I used base64.RawStdEncoding to generate sourceIDs. Not all ASCII strings are valid base64, so I changed some strings.

I considered doing regexp parsing for invalid characters, since what was happening before this PR was that "1@abc; 2@def" was getting parsed as SourceID=abc; 2@def Value=1. I decided to just parse as base64 since this will provide more robust validation. There are two possible downsides to this: it is slightly more expensive to call ParseVersion and we can't use any artibrary string for source id for debugging.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

- validate that sourceID is base64, requires some test changes
- pass back better error messages if hlv was not found
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.

2 participants