@@ -92,7 +92,7 @@ func (c *CLI) runAPIAuthList(cmd *cobra.Command, args []string) error {
9292 if err != nil {
9393 return err
9494 }
95- set , hasOps := c .cachedOperationSetForAPI (apiName , apiCfg , profileName )
95+ set , hasOps := c .cachedOperationSetForAPI (requestContext ( cmd ), apiName , apiCfg , profileName )
9696 _ , profileReady , profileErr := c .profileAuthReadiness (apiName , profileName , prof )
9797 coverage := operationAuthCoverage {}
9898 if hasOps {
@@ -204,7 +204,7 @@ func (c *CLI) runAPIAuthAdd(cmd *cobra.Command, args []string) error {
204204 if prof .Credentials [credentialID ] == nil {
205205 prof .Credentials [credentialID ] = & config.CredentialConfig {}
206206 }
207- defaultNeeds := c .cachedCredentialDefaultNeeds (apiName , apiCfg , profileName , credentialID )
207+ defaultNeeds := c .cachedCredentialDefaultNeeds (requestContext ( cmd ), apiName , apiCfg , profileName , credentialID )
208208 if prof .Credentials [credentialID ].Auth == nil {
209209 if authCfg , ok , err := c .cachedAuthConfigForCredential (apiName , apiCfg , credentialID ); err != nil {
210210 return err
@@ -298,7 +298,7 @@ func (c *CLI) runAPIAuthInspect(cmd *cobra.Command, args []string) error {
298298}
299299
300300func (c * CLI ) runAPIAuthInspectOperation (cmd * cobra.Command , apiName , profileName string , apiCfg * config.APIConfig , prof * config.ProfileConfig , operationName , rawHeader string , redact bool ) error {
301- op , ok , err := c .cachedOperationForAPI (apiName , apiCfg , profileName , operationName )
301+ op , ok , err := c .cachedOperationForAPI (requestContext ( cmd ), apiName , apiCfg , profileName , operationName )
302302 if err != nil {
303303 return err
304304 }
@@ -471,7 +471,7 @@ func (c *CLI) operationAuthInspectionRequest(cmd *cobra.Command, apiName, profil
471471 if err != nil {
472472 return nil , err
473473 }
474- req , _ := http .NewRequest ( "GET" , "http://example.com" , nil )
474+ req , _ := http .NewRequestWithContext ( requestContext ( cmd ), "GET" , "http://example.com" , nil )
475475 for _ , item := range selected {
476476 step , err := c .operationAuthStep (apiName , profileName , item , authOpts )
477477 if err != nil {
@@ -510,7 +510,7 @@ func (c *CLI) authInspectionRequest(cmd *cobra.Command, apiName, profileName str
510510 if err != nil {
511511 return nil , err
512512 }
513- req , _ := http .NewRequest ( "GET" , "http://example.com" , nil )
513+ req , _ := http .NewRequestWithContext ( requestContext ( cmd ), "GET" , "http://example.com" , nil )
514514 if err := handler .Authenticate (requestContext (cmd ), req , c .authContext (requestContext (cmd ), apiName , profileName , params , resolved .CacheKey , false )); err != nil {
515515 return nil , fmt .Errorf ("building auth inspection: %w" , err )
516516 }
@@ -636,11 +636,11 @@ func (c *CLI) apiProfileForAuth(apiName, profileName string, create bool) (*conf
636636 return apiCfg , apiCfg .Profiles [profileName ], nil
637637}
638638
639- func (c * CLI ) cachedOperationSetForAPI (apiName string , apiCfg * config.APIConfig , profileName string ) (spec.OperationSet , bool ) {
639+ func (c * CLI ) cachedOperationSetForAPI (ctx context. Context , apiName string , apiCfg * config.APIConfig , profileName string ) (spec.OperationSet , bool ) {
640640 if set , _ , ok := c .cachedOperationSetStatusForAPI (apiName , apiCfg , profileName ); ok {
641641 return set , true
642642 }
643- set , ok , _ := c .operationSetForAPI (context . Background () , apiName , apiCfg , profileName , false )
643+ set , ok , _ := c .operationSetForAPI (ctx , apiName , apiCfg , profileName , false )
644644 return set , ok
645645}
646646
@@ -708,8 +708,8 @@ func (c *CLI) operationSetForAPI(ctx context.Context, apiName string, apiCfg *co
708708 return set , true , nil
709709}
710710
711- func (c * CLI ) cachedOperationForAPI (apiName string , apiCfg * config.APIConfig , profileName , value string ) (spec.Operation , bool , error ) {
712- set , ok := c .cachedOperationSetForAPI (apiName , apiCfg , profileName )
711+ func (c * CLI ) cachedOperationForAPI (ctx context. Context , apiName string , apiCfg * config.APIConfig , profileName , value string ) (spec.Operation , bool , error ) {
712+ set , ok := c .cachedOperationSetForAPI (ctx , apiName , apiCfg , profileName )
713713 if ! ok {
714714 return spec.Operation {}, false , nil
715715 }
@@ -858,8 +858,8 @@ func authRequirementKindSupported(kind string) bool {
858858 }
859859}
860860
861- func (c * CLI ) cachedCredentialDefaultNeeds (apiName string , apiCfg * config.APIConfig , profileName , credentialID string ) []string {
862- set , ok := c .cachedOperationSetForAPI (apiName , apiCfg , profileName )
861+ func (c * CLI ) cachedCredentialDefaultNeeds (ctx context. Context , apiName string , apiCfg * config.APIConfig , profileName , credentialID string ) []string {
862+ set , ok := c .cachedOperationSetForAPI (ctx , apiName , apiCfg , profileName )
863863 if ! ok {
864864 return nil
865865 }
0 commit comments