(ctx context.Context, relID, path string)
| 507 | } |
| 508 | |
| 509 | func (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 | |
| 520 | func (s *PostgresStore) persistAuth(ctx context.Context, relID string, data []byte) error { |
| 521 | jsonPayload := json.RawMessage(data) |
no test coverage detected