Skip to content

Ppaul/acl secondary failover ledger #51820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release History

## 1.5.3-preview.1 (Unreleased)

### Features Added
- Added secondaryLedgerUri parameter for failover support in ConfidentialLedgerClientOptions.

## 1.4.1-beta.3 (Unreleased)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Client SDK for the Azure Confidential Ledger service</Description>
<AssemblyTitle>Azure Confidential Ledger</AssemblyTitle>
<Version>1.4.1-beta.3</Version>
<Version>1.5.3-preview.1</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.3.0</ApiCompatVersion>
<PackageTags>Azure ConfidentialLedger</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,29 @@ internal ConfidentialLedgerClient(Uri ledgerEndpoint, TokenCredential credential
new ConfidentialLedgerResponseClassifier());
_ledgerEndpoint = ledgerEndpoint;
_apiVersion = actualOptions.Version;

// Set up secondary endpoint if configured
_secondaryLedgerEndpoint = actualOptions.SecondaryLedgerEndpoint;
if (_secondaryLedgerEndpoint != null)
{
// Get certificate for secondary endpoint if needed
X509Certificate2 secondaryServiceCert = identityServiceCert ?? GetIdentityServerTlsCert(_secondaryLedgerEndpoint, certificateClientOptions ?? new ConfidentialLedgerCertificateClientOptions(), ledgerOptions: ledgerOptions).Cert;

var secondaryTransportOptions = GetIdentityServerTlsCertAndTrust(secondaryServiceCert, ledgerOptions?.VerifyConnection ?? true);
if (clientCertificate != null)
{
secondaryTransportOptions.ClientCertificates.Add(clientCertificate);
}

_secondaryPipeline = HttpPipelineBuilder.Build(
actualOptions,
Array.Empty<HttpPipelinePolicy>(),
_tokenCredential == null ?
Array.Empty<HttpPipelinePolicy>() :
new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) },
secondaryTransportOptions,
new ConfidentialLedgerResponseClassifier());
}
}

internal class ConfidentialLedgerResponseClassifier : ResponseClassifier
Expand Down Expand Up @@ -154,7 +177,7 @@ public virtual Operation PostLedgerEntry(
/// }
/// </code>
/// </remarks>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>.</param>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation hascompleted on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>.</param>
/// <param name="content"> The content to send as the body of the request. </param>
/// <param name="collectionId"> The collection id. </param>
/// <param name="tags"> The tags. </param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public partial class ConfidentialLedgerClientOptions : ClientOptions
/// <value></value>
public bool VerifyConnection { get; set; }

/// <summary>
/// The secondary ledger endpoint URL for failover scenarios.
/// </summary>
/// <value></value>
public Uri SecondaryLedgerEndpoint { get; set; }

/// <summary> The version of the service to use. </summary>
public enum ServiceVersion
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading