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

Method absoluteAuthPath

internal/store/postgresstore.go:613–630  ·  view source on GitHub ↗
(id string)

Source from the content-addressed store, hash-verified

611}
612
613func (s *PostgresStore) absoluteAuthPath(id string) (string, error) {
614 if s == nil {
615 return "", fmt.Errorf("postgres store: store not initialized")
616 }
617 clean := filepath.Clean(filepath.FromSlash(id))
618 if strings.HasPrefix(clean, "..") {
619 return "", fmt.Errorf("postgres store: invalid auth identifier %s", id)
620 }
621 path := filepath.Join(s.authDir, clean)
622 rel, err := filepath.Rel(s.authDir, path)
623 if err != nil {
624 return "", err
625 }
626 if strings.HasPrefix(rel, "..") {
627 return "", fmt.Errorf("postgres store: resolved auth path escapes auth directory")
628 }
629 return path, nil
630}
631
632func (s *PostgresStore) fullTableName(name string) string {
633 if strings.TrimSpace(s.cfg.Schema) == "" {

Callers 2

ListMethod · 0.95
syncAuthFromDatabaseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected