Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .agents/skills/write-gatekeeper/SKELETON.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ export class MyGatekeeperImpl extends DurableObject<Env, MyGatekeeperImplProps>
// - Strategy D (low-stakes): make both methods no-ops.
// - Strategy C (data-set tracking): record observed sets + store verifiers, and route every read
// through an authorizeSetObservation helper that sets `excludeObservers` (see SKILL.md).
// - Workshop-tracked (`supportsObserverTracking` in describe()): always throw (a redeploy can
// land between the Workshop's describe() and this call); authorize every read with
// authorizeTrackedObservation(), reporting its `subresources`, and implement
// verifyObserverAccess(observers, ids) instead, checking each observer's verifier the same way.
async addObserver(_id: string, user: Fetcher<GatekeeperUserVerifier>): Promise<void> {
let verifier = user as unknown as Fetcher<MyVerifierApi>;
if (!(await verifier.hasResourceAccess(/* this.ctx.props.resourceId */ "TODO"))) {
Expand Down
54 changes: 42 additions & 12 deletions .agents/skills/write-gatekeeper/SKILL.md

Large diffs are not rendered by default.

153 changes: 136 additions & 17 deletions docs/observers.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/gatekeeper-google/__tests__/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class TestApprovalQueue extends RpcTarget implements ApprovalQueue {
this.observations.push(description.description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Unexpected tracked observation");
}

async getGitCache(): Promise<GitCache> {
throw new Error("Unexpected git cache access");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class TestApprovalQueue extends RpcTarget implements ApprovalQueue {
this.observations.push(description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Unexpected tracked observation");
}

async getGitCache(): Promise<GitCache> {
throw new Error("Unexpected git cache access");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class TestApprovalQueue extends RpcTarget implements ApprovalQueue {
this.observations.push(description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Unexpected tracked observation");
}

async getGitCache(): Promise<GitCache> {
throw new Error("Unexpected git cache access");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class TestApprovalQueue extends RpcTarget implements ApprovalQueue {
this.observations.push(description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Unexpected tracked observation");
}

async getGitCache(): Promise<GitCache> {
throw new Error("Unexpected git cache access");
}
Expand Down
4 changes: 4 additions & 0 deletions packages/gatekeeper-google/__tests__/workerd/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class TestApprovalQueue extends RpcTarget {
}
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Tracked observations are not used by these tests.");
}

async submitAction(actionId: number, description: unknown): Promise<void> {
this.#submissions.push({actionId, description});
if (this.#pausedSubmission) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class FixtureQueue extends RpcTarget {
observations.push(description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("The conformance gatekeeper does not use observer tracking.");
}

async submitAction(action: number, description: ActionDescription): Promise<void> {
submissions.push([action, description]);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/gatekeeper-kit/__tests__/workerd/cursors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class TestAuthorizer extends RpcTarget implements ObservationAuthorizer {
this.#seen.push(description.description);
}

async authorizeTrackedObservation(): Promise<void> {
throw new Error("Tracked observations are not used in this test.");
}

async getGitCache(): Promise<GitCache> {
throw new Error("Git cache is not used in this test.");
}
Expand Down
Loading
Loading