code: func CheckConfig(ctx *context.Context, put *config.Put, kind string) error {
  
  	if put.Target == "" {
  		return misconfigured(kind, put, "missing target")
  	}
  
  	if put.Name == "" {
  		return misconfigured(kind, put, "missing name")
  	}
  
  	if put.Mode != ModeArchive && put.Mode != ModeBinary {
  		return misconfigured(kind, put, "mode must be 'binary' or 'archive'")
  	}
  
  	envName := fmt.Sprintf("%s_%s_SECRET", strings.ToUpper(kind), strings.ToUpper(put.Name))
  	if _, ok := ctx.Env[envName]; !ok {
  		return misconfigured(kind, put, fmt.Sprintf("missing %s environment variable", envName))
  	}
  
  	if put.TrustedCerts != "" && !x509.NewCertPool().AppendCertsFromPEM([]byte(put.TrustedCerts)) {
  		return misconfigured(kind, put, "no certificate could be added from the specified trusted_certificates configuration")
  	}
  
  	return nil
  
  }
docs: // CheckConfig validates a Put configuration returning a descriptive error when appropriate