(ctx context.Context)
| 612 | } |
| 613 | |
| 614 | func BaggageFromContext(ctx context.Context) WorkspaceBuildBaggage { |
| 615 | d := WorkspaceBuildBaggage{} |
| 616 | b := baggage.FromContext(ctx) |
| 617 | props := b.Member("audit").Properties() |
| 618 | for _, prop := range props { |
| 619 | switch prop.Key() { |
| 620 | case "ip": |
| 621 | d.IP, _ = prop.Value() |
| 622 | default: |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | return d |
| 627 | } |
| 628 | |
| 629 | func either[T Auditable, R any](old, newVal T, fn func(T) R, auditAction database.AuditAction) R { |
| 630 | switch { |