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

Unit test boot 3 #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ch4mpy
Copy link
Contributor

@ch4mpy ch4mpy commented Feb 8, 2023

Add some unit-tests for access-control rules on the only endpoint of the application: /api/users/me.

This tests enlight that the Require the role "ACCESS" for all api paths is not implemented (probably a regression when moving from hasAuthority() to access()). This perfectly illustrates the value of such tests.

As those access control rules are very simple, this is quickly tested.

As most production security implementations involve at some access-rules based on authorities, it could be worth adding some RBAC to this application.

@ch4mpy
Copy link
Contributor Author

ch4mpy commented Feb 17, 2023

@thomasdarimont I added a commit to:

  • fix the AccessController so that it implements the access-control rule described in WebSecurityConfig javadoc ("Require the role "ACCESS" for all api paths")
  • update unit tests accordingly
  • add integration tests (enrich the existing @SpringBootTest)

@thomasdarimont thomasdarimont force-pushed the main branch 6 times, most recently from b261678 to cbc4cee Compare November 4, 2023 13:20
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