Skip to content

Commit

Permalink
Merge pull request #643 from ShawnAbshire/sabshire-636-expose-usepath…
Browse files Browse the repository at this point in the history
…-cloud

feature(cloudbuilder): Add UsePersistedStoragePath configuration to c…
  • Loading branch information
ChrisKujawa authored Feb 1, 2024
2 parents c315aff + fbcce47 commit 0eeeb45
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Client/Api/Builder/ICamundaCloudClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ public interface ICamundaCloudClientBuilderFinalStep
/// <returns>the next step in building a ICamundaCloudClient</returns>
ICamundaCloudClientBuilderFinalStep UseAuthServer(string url);

/// <summary>
/// Sets the given path to store credentials on disk.
/// </summary>
/// <param name="path">the path where to store the credentials.</param>
/// <returns>the fluent ICamundaCloudClientBuilderFinalStep.</returns>
ICamundaCloudClientBuilderFinalStep UsePersistedStoragePath(string path);

/// <summary>
/// The IZeebeClient, which is setup entirely to talk with the defined Camunda Cloud cluster.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Client/Api/Builder/ICamundaCloudTokenProviderBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public interface ICamundaCloudTokenProviderBuilderFinalStep
/// Use given path to store credentials on disk.
/// </summary>
/// Per default credentials are stored in the home directory.
/// <param name="path">The path were to store the credentials.</param>
/// <param name="path">The path where to store the credentials.</param>
/// <returns>The final step in building a CamundaCloudTokenProvider.</returns>
ICamundaCloudTokenProviderBuilderFinalStep UsePath(string path);

Expand Down
12 changes: 12 additions & 0 deletions Client/Impl/Builder/CamundaCloudClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ public ICamundaCloudClientBuilderFinalStep UseAuthServer(string url)
return this;
}

public ICamundaCloudClientBuilderFinalStep UsePersistedStoragePath(string path)
{
if (path is null)
{
// use default
return this;
}

camundaCloudTokenProviderBuilder.UsePath(path);
return this;
}

private string GetFromEnv(string key)
{
char[] charsToTrim = { ' ', '\'' };
Expand Down

0 comments on commit 0eeeb45

Please sign in to comment.