(id string)
| 611 | } |
| 612 | |
| 613 | func (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 | |
| 632 | func (s *PostgresStore) fullTableName(name string) string { |
| 633 | if strings.TrimSpace(s.cfg.Schema) == "" { |
no outgoing calls
no test coverage detected