mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 22:10:21 +00:00
feat(push): add iOS APNs relay gateway (#43369)
* feat(push): add ios apns relay gateway * fix(shared): avoid oslog string concatenation # Conflicts: # apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayChannel.swift * fix(push): harden relay validation and invalidation * fix(push): persist app attest state before relay registration * fix(push): harden relay invalidation and url handling * feat(push): use scoped relay send grants * feat(push): configure ios relay through gateway config * feat(push): bind relay registration to gateway identity * fix(push): tighten ios relay trust flow * fix(push): bound APNs registration fields (#43369) (thanks @ngutman)
This commit is contained in:
22
src/gateway/protocol/push.test.ts
Normal file
22
src/gateway/protocol/push.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import AjvPkg from "ajv";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { PushTestResultSchema } from "./schema/push.js";
|
||||
|
||||
describe("gateway protocol push schema", () => {
|
||||
const Ajv = AjvPkg as unknown as new (opts?: object) => import("ajv").default;
|
||||
const ajv = new Ajv({ allErrors: true, strict: false });
|
||||
const validatePushTestResult = ajv.compile(PushTestResultSchema);
|
||||
|
||||
it("accepts push.test results with a transport", () => {
|
||||
expect(
|
||||
validatePushTestResult({
|
||||
ok: true,
|
||||
status: 200,
|
||||
tokenSuffix: "abcd1234",
|
||||
topic: "ai.openclaw.ios",
|
||||
environment: "production",
|
||||
transport: "relay",
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -22,6 +22,7 @@ export const PushTestResultSchema = Type.Object(
|
||||
tokenSuffix: Type.String(),
|
||||
topic: Type.String(),
|
||||
environment: ApnsEnvironmentSchema,
|
||||
transport: Type.String({ enum: ["direct", "relay"] }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user