@alteran/astro 0.1.12 → 0.1.13
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/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const CORE_ROUTES = [
|
|
|
7
7
|
{ pattern: '/.well-known/did.json', entrypoint: './src/pages/.well-known/did.json.ts' },
|
|
8
8
|
{ pattern: '/health', entrypoint: './src/pages/health.ts' },
|
|
9
9
|
{ pattern: '/ready', entrypoint: './src/pages/ready.ts' },
|
|
10
|
+
{ pattern: '/xrpc/com.atproto.identity.getRecommendedDidCredentials', entrypoint: './src/pages/xrpc/com.atproto.identity.getRecommendedDidCredentials.ts' },
|
|
10
11
|
{ pattern: '/xrpc/com.atproto.identity.resolveHandle', entrypoint: './src/pages/xrpc/com.atproto.identity.resolveHandle.ts' },
|
|
11
12
|
{ pattern: '/xrpc/com.atproto.identity.updateHandle', entrypoint: './src/pages/xrpc/com.atproto.identity.updateHandle.ts' },
|
|
12
13
|
{ pattern: '/xrpc/com.atproto.repo.applyWrites', entrypoint: './src/pages/xrpc/com.atproto.repo.applyWrites.ts' },
|
|
@@ -14,10 +15,16 @@ const CORE_ROUTES = [
|
|
|
14
15
|
{ pattern: '/xrpc/com.atproto.repo.deleteRecord', entrypoint: './src/pages/xrpc/com.atproto.repo.deleteRecord.ts' },
|
|
15
16
|
{ pattern: '/xrpc/com.atproto.repo.describeRepo', entrypoint: './src/pages/xrpc/com.atproto.repo.describeRepo.ts' },
|
|
16
17
|
{ pattern: '/xrpc/com.atproto.repo.getRecord', entrypoint: './src/pages/xrpc/com.atproto.repo.getRecord.ts' },
|
|
18
|
+
{ pattern: '/xrpc/com.atproto.repo.importRepo', entrypoint: './src/pages/xrpc/com.atproto.repo.importRepo.ts' },
|
|
19
|
+
{ pattern: '/xrpc/com.atproto.repo.listMissingBlobs', entrypoint: './src/pages/xrpc/com.atproto.repo.listMissingBlobs.ts' },
|
|
17
20
|
{ pattern: '/xrpc/com.atproto.repo.listRecords', entrypoint: './src/pages/xrpc/com.atproto.repo.listRecords.ts' },
|
|
18
21
|
{ pattern: '/xrpc/com.atproto.repo.putRecord', entrypoint: './src/pages/xrpc/com.atproto.repo.putRecord.ts' },
|
|
19
22
|
{ pattern: '/xrpc/com.atproto.repo.uploadBlob', entrypoint: './src/pages/xrpc/com.atproto.repo.uploadBlob.ts' },
|
|
23
|
+
{ pattern: '/xrpc/com.atproto.server.activateAccount', entrypoint: './src/pages/xrpc/com.atproto.server.activateAccount.ts' },
|
|
24
|
+
{ pattern: '/xrpc/com.atproto.server.checkAccountStatus', entrypoint: './src/pages/xrpc/com.atproto.server.checkAccountStatus.ts' },
|
|
25
|
+
{ pattern: '/xrpc/com.atproto.server.createAccount', entrypoint: './src/pages/xrpc/com.atproto.server.createAccount.ts' },
|
|
20
26
|
{ pattern: '/xrpc/com.atproto.server.createSession', entrypoint: './src/pages/xrpc/com.atproto.server.createSession.ts' },
|
|
27
|
+
{ pattern: '/xrpc/com.atproto.server.deactivateAccount', entrypoint: './src/pages/xrpc/com.atproto.server.deactivateAccount.ts' },
|
|
21
28
|
{ pattern: '/xrpc/com.atproto.server.deleteSession', entrypoint: './src/pages/xrpc/com.atproto.server.deleteSession.ts' },
|
|
22
29
|
{ pattern: '/xrpc/com.atproto.server.describeServer', entrypoint: './src/pages/xrpc/com.atproto.server.describeServer.ts' },
|
|
23
30
|
{ pattern: '/xrpc/com.atproto.server.getSession', entrypoint: './src/pages/xrpc/com.atproto.server.getSession.ts' },
|
|
@@ -26,6 +33,7 @@ const CORE_ROUTES = [
|
|
|
26
33
|
{ pattern: '/xrpc/com.atproto.sync.getBlocks.json', entrypoint: './src/pages/xrpc/com.atproto.sync.getBlocks.json.ts' },
|
|
27
34
|
{ pattern: '/xrpc/com.atproto.sync.getCheckout', entrypoint: './src/pages/xrpc/com.atproto.sync.getCheckout.ts' },
|
|
28
35
|
{ pattern: '/xrpc/com.atproto.sync.getCheckout.json', entrypoint: './src/pages/xrpc/com.atproto.sync.getCheckout.json.ts' },
|
|
36
|
+
{ pattern: '/xrpc/com.atproto.sync.getBlob', entrypoint: './src/pages/xrpc/com.atproto.sync.getBlob.ts' },
|
|
29
37
|
{ pattern: '/xrpc/com.atproto.sync.getHead', entrypoint: './src/pages/xrpc/com.atproto.sync.getHead.ts' },
|
|
30
38
|
{ pattern: '/xrpc/com.atproto.sync.getLatestCommit', entrypoint: './src/pages/xrpc/com.atproto.sync.getLatestCommit.ts' },
|
|
31
39
|
{ pattern: '/xrpc/com.atproto.sync.getRecord', entrypoint: './src/pages/xrpc/com.atproto.sync.getRecord.ts' },
|
package/package.json
CHANGED
|
@@ -4,6 +4,15 @@ import { createAccountState, getAccountState } from '../../db/dal';
|
|
|
4
4
|
|
|
5
5
|
export const prerender = false;
|
|
6
6
|
|
|
7
|
+
function methodNotAllowedResponse(): Response {
|
|
8
|
+
return new Response(null, {
|
|
9
|
+
status: 405,
|
|
10
|
+
headers: {
|
|
11
|
+
Allow: 'POST',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
/**
|
|
8
17
|
* com.atproto.server.createAccount
|
|
9
18
|
*
|
|
@@ -16,7 +25,10 @@ export async function POST({ locals, request }: APIContext) {
|
|
|
16
25
|
const { env } = locals.runtime;
|
|
17
26
|
|
|
18
27
|
// Require authentication for account creation
|
|
19
|
-
if (!(await isAuthorized(request, env)))
|
|
28
|
+
if (!(await isAuthorized(request, env))) {
|
|
29
|
+
console.log(JSON.stringify({ level: 'warn', type: 'createAccount', message: 'Unauthorized', method: request.method, url: request.url }));
|
|
30
|
+
return unauthorized();
|
|
31
|
+
}
|
|
20
32
|
|
|
21
33
|
try {
|
|
22
34
|
const body = await request.json() as { did?: string; handle?: string; deactivated?: boolean };
|
|
@@ -76,4 +88,12 @@ export async function POST({ locals, request }: APIContext) {
|
|
|
76
88
|
{ status: 500, headers: { 'Content-Type': 'application/json' } }
|
|
77
89
|
);
|
|
78
90
|
}
|
|
79
|
-
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function HEAD(): Promise<Response> {
|
|
94
|
+
return methodNotAllowedResponse();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export async function GET(): Promise<Response> {
|
|
98
|
+
return methodNotAllowedResponse();
|
|
99
|
+
}
|