MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / authIDForPath

Method authIDForPath

internal/pluginhost/auth_callbacks.go:501–522  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

499}
500
501func (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
524func authEmail(auth *coreauth.Auth) string {
525 if auth == nil {

Callers 1

buildAuthFromFileDataMethod · 0.95

Calls 1

resolvedAuthDirMethod · 0.95

Tested by

no test coverage detected