-
Notifications
You must be signed in to change notification settings - Fork 501
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
IP group JSON should support single addresses #3340
Comments
Conflicts: src/main/java/edu/harvard/iq/dataverse/api/Admin.java src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java src/test/java/edu/harvard/iq/dataverse/util/json/JsonParserTest.java As of 1f5fcfe and earlier (not sure how far back) this branch cannot be merged with develop since develop advanced with the release of 4.5 (pull request #3308 especially was merged in). A simple `git merge develop` yielded merge conflics, especially with JsonPrinter.java and I was unable to resolve them using Netbeans. (I had to run `git merge --abort` after three attempts.) I decided to revert JsonPrinter.java to its state in 4.5 with `git checkout dc58ae1 src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java` and then manually copy the changes needed to get the app to compile from the `1380-honor-ip-groups` branch (specifically https://github.com/IQSS/dataverse/blob/2ada66142fd8fca3a61da4db46268cfba650e4a9/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java ). I tried to get all the changes but it's possible I missed some. `public static JsonObjectBuilder json( IpGroup grp )` especially had some changes having to do with `List<List<String>> ranges = grp.getRanges().stream().filter( rng -> !rng.isSingleAddress()` and such. It looks like this change happened in a336475. The commit message starts with "IP group json format now supports single addresses". I opened #3340 to revisit this part of the code or at least to test and document how it's supposed to work. Meanwhile, I tested #3273 which is what I'm actually working on and the "groups within groups" bug seems to be fixed both before and after the merge.
re: the documentation: I'm note sure we have a central place for documenting the formats (we should, of course, but I'm not sure we have the personnel). |
@michbarsinai thanks for the fix at b0c0779 ! I just moved this card to the QA column at https://waffle.io/IQSS/dataverse |
This works but it requires that you specify both the ipv4 and ipv6 forms of the address, otherwise you get a 500 error. The range form allows only specifying ipv4, which is convenient. Passing back to Michael for conisderation. |
Found another aspect to this issue: in addition to not allowing just ipv4, the ranges version only works with ipv4. It allows both but then does not properly detect the incoming ip addr. |
@kcondon I was not able to reproduce this (or, it's reverse day again). Here's what I did:
Up to this point - no 500 errors. Then I ran inclusion tests using the test API endpoint |
@michbarsinai
I can do a little more digging to more clearly identify steps if you want or if the above are not clear enough. |
Tested all combinations and they all work! Closing. |
I gather from a336475 that IP groups should be able to be expressed as a single address. This should be tested/documented. I'm in the middle of resolving merge conflicts in pull request #3103 and I'm a little worried that I may be unfixing this? I'll leave a comment in a bit.
The text was updated successfully, but these errors were encountered: