Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python
1.9 KB
Raw Blame
diff --git a/apps/native/electron/webauthn-profile.test.cjs b/apps/native/electron/webauthn-profile.test.cjs
index 64bc46b7..5d003336 100644
--- a/apps/native/electron/webauthn-profile.test.cjs
+++ b/apps/native/electron/webauthn-profile.test.cjs
@@ -66,6 +66,13 @@ for (const [name, change] of [
   });
 }
 
+test('rejects a same-team profile for a different bundle even when TEAM.* keychain groups match', () => {
+  const profile = fixture();
+  profile.Entitlements['com.apple.application-identifier'] = 'ABCDE12345.com.unrelated.app';
+  profile.Entitlements['keychain-access-groups'] = ['ABCDE12345.*'];
+  assert.throws(() => authorize(profile), /provisioning profile/);
+});
+
 test('accepts a profile until its expiration boundary', () => {
   const profile = fixture();
   profile.ExpirationDate = new Date(now + 1);
diff --git a/apps/native/electron/webauthn-signing.test.cjs b/apps/native/electron/webauthn-signing.test.cjs
index f0d0805b..688dccd9 100644
--- a/apps/native/electron/webauthn-signing.test.cjs
+++ b/apps/native/electron/webauthn-signing.test.cjs
@@ -94,6 +94,19 @@ test('invalid metadata fails before writing config or invoking signer', async ()
   assert.equal(called, false);
 });
 
+test('signBundle rejects a same-team profile for a different bundle before invoking the signer', async () => {
+  let called = false;
+  await assert.rejects(signBundle({
+    app: 'Fixture.app',
+    identity,
+    profilePath: 'fixture.provisionprofile',
+    readProvisioningProfile: () => profile('com.unrelated.app'),
+    readBundleId: () => bundleId,
+    sign: () => { called = true; },
+  }), /provisioning profile/);
+  assert.equal(called, false);
+});
+
 test('default reader obtains actual bundle identifier through PlistBuddy', { skip: process.platform !== 'darwin' }, async () => {
   const root = await fs.mkdtemp(path.join(os.tmpdir(), 'webauthn-plist-test-'));
   const app = path.join(root, 'Fixture.app');