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

Method upsertAuthRecord

internal/store/postgresstore.go:509–518  ·  view source on GitHub ↗
(ctx context.Context, relID, path string)

Source from the content-addressed store, hash-verified

507}
508
509func (s *PostgresStore) upsertAuthRecord(ctx context.Context, relID, path string) error {
510 data, err := os.ReadFile(path)
511 if err != nil {
512 return fmt.Errorf("postgres store: read auth file: %w", err)
513 }
514 if len(data) == 0 {
515 return s.deleteAuthRecord(ctx, relID)
516 }
517 return s.persistAuth(ctx, relID, data)
518}
519
520func (s *PostgresStore) persistAuth(ctx context.Context, relID string, data []byte) error {
521 jsonPayload := json.RawMessage(data)

Callers 1

SaveMethod · 0.95

Calls 2

deleteAuthRecordMethod · 0.95
persistAuthMethod · 0.95

Tested by

no test coverage detected