Skip to content

Commit b3c3b19

Browse files
authoredMar 17, 2025··
Merge pull request #4684 from continuedev/nate/org-secret-resolution
use org scope to resolve org secrets
2 parents 6ab3b32 + 31a2ac6 commit b3c3b19

File tree

7 files changed

+27
-18
lines changed

7 files changed

+27
-18
lines changed
 

‎core/package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@aws-sdk/client-sagemaker-runtime": "^3.758.0",
4747
"@aws-sdk/credential-providers": "^3.758.0",
4848
"@continuedev/config-types": "^1.0.13",
49-
"@continuedev/config-yaml": "^1.0.61",
49+
"@continuedev/config-yaml": "^1.0.63",
5050
"@continuedev/fetch": "^1.0.4",
5151
"@continuedev/llm-info": "^1.0.2",
5252
"@continuedev/openai-adapters": "^1.0.10",

‎gui/package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:watch": "vitest"
1616
},
1717
"dependencies": {
18-
"@continuedev/config-yaml": "^1.0.61",
18+
"@continuedev/config-yaml": "^1.0.63",
1919
"@headlessui/react": "^1.7.17",
2020
"@heroicons/react": "^2.0.18",
2121
"@reduxjs/toolkit": "^2.3.0",

‎packages/config-yaml/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@continuedev/config-yaml",
3-
"version": "1.0.61",
3+
"version": "1.0.63",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

‎packages/config-yaml/src/interfaces/index.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export function getLocationsToLook(
3232
blockSlug: PackageSlug | undefined,
3333
currentUserSlug: string,
3434
secretName: string,
35+
orgScopeSlug: string | null,
3536
): SecretLocation[] {
3637
const locationsToLook: SecretLocation[] = [
3738
...(blockSlug
@@ -57,11 +58,15 @@ export function getLocationsToLook(
5758
secretName,
5859
},
5960
// Organization that owns assistant (org secrets can only be used in assistants owned by that org)
60-
{
61-
secretType: SecretType.Organization as const,
62-
orgSlug: assistantSlug.ownerSlug,
63-
secretName,
64-
},
61+
...(orgScopeSlug
62+
? [
63+
{
64+
secretType: SecretType.Organization as const,
65+
orgSlug: orgScopeSlug,
66+
secretName,
67+
},
68+
]
69+
: []),
6570
// User
6671
{
6772
secretType: SecretType.User as const,
@@ -90,6 +95,7 @@ export function listAvailableSecrets(
9095
assistantSlug: PackageSlug,
9196
blockSlug: PackageSlug | undefined,
9297
currentUserSlug: string,
98+
orgScopeSlug: string | null,
9399
): SecretLocation[] {
94100
// Create a set of all secret names
95101
const allSecretNames = new Set([
@@ -108,6 +114,7 @@ export function listAvailableSecrets(
108114
blockSlug,
109115
currentUserSlug,
110116
secretName,
117+
orgScopeSlug,
111118
);
112119

113120
// Go through the locations one by one
@@ -155,6 +162,7 @@ export async function resolveFQSN(
155162
currentUserSlug: string,
156163
fqsn: FQSN,
157164
platformSecretStore: PlatformSecretStore,
165+
orgScopeSlug: string | null,
158166
): Promise<SecretResult> {
159167
// First create the list of secret locations to try in order
160168
const assistantSlug = fqsn.packageSlugs[0];
@@ -164,6 +172,7 @@ export async function resolveFQSN(
164172
blockSlug,
165173
currentUserSlug,
166174
fqsn.secretName,
175+
orgScopeSlug,
167176
);
168177

169178
// Then try to get the secret from each location

‎packages/config-yaml/test/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("E2E Scenarios", () => {
4444
): Promise<(SecretResult | undefined)[]> {
4545
return await Promise.all(
4646
fqsns.map((fqsn) =>
47-
resolveFQSN("test-user", fqsn, platformSecretStore),
47+
resolveFQSN("test-user", fqsn, platformSecretStore, "test-org"),
4848
),
4949
);
5050
},

0 commit comments

Comments
 (0)
Please sign in to comment.