@@ -252,41 +252,6 @@ describe("OAuthManagerRefreshError", () => {
252252} ) ;
253253
254254describe ( "createOAuthManager" , ( ) => {
255- it ( "accepts an unchanged expired credential as provider-owned refresh policy" , async ( ) => {
256- await withOAuthTempRoot ( "oauth-manager-unchanged-refresh-" , async ( tempRoot ) => {
257- const agentDir = path . join ( tempRoot , "agents" , "main" , "agent" ) ;
258- await fs . mkdir ( agentDir , { recursive : true } ) ;
259- const profileId = "github-copilot:default" ;
260- const credential = createCredential ( {
261- provider : "github-copilot" ,
262- access : "expired-copilot-access" ,
263- refresh : "durable-github-token" ,
264- expires : 1 ,
265- } ) ;
266- const refreshCredential = vi . fn ( async ( ) => credential ) ;
267- const manager = createOAuthManager ( {
268- buildApiKey : async ( _provider , value ) => value . refresh ,
269- refreshCredential,
270- readBootstrapCredential : ( ) => null ,
271- isRefreshTokenReusedError : ( ) => false ,
272- } ) ;
273- const persistedStore : AuthProfileStore = {
274- version : 1 ,
275- profiles : { [ profileId ] : credential } ,
276- } ;
277- saveAuthProfileStore ( persistedStore , agentDir , { filterExternalAuthProfiles : false } ) ;
278- const store = ensureAuthProfileStoreWithoutExternalProfiles ( agentDir , {
279- allowKeychainPrompt : false ,
280- } ) ;
281-
282- await expect (
283- manager . resolveOAuthAccess ( { store, profileId, credential, agentDir } ) ,
284- ) . resolves . toEqual ( { apiKey : "durable-github-token" , credential } ) ;
285- expect ( refreshCredential ) . toHaveBeenCalledOnce ( ) ;
286- expect ( store . profiles [ profileId ] ) . toEqual ( credential ) ;
287- } ) ;
288- } ) ;
289-
290255 it ( "passes active config to OAuth API-key formatting" , async ( ) => {
291256 const profileId = "openai:oauth" ;
292257 const credential = createCredential ( { expires : Date . now ( ) + 10 * 60_000 } ) ;
0 commit comments