Skip to content

Commit

Permalink
Merge pull request #1051 from folio-org/MODINVSTOR-1237-user-tenants-403
Browse files Browse the repository at this point in the history
MODINVSTOR-1237: Don't warn about expected 403 from user-tenant
  • Loading branch information
julianladisch authored Aug 5, 2024
2 parents e9b093e + 5be547a commit 5d3e753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Implement instance-date-types endpoint ([MODINVSTOR-1235](https://folio-org.atlassian.net/browse/MODINVSTOR-1235))
* Implement Subject types management ([MODINVSTOR-1221](https://folio-org.atlassian.net/browse/MODINVSTOR-1221))
* Implement endpoint to publish reindex event for the range of instance/item/holding records ([MODINVSTOR-1230](https://folio-org.atlassian.net/browse/MODINVSTOR-1230))
* Info, not warn, about expected 403 from /user-tenants ([MODINVSTOR-1237](https://folio-org.atlassian.net/browse/MODINVSTOR-1237))

### Bug fixes
* Unintended update of instance records \_version (optimistic locking) whenever any of its holdings or items are created, updated or deleted. ([MODINVSTOR-1186](https://folio-org.atlassian.net/browse/MODINVSTOR-1186))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ private CompletableFuture<Optional<ConsortiumData>> loadConsortiumData(String te
headers.forEach(request::putHeader);

return request.send().compose(response -> {
if (response.statusCode() == HTTP_FORBIDDEN) {
LOG.info("loadConsortiumData:: Skipping for tenant {} because {} returns 403 (forbidden)",
tenantId, USER_TENANTS_PATH);
return Future.succeededFuture(Optional.<ConsortiumData>empty());
}
if (response.statusCode() != HTTP_OK) {
String msg = String.format("Error loading consortium data, tenantId: '%s' response status: '%s', body: '%s'",
tenantId, response.statusCode(), response.bodyAsString());
LOG.warn("loadConsortiumData:: {}", msg);
if (response.statusCode() == HTTP_FORBIDDEN) {
return Future.succeededFuture(Optional.<ConsortiumData>empty());
}

return Future.failedFuture(msg);
}
JsonArray userTenants = response.bodyAsJsonObject().getJsonArray(USER_TENANTS_FIELD);
Expand Down

0 comments on commit 5d3e753

Please sign in to comment.