Repository navigation
docs: provide complete TaskAuthorizationProvider example - #1146
Merged
ehsavoie merged 2 commits intoSep 15, 2026
Merged
Conversation
ehsavoie
requested changes
Sep 11, 2026
|
|
||
| @ApplicationScoped | ||
| public class MyTaskAuthorizationProvider implements TaskAuthorizationProvider { | ||
| private final ConcurrentMap<String, String> owners = new ConcurrentHashMap<>(); |
Collaborator
There was a problem hiding this comment.
I think the variable ownershipStore makes more sense
Contributor
Author
There was a problem hiding this comment.
Renamed the map to ownershipStore in both the development guide and the API Javadoc example in ff9a841.
| @Override | ||
| public boolean checkRead(ServerCallContext context, String taskId, TaskOperation op) { | ||
| return isOwner(context.getUser(), taskId); | ||
| String owner = owners.get(taskId); |
Collaborator
There was a problem hiding this comment.
I think this should be in a private method isOwner
Contributor
Author
There was a problem hiding this comment.
Extracted the ownership lookup into a private isOwner(context, taskId) helper in both examples in ff9a841.
ehsavoie
approved these changes
Sep 15, 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.
Description
The authorization examples referenced undefined
isOwnerandownershipStoresymbols, so they could not be used as a complete implementation ofTaskAuthorizationProvider.This change:
putIfAbsent; andTesting
mvn -o -Dmaven.repo.local=/tmp/m2-a2a-1143 -f docs/pom.xml -DskipTests packagemvn -Dmaven.repo.local=/tmp/m2-a2a-1143 -pl server-common -am -DskipTests packageFixes #1143 🦕