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

JsonPatch test success #6

Open
wants to merge 1 commit into
base: rmannibucau/json-patch-jwt-payload
Choose a base branch
from

Conversation

dabloem
Copy link

@dabloem dabloem commented Jan 20, 2021

No description provided.

public class JsonPatchTest extends Arquillian {
@Deployment(testable = false)
public static Archive<?> war() {
System.setProperty("geronimo.jwt-auth.jwt.payload.patch.default", "[ { \"op\": \"copy\", \"from\":\"/resource_access/service-C/groups\", \"path\": \"/groups\" } ]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use microprofile properties as a webapp asset instead? Goal is to have each test able to run in the same suite. TCK have a bug about it but we shouldnt prevent ourself to do it IMHO.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I try.
btw, you agree, that the defaultPatch is always used when no mapping is found (regardless off default kid value)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If kid is not in the mapping yes.
That said wonder if we shoulf support "none" value in the mapping to ease skipping that.
Wdyt?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any real benefit in a 'none' value currently.
btw, I couldn't manage to get microprofile-config.properties to work. Either the tck tests fail or the projects tests fail when I add/remove a mp-config impl.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we dont support none then we only use default if kid is not set, not in all other cases to respect mapping config.
Not configured in mapping means "none" in this case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, the patch.mapping has higher priority then patch.default. So, if no patch.mapping is found then always apply the default jsonpatch if defined (regardless of geronimo.jwt-auth.jwt.header.kid.default is set, or not). This seems fine by me.
What is your use case, to be sure I understand you correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one ;).
Point is that if you want default to be used if there is no mapping there is the need of a "noop" mapping (skipping an empty jsonpatch array for perf) so i proposed none.

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.

2 participants