Skip to content

Conversation

tm-bookshop
Copy link

@tm-bookshop tm-bookshop commented Jun 29, 2023

Goal: Wrap more of the functionality of LCP server into exported functions that can be used as a library from other Go services.

For example it seems useful to wrap validation things like checkGetLicenseInput, copyInputToLicense, buildLicense, etc inside a single, exported function that can be called from outside an HTTP handler.

Context:

  • We'd like to use the LCP/LSD servers as libraries in our existing Go project so we don't have the additional Ops overhead of running additional servers
  • I am assuming will we want input validation on partial licenses and other inputs to the LCP license handlers - this was the motivation for moving more things into the exported license.go functions

Some other changes in this PR:

  • A couple of the HTTP response codes in the license handlers has changed. To try to not change them too much, I introduced a new Error that wraps more detailed input-validation error messages

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.

1 participant