-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make VerificationError
available in the API
#691
Comments
Thanks for filing this! Could you say a bit more about your intended use case here? |
This would be mostly for reuse in other CLIs that wrap |
Making sure I understand: by other CLIs, do you mean other Python programs that are importing Overall, I think I'd prefer if we stick to the result-style API as the primary source of error state in the public APIs -- it's arguably less Pythonic, but it allows us to encode the error states in the type system rather than in an unchecked exception hierarchy. My experience with other end-user cryptography APIs (like try:
something()
except OurType:
normal_failure_mode()
except Exception:
weird_failure_mode() ...which in turn indicates a porous API and means that we can't make semver guarantees around error states, like we can currently. Does that reasoning make sense to you? If so, I'm inclined to close #692 and keep these exception types private; IMO it might also make sense to add some documentation emphasizing the technical rationale above 🙂 |
I meant other Python CLIs importing from the
Ok I was not aware that this type of issue could arise, so it makes sense to keep returning a result type value in this case. Thanks for the detailed answer (worth documenting indeed), closing #692 then 👍 |
Sounds good! I'll repurpose this issue to track that documentation. |
FYI @mayaCostantini: we've refactored the verification APIs to be exception driven, so xref #959 |
Description
Make
VerificationError
defined insigstore/_cli.py
available in the verification API as it could be reused outside of the CLI.See #692 for example implementation.
The text was updated successfully, but these errors were encountered: