(path string)
| 499 | } |
| 500 | |
| 501 | func (h *Host) authIDForPath(path string) string { |
| 502 | path = strings.TrimSpace(path) |
| 503 | if path == "" { |
| 504 | return "" |
| 505 | } |
| 506 | path = filepath.Clean(path) |
| 507 | if !filepath.IsAbs(path) { |
| 508 | if abs, errAbs := filepath.Abs(path); errAbs == nil { |
| 509 | path = abs |
| 510 | } |
| 511 | } |
| 512 | id := path |
| 513 | if authDir := h.resolvedAuthDir(); authDir != "" { |
| 514 | if rel, errRel := filepath.Rel(authDir, path); errRel == nil && rel != "" { |
| 515 | id = rel |
| 516 | } |
| 517 | } |
| 518 | if runtime.GOOS == "windows" { |
| 519 | id = strings.ToLower(id) |
| 520 | } |
| 521 | return id |
| 522 | } |
| 523 | |
| 524 | func authEmail(auth *coreauth.Auth) string { |
| 525 | if auth == nil { |
no test coverage detected