Skip to content

Commit 5096a48

Browse files
authored
Any 403 with AccessDenied message should be omitted (#245)
* Any 403 with AccessDenied message should be omitted These errors appear to continue to bubble up to users. This changes our error-handling to omit any 403 with the string "AccessDenied" in its text when communicating with `federation.api.apollographql.com` * Do not require XML * Update changelog
2 parents ea0e636 + d31d2db commit 5096a48

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

gateway-js/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
66
7-
- _Nothing yet! Stay tuned!_
7+
- Whenever "AccessDenied" 403 error comes from Apollo, provide a useful error message indicating how to resolve the problem. [PR #245](https://github.com/apollographql/federation/pull/245)
88

99
## v0.21.0
1010

gateway-js/src/loadServicesFromStorage.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ function fetchApolloGcs(
8181
// conditions. We'll special-case our known errors, and resort to
8282
// printing the body for others.
8383
if (
84-
response.headers.get('content-type') === 'application/xml' &&
85-
response.status === 403 &&
86-
body.includes("<Error><Code>AccessDenied</Code>") &&
87-
body.includes("Anonymous caller does not have storage.objects.get")
84+
response.status === 403 && body.includes("AccessDenied")
8885
) {
8986
throw new Error(
9087
"Unable to authenticate with Apollo storage " +

0 commit comments

Comments
 (0)