Skip to content

Commit

Permalink
Raw search with POST - release 7.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jul 17, 2024
1 parent 89f2942 commit b7997c6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manage-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>manage</artifactId>
<version>7.4.3</version>
<version>7.4.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion manage-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>manage</artifactId>
<version>7.4.3</version>
<version>7.4.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,13 @@ public List<Map> searchEntities(@PathVariable("type") String type,
@GetMapping({"/client/rawSearch/{type}", "/internal/rawSearch/{type}"})
public List<MetaData> rawSearch(@PathVariable("type") String type, @RequestParam("query") String query)
throws UnsupportedEncodingException {
return metaDataService.retrieveRawSearch(type, query);
}

@PreAuthorize("hasAnyRole('ADMIN', 'READ')")
@PostMapping({"/client/rawSearch/{type}", "/internal/rawSearch/{type}"})
public List<MetaData> rawSearchPost(@PathVariable("type") String type, @RequestBody String query)
throws UnsupportedEncodingException {
return metaDataService.retrieveRawSearch(type, query);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,23 @@ public void rawSearchEncoded() throws UnsupportedEncodingException {
.body("size()", is(5));
}

@Test
public void rawSearchPost() {
String query = "{$and: [{$or:[{\"data.allowedEntities.name\": {$in: [\"http://mock-idp\"]}}, {\"data" +
".allowedall\": true}]}, {\"data.state\":\"prodaccepted\"}]}";
given()
.auth()
.preemptive()
.basic("sp-portal", "secret")
.when()
.header("Content-type", "application/json")
.body(query)
.post("manage/api/internal/rawSearch/saml20_sp")
.then()
.statusCode(SC_OK)
.body("size()", is(5));
}

private void doUpdate(EntityType type, String id, String revisionNote) {
MetaData metaData = given()
.when()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.openconext</groupId>
<artifactId>manage</artifactId>
<version>7.4.3</version>
<version>7.4.4</version>
<packaging>pom</packaging>

<name>manage</name>
Expand Down

0 comments on commit b7997c6

Please sign in to comment.