(ctx context.Context, source Endpoint, target Endpoint, scope RefScope, policy SyncPolicy, collectStats, dryRun bool)
| 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) |
| 115 | if err != nil { |
| 116 | return internalbridge.Config{}, err |
| 117 | } |
| 118 | targetAuth, err := c.authFor(ctx, target, TargetRole) |
| 119 | if err != nil { |
| 120 | return internalbridge.Config{}, err |
| 121 | } |
| 122 | return internalbridge.SyncConfig( |
| 123 | bridgeEndpoint(source), |
| 124 | bridgeEndpointAuth(sourceAuth), |
| 125 | bridgeEndpoint(target), |
| 126 | bridgeEndpointAuth(targetAuth), |
| 127 | bridgeScope(scope), |
| 128 | bridgePolicy(policy), |
| 129 | collectStats, |
| 130 | dryRun, |
| 131 | c.httpClient, |
| 132 | ), nil |
| 133 | } |
| 134 | |
| 135 | func (c *Client) authFor(ctx context.Context, endpoint Endpoint, role EndpointRole) (EndpointAuth, error) { |
| 136 | if c.auth == nil { |
no test coverage detected