canister-auth-headers.mjs
sha256:7fe782411f3a68b39f17777b274349b30752365c13438b26bfd602c687de2c65
feat(web): rebrand Parentier family to Ourware on landing
Human
minor
⚠ breaking
20 days ago
| 1 | /** |
| 2 | * ICP canister HTTP expects X-Gateway-Auth matching canister `gateway_auth_secret` |
| 3 | * (see hub/icp `gatewayAuthorized` — SEC-KN-1 fail-closed: empty secret DENIES). |
| 4 | * The gateway proxy always merges this; direct fetch helpers must do the same. |
| 5 | * When CANISTER_AUTH_SECRET is empty, callers send no header and the canister returns |
| 6 | * GATEWAY_AUTH_REQUIRED on every protected route. |
| 7 | */ |
| 8 | export function canisterAuthHeaders() { |
| 9 | const secret = process.env.CANISTER_AUTH_SECRET || ''; |
| 10 | if (!secret) return {}; |
| 11 | return { 'x-gateway-auth': secret }; |
| 12 | } |
File History
1 commit
sha256:7fe782411f3a68b39f17777b274349b30752365c13438b26bfd602c687de2c65
feat(web): rebrand Parentier family to Ourware on landing
Human
minor
⚠
20 days ago