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

Discussion for validation of config #24

Closed
vsoch opened this issue Oct 15, 2020 · 2 comments · Fixed by #29
Closed

Discussion for validation of config #24

vsoch opened this issue Oct 15, 2020 · 2 comments · Fixed by #29

Comments

@vsoch
Copy link
Contributor

vsoch commented Oct 15, 2020

This line notes that we should do validation of the client config after populating options, and it would be good if this validation is consistent between Reggie here and "reggie-python" I'm currently putting together. So far, I'm thinking these are the basic needs:

  • required fields: the client config absolutely should have an address and a user agent.
  • address: the address starts with http (or other regular expression for a valid url)

The other fields are specific to authentication, debug, or similar, so I don't think there is any basic validation to do, at least on init.

@jdolitsky
Copy link
Contributor

@vsoch - I think address and user-agent are good place to start.

Here are some cross-language tips for URL validation: https://urlregex.com/

Wasn't able to find whats valid for user agent: https://tools.ietf.org/html/rfc7231#section-5.5.3

Maybe we just check it is non-empty?

@vsoch
Copy link
Contributor Author

vsoch commented Oct 15, 2020

Maybe we just check it is non-empty?

I think that's reasonable! I'll add it to the client I'm working on, and can try a PR here after the client is finished.

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 a pull request may close this issue.

2 participants