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

MODINVSTOR-1237: Don't warn about expected 403 from user-tenant #1051

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Implement domain event production for institution create/update/delete ([MODINVSTOR-1218](https://issues.folio.org/browse/MODINVSTOR-1218))
* Implement a POST request to get Holdings and Instances ([MODINVSTOR-1223](https://folio-org.atlassian.net/browse/MODINVSTOR-1223))
* Implement instance-date-types endpoint ([MODINVSTOR-1235](https://folio-org.atlassian.net/browse/MODINVSTOR-1235))
* 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