I looked at the bridge_proxy code (bridge_proxy.c++) and found this:
KJ_IF_MAYBE(auth, headers.get(hAuthorization)) {
if (auth->startsWith("bearer ") || auth->startsWith("Bearer ")) {
auto token = auth->slice(strlen("bearer "));
auto service = getHttpSession(token);
return dispatchToSession(kj::mv(service), method, url, headers, requestBody, response);
}
}
From this I conclude that no, multiple Bearer tokens are not handled by Sandstorm. There's no attempt to parse a comma separated list here, so this code would fail to find the bearer token it needs. However, it also passes along the Authorization header, it doesn't appear to be deleted, though I could be wrong about that. More than one Authorization header is non-conformant, though it probably would work here as long as the one Sandstorm wants is first. It would then pass both along to GCS, and who knows what would happen there. We don't have the source to those servers.
If I knew a bit more about Sandstorm, I could attempt a fix here that A) looked for multiple Bearer tokens B) Searched the list for one that was registered with me and C) deleted that from the Authorization header and passed the rest along. Frankly, I think it should likely remove the Authorization header if it contains nothing but the Sandstorm bearer token, but there may be a reason to keep it, I'm not quite enough of an expert to be sure of that.