feat: show how to secure api by using scope#81
Merged
jsinovassin merged 2 commits intomasterfrom Feb 18, 2026
Merged
Conversation
44360c2 to
7f80e45
Compare
jayblanc
requested changes
Feb 18, 2026
Contributor
There was a problem hiding this comment.
Could we add some comments here to explain values and options ?
jayblanc
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new sample module,
protected-servlet-sample, demonstrating how to declare and protect a servlet with OSGi and Jahia's security filter. The module provides a servlet with scoped API endpoints and includes configuration for permission management.New sample module addition:
protected-servlet-sampleas a new Maven module in the project.Servlet implementation and security:
SampleServletinprotected-servlet-sample/src/main/java/org/sample/modules/sampleservlet/SampleServlet.java, providing API endpoints (sayHello,sayHi,sayBye) and enforcing access control using Jahia'sPermissionService.Authorization configuration:
org.jahia.bundles.api.authorization-sample.yamlinprotected-servlet-sample/src/main/resources/META-INF/configurationsto define thesampleScopepermission, restricting access to the servlet APIs to admin users.