wirejs-deploy-amplify-basic 0.0.101-realtime → 0.0.102-realtime
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.
|
@@ -52,6 +52,11 @@ export const handler = async (event: AuthorizationRequest): Promise<Authorizatio
|
|
|
52
52
|
*/
|
|
53
53
|
try {
|
|
54
54
|
console.log('Authorization event:', JSON.stringify(event, null, 2));
|
|
55
|
+
|
|
56
|
+
if (event.requestContext.operation === 'EVENT_PUBLISH') {
|
|
57
|
+
throw new Error('Publish not permitted');
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
const token = event.authorizationToken;
|
|
56
61
|
if (!token) {
|
|
57
62
|
throw new Error('Authorization token is missing');
|
|
@@ -60,11 +65,9 @@ export const handler = async (event: AuthorizationRequest): Promise<Authorizatio
|
|
|
60
65
|
token,
|
|
61
66
|
new TextEncoder().encode(await getSecret(event.requestContext.channelNamespaceName))
|
|
62
67
|
);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!['EVENT_CONNECT', 'EVENT_SUBSCRIBE'].includes(event.requestContext.operation)) {
|
|
67
|
-
throw new Error('Operation mismatch');
|
|
68
|
+
|
|
69
|
+
if (event.requestContext.channel && decoded.payload.channel !== event.requestContext.channel) {
|
|
70
|
+
throw new Error(`Channel mismatch: expected ${event.requestContext.channel}, got ${decoded.payload.channel}`);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
// Default TTL from AppSync is 5 minutes according to construct docstring.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirejs-deploy-amplify-basic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.102-realtime",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"recursive-copy": "^2.0.14",
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
43
|
"wirejs-dom": "^1.0.41",
|
|
44
|
-
"wirejs-resources": "^0.1.
|
|
44
|
+
"wirejs-resources": "^0.1.70-realtime"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@aws-amplify/backend": "^1.14.0",
|