canister-auth-headers.mjs
10 lines 388 B
Raw
sha256:94ec65bd2b200240ac785a97cf14c5db066832bd608a24d6a9c151f17b918b02 feat(calendar): hosted bridge/gateway route parity and time… Human minor ⚠ breaking 37 days ago
1 /**
2 * ICP canister HTTP expects X-Gateway-Auth when the canister has a non-empty
3 * gateway_auth_secret (see hub/icp `gatewayAuthorized`). The gateway proxy
4 * always merges this; direct fetch helpers must do the same.
5 */
6 export function canisterAuthHeaders() {
7 const secret = process.env.CANISTER_AUTH_SECRET || '';
8 if (!secret) return {};
9 return { 'x-gateway-auth': secret };
10 }
File History 1 commit
sha256:94ec65bd2b200240ac785a97cf14c5db066832bd608a24d6a9c151f17b918b02 feat(calendar): hosted bridge/gateway route parity and time… Human minor 37 days ago