| 82 | } |
| 83 | |
| 84 | func (c *Client) buildProbeConfig(ctx context.Context, req ProbeRequest) (internalbridge.Config, error) { |
| 85 | sourceAuth, err := c.authFor(ctx, req.Source, SourceRole) |
| 86 | if err != nil { |
| 87 | return internalbridge.Config{}, err |
| 88 | } |
| 89 | var target *internalbridge.Endpoint |
| 90 | targetAuth := internalbridge.EndpointAuth{} |
| 91 | if req.Target != nil { |
| 92 | resolvedTargetAuth, err := c.authFor(ctx, *req.Target, TargetRole) |
| 93 | if err != nil { |
| 94 | return internalbridge.Config{}, err |
| 95 | } |
| 96 | target = ptr(bridgeEndpoint(*req.Target)) |
| 97 | targetAuth = bridgeEndpointAuth(resolvedTargetAuth) |
| 98 | } |
| 99 | return internalbridge.ProbeConfig( |
| 100 | bridgeEndpoint(req.Source), |
| 101 | bridgeEndpointAuth(sourceAuth), |
| 102 | target, |
| 103 | targetAuth, |
| 104 | internalbridge.ProtocolMode(req.Protocol), |
| 105 | req.IncludeTags, |
| 106 | req.AllRefs, |
| 107 | req.CollectStats, |
| 108 | req.ExcludeRefPrefixes, |
| 109 | c.httpClient, |
| 110 | ), nil |
| 111 | } |
| 112 | |
| 113 | func (c *Client) buildSyncConfig(ctx context.Context, source Endpoint, target Endpoint, scope RefScope, policy SyncPolicy, collectStats, dryRun bool) (internalbridge.Config, error) { |
| 114 | sourceAuth, err := c.authFor(ctx, source, SourceRole) |