@alteran/astro 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/jwt.ts +2 -2
- package/src/worker/runtime.ts +14 -0
package/package.json
CHANGED
package/src/lib/jwt.ts
CHANGED
|
@@ -111,9 +111,9 @@ async function eddsaJwtSign(payload: any, env: Env): Promise<string> {
|
|
|
111
111
|
// Decode base64 private key
|
|
112
112
|
const keyBytes = b64urlDecode(keyData);
|
|
113
113
|
const key = await crypto.subtle.importKey(
|
|
114
|
-
'
|
|
114
|
+
'pkcs8',
|
|
115
115
|
keyBytes,
|
|
116
|
-
{ name: 'Ed25519'
|
|
116
|
+
{ name: 'Ed25519' } as any,
|
|
117
117
|
false,
|
|
118
118
|
['sign']
|
|
119
119
|
);
|
package/src/worker/runtime.ts
CHANGED
|
@@ -33,6 +33,20 @@ export function createPdsFetchHandler(options?: CreatePdsFetchHandlerOptions): P
|
|
|
33
33
|
// treat secrets uniformly regardless of source (Secret or Secret Store).
|
|
34
34
|
const resolvedEnv = await resolveEnvSecrets(env);
|
|
35
35
|
|
|
36
|
+
// Cloudflare's Astro adapter expects an ASSETS binding for serving static
|
|
37
|
+
// fallback content. Our worker doesn't ship static assets in production,
|
|
38
|
+
// so provide a no-op stub to prevent adapter crashes (error code 1101).
|
|
39
|
+
if (!resolvedEnv.ASSETS || typeof (resolvedEnv as any).ASSETS.fetch !== 'function') {
|
|
40
|
+
(resolvedEnv as any).ASSETS = {
|
|
41
|
+
async fetch() {
|
|
42
|
+
return new Response('Not Found', {
|
|
43
|
+
status: 404,
|
|
44
|
+
headers: { 'Cache-Control': 'public, max-age=60' },
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
try {
|
|
37
51
|
validateConfigOrThrow(resolvedEnv);
|
|
38
52
|
} catch (error) {
|