oidc icon indicating copy to clipboard operation
oidc copied to clipboard

example server isn't enough for testing

Open muir opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I'm using the oidc library as both client and server. When using it as a client, I need a server to test against (not my own, since my own is a proxy). The example server isn't configurable enough to use in tests.

Describe the solution you'd like

What I would like to do is make changes to the example server so that it's more robust and has Go interface.

Describe alternatives you've considered

My concern is that the purpose of the example server is mostly to be documentation. Anything I do to it to give it additional features will obscure the documentation it provides.

The features I need are:

  • set up / tear down from inside tests. That means moving most of what's in the main package to a sub-package and then just calling it from main.
  • thread safe. Adding locks isn't hard, but it complicates the code a little bit
  • override the user storage. In tests, I need control over the set of users so I need a public interface for user lookup that I can provide from my own tests. This requires restructuring the test code a little bit inside example/server/internal. That restructuring again complicates the code without improving it's function as an example

Additional context

My basic question is: if I do this work as described above, would it be merged or would it be rejected because adding features makes the example not quite as good documentation as it was?

I've already started. If the answer is: not merged, then I'll simply copy the code into my own repo.

muir avatar Aug 19 '22 22:08 muir

Hey @muir I'll look at this issue and your PR this week.

livio-a avatar Aug 22 '22 05:08 livio-a

:tada: This issue has been resolved in version 1.9.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Oct 04 '22 05:10 github-actions[bot]