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

fix(jans-config-api): organization update returns 500 #3019

Closed
moabu opened this issue Nov 17, 2022 · 3 comments
Closed

fix(jans-config-api): organization update returns 500 #3019

moabu opened this issue Nov 17, 2022 · 3 comments
Assignees
Labels
comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Milestone

Comments

@moabu
Copy link
Member

moabu commented Nov 17, 2022

When updating the organization, the backend returns a 500 error.

Payload:

[{"op":"replace","path":"/dn","value":"o=janssen"},{"op":"replace","path":"/displayName","value":"TestDisplayName"},{"op":"replace","path":"/description","value":"TestDescription"},{"op":"replace","path":"/member","value":"yes"},{"op":"replace","path":"/organization","value":"TestOrga"},{"op":"replace","path":"/managerGroup","value":"TestManagerGroup"},{"op":"replace","path":"/shortName","value":"TestShortName"},{"op":"replace","path":"/organizationTitle","value":"TestOrganizationTitle"},{"op":"replace","path":"/baseDn","value":"o=janssen"}]

Exception on server:

com.github.fge.jsonpatch.JsonPatchException: no such path in target JSON document
	at com.github.fge.jsonpatch.ReplaceOperation.apply(ReplaceOperation.java:66)
	at com.github.fge.jsonpatch.JsonPatch.apply(JsonPatch.java:149)
	at io.jans.configapi.core.util.Jackson.applyPatch(Jackson.java:69)
	at io.jans.configapi.core.util.Jackson.applyPatch(Jackson.java:55)
	at io.jans.configapi.rest.resource.auth.OrganizationResource.patchOrganization(OrganizationResource.java:71)
	at io.jans.configapi.rest.resource.auth.OrganizationResource$Proxy$_$$_WeldSubclass.patchOrganization$$super(Unknown Source)
@moabu moabu added this to the 1.0.5 milestone Nov 17, 2022
@mo-auto mo-auto added comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Nov 17, 2022
@pujavs
Copy link
Contributor

pujavs commented Nov 18, 2022

JsonPath not returning the error of missing path, this will need custom handling of each operation to send the operations 1 by one and report missing path.
For time being added exception reporting.
On exclusively testing the operation locally found that

  1. attribute name should be member rather memberOf. Also value of member should be valid DN
    image

  2. organizationTitle attribute was removed as per issue#fix(jans-config-api): organization attributes not updated #2756
    image

  3. If a attribute has null value in DB then as per JSON-PATCH documentation we should use add operation rather than replace. Will also try to handle this in custom logic

@moabu moabu modified the milestones: 1.0.5, 1.0.6 Dec 1, 2022
@pujavs
Copy link
Contributor

pujavs commented Dec 23, 2022

@moabu, is there some unaddressed aspect pending for this issue?

@moabu
Copy link
Member Author

moabu commented Dec 23, 2022

Nope. Great work thanks . I'm closing this one

@moabu moabu closed this as completed Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants