Add an optional name field to secret materials so users can label their stored credentials. Update the schema model, the postgres provider, and all test fixtures to include the new column.
Unified · Split
| @@ -0,0 +1 @@ | |||
| 1 | ALTER TABLE "secret_materials" ADD COLUMN "name" text; | ||
| @@ -82,6 +82,7 @@ const seedWorkspaceCredentialState = (input: { · 81 unmodified lines | |||
| 82 | }); | 82 | }); |
| 83 | yield* input.persistence.rows.secretMaterials.upsert({ | 83 | yield* input.persistence.rows.secretMaterials.upsert({ |
| 84 | id: tokenId, | 84 | id: tokenId, |
| 85 | name: null, | ||
| 85 | purpose: "oauth_access_token", | 86 | purpose: "oauth_access_token", |
| 86 | value: "token", | 87 | value: "token", |
| 87 | createdAt: now, | 88 | createdAt: now, |
| @@ -89,6 +90,7 @@ const seedWorkspaceCredentialState = (input: { · 1 unmodified line | |||
| 89 | }); | 90 | }); |
| 90 | yield* input.persistence.rows.secretMaterials.upsert({ | 91 | yield* input.persistence.rows.secretMaterials.upsert({ |
| 91 | id: refreshId, | 92 | id: refreshId, |
| 93 | name: null, | ||
| 92 | purpose: "oauth_refresh_token", | 94 | purpose: "oauth_refresh_token", |
| 93 | value: "refresh", | 95 | value: "refresh", |
| 94 | createdAt: now, | 96 | createdAt: now, |
| @@ -243,6 +243,7 @@ const createPostgresSecretMaterialProvider = (): SecretMaterialProvider => ({ · 242 unmodified lines | |||
| 243 | const id = SecretMaterialIdSchema.make(`sec_${randomUUID()}`); | 243 | const id = SecretMaterialIdSchema.make(`sec_${randomUUID()}`); |
| 244 | yield* runtime.rows.secretMaterials.upsert({ | 244 | yield* runtime.rows.secretMaterials.upsert({ |
| 245 | id, | 245 | id, |
| 246 | name: null, | ||
| 246 | purpose, | 247 | purpose, |
| 247 | value, | 248 | value, |
| 248 | createdAt: now, | 249 | createdAt: now, |
| @@ -85,6 +85,7 @@ describe("source-store", () => { · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | yield* persistence.rows.secretMaterials.upsert({ | 86 | yield* persistence.rows.secretMaterials.upsert({ |
| 87 | id: firstTokenId, | 87 | id: firstTokenId, |
| 88 | name: null, | ||
| 88 | purpose: "auth_material", | 89 | purpose: "auth_material", |
| 89 | value: "ghp_first", | 90 | value: "ghp_first", |
| 90 | createdAt: now, | 91 | createdAt: now, |
| @@ -92,6 +93,7 @@ describe("source-store", () => { · 1 unmodified line | |||
| 92 | }); | 93 | }); |
| 93 | yield* persistence.rows.secretMaterials.upsert({ | 94 | yield* persistence.rows.secretMaterials.upsert({ |
| 94 | id: secondTokenId, | 95 | id: secondTokenId, |
| 96 | name: null, | ||
| 95 | purpose: "auth_material", | 97 | purpose: "auth_material", |
| 96 | value: "ghp_second", | 98 | value: "ghp_second", |
| 97 | createdAt: now, | 99 | createdAt: now, |
| @@ -584,6 +584,7 @@ const makeResolver = (persistence: SqlControlPlanePersistence) => · 583 unmodified lines | |||
| 584 | storeSecretMaterial: () => Effect.fail(new Error("not implemented in test")), | 584 | storeSecretMaterial: () => Effect.fail(new Error("not implemented in test")), |
| 585 | getSourceById: () => Effect.fail(new Error("not implemented in test")), | 585 | getSourceById: () => Effect.fail(new Error("not implemented in test")), |
| 586 | addExecutorSource: () => Effect.fail(new Error("not implemented in test")), | 586 | addExecutorSource: () => Effect.fail(new Error("not implemented in test")), |
| 587 | connectMcpSource: () => Effect.fail(new Error("not implemented in test")), | ||
| 587 | completeSourceCredentialSetup: () => Effect.fail(new Error("not implemented in test")), | 588 | completeSourceCredentialSetup: () => Effect.fail(new Error("not implemented in test")), |
| 588 | } as RuntimeSourceAuthService, | 589 | } as RuntimeSourceAuthService, |
| 589 | }); | 590 | }); |
| @@ -738,6 +739,7 @@ describe("workspace-execution-environment", () => { · 148 unmodified lines | |||
| 738 | ); | 739 | ); |
| 739 | yield* persistence.rows.secretMaterials.upsert({ | 740 | yield* persistence.rows.secretMaterials.upsert({ |
| 740 | id: tokenSecretMaterialId, | 741 | id: tokenSecretMaterialId, |
| 742 | name: null, | ||
| 741 | purpose: "auth_material", | 743 | purpose: "auth_material", |
| 742 | value: "ghp_test_token", | 744 | value: "ghp_test_token", |
| 743 | createdAt: now, | 745 | createdAt: now, |
| @@ -14,6 +14,7 @@ export const SecretMaterialPurposeSchema = Schema.Literal( · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | const secretMaterialSchemaOverrides = { | 15 | const secretMaterialSchemaOverrides = { |
| 16 | id: SecretMaterialIdSchema, | 16 | id: SecretMaterialIdSchema, |
| 17 | name: Schema.NullOr(Schema.String), | ||
| 17 | purpose: SecretMaterialPurposeSchema, | 18 | purpose: SecretMaterialPurposeSchema, |
| 18 | createdAt: TimestampMsSchema, | 19 | createdAt: TimestampMsSchema, |
| 19 | updatedAt: TimestampMsSchema, | 20 | updatedAt: TimestampMsSchema, |