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

expose internal test tools #170

Open
amoore877 opened this issue Jul 26, 2021 · 2 comments
Open

expose internal test tools #170

amoore877 opened this issue Jul 26, 2021 · 2 comments

Comments

@amoore877
Copy link
Member

Specifically referencing v2/internal/test, though there may be other instances.

Use case:
In trying to test an in-house health checker against WorkloadAPI/FetchX509SVID components, go-spiffe code tends to expect very precise data (key usage, parseable cert/key/bundle DERs...) and a lot of convenience code exists for testing but is blocked off inside of internal.
It would be helpful to expose this tooling for operators:

  • out of convenience
  • automatically keep operator's tests and go-spiffe imports in-sync, as testing libs must inherently be kept up to date with breaking changes in go-spiffe
@zmt
Copy link

zmt commented Jul 27, 2021

I think the fakes, etc. probably need some work to be ready to graduate from internal. At least that was the case a few months ago when I was last reading through the code there. Perhaps we can identify a laundry list of specific issues that will require code changes to make the testing utilities ready for export and use this issue to track?

@azdagron
Copy link
Member

I think providing a convenient fake implementation of the Workload API is certainly within the purview of go-spiffe. I don't think the internal test infrastructure is quite there. They were not authored for public consumption, but rather to facilitate testing the internals of the library, and the consequences of that show up in some of the design decisions. We made them internal precisely because we didn't have the time to go through the exercise of determining what would make a useful fake that would be subject to compatibility guarantees.

If go-spiffe is going to export a convenient fake implementation, I think @zmt is right, we need to identify some good initial use cases and design the fake in a way that makes it extendible in the future in code compatible ways.

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

No branches or pull requests

3 participants