Skip to content

Commit

Permalink
Any 403 with AccessDenied message should be omitted (#245)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zionts authored Oct 19, 2020
2 parents ea0e636 + d31d2db commit 5096a48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gateway-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> 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.
- _Nothing yet! Stay tuned!_
- 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)

## v0.21.0

Expand Down
5 changes: 1 addition & 4 deletions gateway-js/src/loadServicesFromStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ function fetchApolloGcs(
// conditions. We'll special-case our known errors, and resort to
// printing the body for others.
if (
response.headers.get('content-type') === 'application/xml' &&
response.status === 403 &&
body.includes("<Error><Code>AccessDenied</Code>") &&
body.includes("Anonymous caller does not have storage.objects.get")
response.status === 403 && body.includes("AccessDenied")
) {
throw new Error(
"Unable to authenticate with Apollo storage " +
Expand Down

0 comments on commit 5096a48

Please sign in to comment.