mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-14 12:58:53 +00:00
fix(quality): TICKET-012 propagate request context instead of context.Background()
- Updated AgentService interface to accept context.Context parameter in all methods - Replaced context.Background() calls with proper ctx parameter in agent.go - Updated AgentGroupService interface to accept context.Context parameter - Replaced context.Background() calls with proper ctx parameter in agent_group.go - Updated handler methods to pass r.Context() to service methods - Context now properly propagates through request lifecycle for timeout/cancellation - Improved request tracing and cancellation behavior
This commit is contained in:
@@ -97,22 +97,28 @@ func (c *Connector) ValidateConfig(ctx context.Context, rawConfig json.RawMessag
|
||||
return fmt.Errorf("sign_script is required")
|
||||
}
|
||||
|
||||
// Verify sign_script exists and is executable
|
||||
if _, err := os.Stat(cfg.SignScript); err != nil {
|
||||
// Verify sign_script exists and is a regular file
|
||||
if info, err := os.Stat(cfg.SignScript); err != nil {
|
||||
return fmt.Errorf("sign_script not accessible: %w", err)
|
||||
} else if !info.Mode().IsRegular() {
|
||||
return fmt.Errorf("sign_script must be a regular file, got %s", info.Mode())
|
||||
}
|
||||
|
||||
// Verify revoke_script exists if specified
|
||||
// Verify revoke_script exists and is a regular file if specified
|
||||
if cfg.RevokeScript != "" {
|
||||
if _, err := os.Stat(cfg.RevokeScript); err != nil {
|
||||
if info, err := os.Stat(cfg.RevokeScript); err != nil {
|
||||
return fmt.Errorf("revoke_script not accessible: %w", err)
|
||||
} else if !info.Mode().IsRegular() {
|
||||
return fmt.Errorf("revoke_script must be a regular file, got %s", info.Mode())
|
||||
}
|
||||
}
|
||||
|
||||
// Verify crl_script exists if specified
|
||||
// Verify crl_script exists and is a regular file if specified
|
||||
if cfg.CRLScript != "" {
|
||||
if _, err := os.Stat(cfg.CRLScript); err != nil {
|
||||
if info, err := os.Stat(cfg.CRLScript); err != nil {
|
||||
return fmt.Errorf("crl_script not accessible: %w", err)
|
||||
} else if !info.Mode().IsRegular() {
|
||||
return fmt.Errorf("crl_script must be a regular file, got %s", info.Mode())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user