Skip to content

Commit dd31e51

Browse files
MarcoDotIOclaude
andcommitted
fix(web): removing a secret provider lists the Simlock tokens that read from it
The Remove dialog lists every setting that reads from the secret provider, since removing it unsets them. A Simlock agent token can name a secret provider, and the server unsets it on removal, but the list skipped Simlock hosts, so the dialog could say nothing reads from the provider and then silently clear the token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 1a0f605 commit dd31e51

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎apps/web/src/components/settings/SecretsSettings.logic.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ const settings = Schema.decodeSync(ServerSettings)({
3131
easDeviceHosts: [
3232
{ kind: "eas", id: "eas", label: "EAS Simulator", accessToken: personal("op://expo") },
3333
],
34+
simlockDeviceHosts: [
35+
{
36+
kind: "simlock",
37+
id: "pool",
38+
label: "Simlock Pool",
39+
gatewayUrl: "https://simlock.test",
40+
agentToken: personal("op://simlock"),
41+
},
42+
],
3443
});
3544

3645
it.each([
@@ -42,6 +51,7 @@ it.each([
4251
"GitHub · github.com",
4352
"https://hub.test · Management Key",
4453
"EAS Simulator · Access Token",
54+
"Simlock Pool · Agent Token",
4555
],
4656
],
4757
["work", ["Antigravity Work · OTHER_TOKEN", "GitHub · ghe.acme.test"]],

‎apps/web/src/components/settings/SecretsSettings.logic.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
isSecretReference,
44
secretReferencesInSettings,
55
type ServerSettings,
6+
SimlockDeviceHostConfig,
67
UsageLimitSourceConfig,
78
} from "@t3tools/contracts";
89
import { getProviderClient } from "@t3tools/client-runtime/provider-clients";
@@ -12,7 +13,11 @@ import { deriveProviderSettingsFields, type SettingsFormDefinition } from "./Pro
1213

1314
type SecretUseSettings = Pick<
1415
ServerSettings,
15-
"providerInstances" | "sourceControlHosts" | "usageLimitSources" | "easDeviceHosts"
16+
| "providerInstances"
17+
| "sourceControlHosts"
18+
| "usageLimitSources"
19+
| "easDeviceHosts"
20+
| "simlockDeviceHosts"
1621
>;
1722

1823
interface SecretProviderUse {
@@ -86,5 +91,8 @@ export function secretProviderUses(
8691
...settings.easDeviceHosts.flatMap((host) =>
8792
uses({ settingsSchema: EasDeviceHostConfig }, `eas:${host.id}`, host.label, host),
8893
),
94+
...settings.simlockDeviceHosts.flatMap((host) =>
95+
uses({ settingsSchema: SimlockDeviceHostConfig }, `simlock:${host.id}`, host.label, host),
96+
),
8997
];
9098
}

0 commit comments

Comments
 (0)