@@ -1242,7 +1242,7 @@ describe("microsoft-foundry plugin", () => {
12421242 expect ( normalized ?. compat ?. supportsReasoningEffort ) . toBe ( false ) ;
12431243 } ) ;
12441244
1245- it ( "keeps API-key credentials scoped to auth profiles" , ( ) => {
1245+ it ( "deletes legacy provider-level credentials for API-key profiles" , ( ) => {
12461246 const result = buildFoundryAuthResult ( {
12471247 profileId : "microsoft-foundry:default" ,
12481248 apiKey : "test-api-key" ,
@@ -1256,6 +1256,9 @@ describe("microsoft-foundry plugin", () => {
12561256 expect ( provider . apiKey ) . toBeUndefined ( ) ;
12571257 expect ( provider . authHeader ) . toBeUndefined ( ) ;
12581258 expect ( provider . headers ) . toBeUndefined ( ) ;
1259+ expect ( Object . hasOwn ( provider , "apiKey" ) ) . toBe ( true ) ;
1260+ expect ( Object . hasOwn ( provider , "authHeader" ) ) . toBe ( true ) ;
1261+ expect ( Object . hasOwn ( provider , "headers" ) ) . toBe ( true ) ;
12591262 } ) ;
12601263
12611264 it ( "uses the minimum supported response token count for GPT-5 connection tests" , ( ) => {
@@ -1386,7 +1389,7 @@ describe("microsoft-foundry plugin", () => {
13861389 expect ( provider ?. models [ 0 ] ?. compat ) . toBeUndefined ( ) ;
13871390 } ) ;
13881391
1389- it ( "keeps Entra credentials scoped to auth profiles" , ( ) => {
1392+ it ( "deletes legacy provider-level credentials for Entra profiles" , ( ) => {
13901393 const result = buildFoundryAuthResult ( {
13911394 profileId : "microsoft-foundry:entra" ,
13921395 apiKey : "__entra_id_dynamic__" ,
@@ -1401,8 +1404,9 @@ describe("microsoft-foundry plugin", () => {
14011404 | Record < string , unknown >
14021405 | undefined ;
14031406 expect ( provider ?. authHeader ) . toBeUndefined ( ) ;
1404- expect ( Object . hasOwn ( provider ?? { } , "apiKey" ) ) . toBe ( false ) ;
1405- expect ( Object . hasOwn ( provider ?? { } , "headers" ) ) . toBe ( false ) ;
1407+ expect ( Object . hasOwn ( provider ?? { } , "apiKey" ) ) . toBe ( true ) ;
1408+ expect ( Object . hasOwn ( provider ?? { } , "authHeader" ) ) . toBe ( true ) ;
1409+ expect ( Object . hasOwn ( provider ?? { } , "headers" ) ) . toBe ( true ) ;
14061410 expect ( provider ?. apiKey ) . toBeUndefined ( ) ;
14071411 expect ( provider ?. headers ) . toBeUndefined ( ) ;
14081412 } ) ;
@@ -1826,7 +1830,7 @@ describe("microsoft-foundry plugin", () => {
18261830 await expect ( getAccessTokenResultAsync ( ) ) . rejects . toThrow ( "Azure CLI is not logged in" ) ;
18271831 } ) ;
18281832
1829- it ( "keeps API-key secret refs scoped to auth profiles " , ( ) => {
1833+ it ( "deletes legacy provider-level secret refs" , ( ) => {
18301834 const secretRef = {
18311835 source : "env" as const ,
18321836 provider : "default" ,
@@ -1845,6 +1849,9 @@ describe("microsoft-foundry plugin", () => {
18451849 expect ( provider . apiKey ) . toBeUndefined ( ) ;
18461850 expect ( provider . authHeader ) . toBeUndefined ( ) ;
18471851 expect ( provider . headers ) . toBeUndefined ( ) ;
1852+ expect ( Object . hasOwn ( provider , "apiKey" ) ) . toBe ( true ) ;
1853+ expect ( Object . hasOwn ( provider , "authHeader" ) ) . toBe ( true ) ;
1854+ expect ( Object . hasOwn ( provider , "headers" ) ) . toBe ( true ) ;
18481855 } ) ;
18491856
18501857 it ( "moves the selected Foundry auth profile to the front of auth.order" , ( ) => {
0 commit comments