File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 66__author__  =  'Simon Robinson' 
77__copyright__  =  'Copyright (c) 2023 Simon Robinson' 
88__license__  =  'Apache 2.0' 
9- __version__  =  '2023-11-18 '   # ISO 8601 (YYYY-MM-DD) 
9+ __version__  =  '2023-11-19 '   # ISO 8601 (YYYY-MM-DD) 
1010__package_version__  =  '.' .join ([str (int (i )) for  i  in  __version__ .split ('-' )])  # for pyproject.toml usage only 
1111
1212import  abc 
@@ -768,12 +768,14 @@ def get_account_with_catch_all_fallback(option):
768768                        AppConfig .save ()
769769
770770                    else :
771-                         # we used to keep tokens until the last possible moment here, but it is simpler to just obtain a 
772-                         # new one within TOKEN_EXPIRY_MARGIN, particularly when in CCG or ROPCG flow modes where getting 
773-                         # a new token involves no user interaction (note that in interactive mode it would be better to 
771+                         # avoid trying invalid (or soon to be) tokens - we used to keep tokens until the last possible 
772+                         # moment here, but it is simpler to just obtain a new one within TOKEN_EXPIRY_MARGIN, especially 
773+                         # when in CCG/ROPCG/Google Cloud service account modes, for all of which getting a new token 
774+                         # involves no interaction from the user (note that in interactive mode it would be better to 
774775                        # request a new token via the user before discarding the existing one, but since this happens 
775776                        # very infrequently, we don't add the extra complexity for just 10 extra minutes of token life) 
776-                         access_token  =  None   # avoid trying invalid (or soon to be) tokens 
777+                         cryptographer .decrypt (access_token )  # check request is valid (raises InvalidToken on failure) 
778+                         access_token  =  None 
777779                else :
778780                    access_token  =  cryptographer .decrypt (access_token )
779781
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments