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

Add "development" modes for the library #37

Open
wasadigi opened this issue Jan 11, 2018 · 0 comments
Open

Add "development" modes for the library #37

wasadigi opened this issue Jan 11, 2018 · 0 comments
Assignees

Comments

@wasadigi
Copy link
Member

The library is great and easy to integrate. However, when another microservice has added the dependency and added the annotations, the users microservice MUST be running for it to work (otherwise, it won't even boot because fetching the public key will fail and throw a fatal exception).

It would be very useful to have a configurable property to specify in which "mode" the library works. I can think of 3 modes:

  • enabled (enforces the security and passes the auth information, as today)
  • disabled (does not do anything)
  • mock (passes a "mocked" authentication information)

In the "mock" mode, the library does not try to get data from the json web token. Instead, it passes information configured via other properties in the application.properties file (e.g. io.pestakit.users.mock.username, .userid, etc.).

One could even think of a 4th mode that extracts data from the json web token passed in the header, but does NOT validate the signature of this token. I have mixed feelings: it is useful for testing purposes (I can write tests with different users), but it is also a bit dangerous (it MUST NOT leak to production).

@McMoudi McMoudi self-assigned this Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants