@@ -224,6 +224,8 @@ describe('resolveCredentialAccessToken', () => {
224224 authenticate . mockResolvedValue ( INTERNAL_AUTH )
225225 resolveManagedPrincipal . mockResolvedValue ( EXECUTOR_PRINCIPAL )
226226 mockGetToolMetadata . mockReturnValue ( {
227+ id : 'gmail_send' ,
228+ params : { } ,
227229 oauth : { required : true , provider : 'google' , requiredScopes : [ 'scope-a' ] } ,
228230 } )
229231 } )
@@ -288,7 +290,7 @@ describe('resolveCredentialAccessToken', () => {
288290
289291 it ( 'rejects tools without managed OAuth support' , async ( ) => {
290292 mockResolveOAuthAccountId . mockResolvedValue ( MANAGED_RESOLVED )
291- mockGetToolMetadata . mockReturnValue ( { oauth : undefined } )
293+ mockGetToolMetadata . mockReturnValue ( { id : 'http_request' , params : { } , oauth : undefined } )
292294
293295 const result = await resolveCredentialAccessToken ( {
294296 requestId : 'req-1' ,
@@ -309,7 +311,11 @@ describe('resolveCredentialAccessToken', () => {
309311
310312 it ( 'rejects tools whose scope policy is empty' , async ( ) => {
311313 mockResolveOAuthAccountId . mockResolvedValue ( MANAGED_RESOLVED )
312- mockGetToolMetadata . mockReturnValue ( { oauth : { required : true , provider : 'unknown-provider' } } )
314+ mockGetToolMetadata . mockReturnValue ( {
315+ id : 'fixture-tool' ,
316+ params : { } ,
317+ oauth : { required : true , provider : 'oracle-fusion' } ,
318+ } )
313319
314320 const result = await resolveCredentialAccessToken ( {
315321 requestId : 'req-1' ,
@@ -464,31 +470,34 @@ describe('ordinary tool credential binding', () => {
464470 [ 'gmail' , 'google-service-account' ] ,
465471 [ 'jira' , 'atlassian-service-account' ] ,
466472 [ 'confluence' , 'atlassian-service-account' ] ,
467- ] ) ( 'accepts the canonical %s service-account provider %s' , async ( provider , providerId ) => {
468- mockGetToolMetadata . mockReturnValue ( {
469- id : 'fixture-tool' ,
470- params : { } ,
471- oauth : { required : true , provider } ,
472- } )
473- mockResolveOAuthAccountId . mockResolvedValue ( { ...serviceAccount , providerId } )
474- expect (
475- await resolveCredentialAccessToken ( {
476- requestId : 'binding-test' ,
477- credentialId : 'credential-1' ,
478- toolId : 'fixture-tool' ,
479- authenticate,
473+ ] as const ) (
474+ 'accepts the canonical %s service-account provider %s' ,
475+ async ( provider , providerId ) => {
476+ mockGetToolMetadata . mockReturnValue ( {
477+ id : 'fixture-tool' ,
478+ params : { } ,
479+ oauth : { required : true , provider } ,
480480 } )
481- ) . toMatchObject ( {
482- ok : true ,
483- token : { accessToken : 'service-token' , credentialType : 'service_account' } ,
484- } )
485- } )
481+ mockResolveOAuthAccountId . mockResolvedValue ( { ...serviceAccount , providerId } )
482+ expect (
483+ await resolveCredentialAccessToken ( {
484+ requestId : 'binding-test' ,
485+ credentialId : 'credential-1' ,
486+ toolId : 'fixture-tool' ,
487+ authenticate,
488+ } )
489+ ) . toMatchObject ( {
490+ ok : true ,
491+ token : { accessToken : 'service-token' , credentialType : 'service_account' } ,
492+ } )
493+ }
494+ )
486495
487496 it . each ( [
488497 [ 'gmail' , 'google-email' , true ] ,
489498 [ 'salesforce' , 'salesforce-sandbox' , true ] ,
490499 [ 'salesforce' , 'google' , false ] ,
491- ] ) (
500+ ] as const ) (
492501 'binds ordinary OAuth %s tokens to the provider (%s)' ,
493502 async ( provider , providerId , allowed ) => {
494503 mockGetToolMetadata . mockReturnValue ( {
0 commit comments