Closed sarcasticsys closed 11 years ago
I'll review this afternoon. Thanks for the report.
I have fixed the issue. The registry should now auto-assign positive identifiers when adding services. The issue with duplicate ids is now fixed.
Another tweak I made is to ignore writing back attributes that have empty values.
There are some extra test cases to account for this behavior.
Encountering two problems:
1) Anything new added via the CAS-provided Services Manager gets added to the json file with an id of "-1". Subsequent services added also receive a -1 for the id. The services do seem to validate/allow authentication okay, but it causes a display issue in the Services Manager where you can only see one of them.
2) If you modify an existing service, you wind up with two copies of the service (the old one and the new one).
Using the non read-write version of the DAO does not show this behavior (granted, it doesn't actually write anything out, but the id of subsequent added services and what not don't stick with -1).
My java is a little rusty, but I poked around the code a bit and the inline patch I'll do it as an attachment, but I'm not sure how) clears it up in my test environment well enough; just not sure if this is an actual bug, expected behavior, some quirk of my environment, or me misunderstanding the configuration/use-case.