Skip to content

Commit

Permalink
Fixed Settings error checking, the changed proposed would requiere a …
Browse files Browse the repository at this point in the history
…more significant refactor (#179)
  • Loading branch information
Annonator authored Dec 29, 2023
1 parent f3210c3 commit dd7b359
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/PlayFabBuddy.Infrastructure/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Kusto.Data;
using Kusto.Cloud.Platform.Utils;
using Kusto.Data;
using Kusto.Data.Common;
using Kusto.Data.Net.Client;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -39,7 +40,8 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
string adminEntityToken;
PlayFabConfig pfConfig;

if (config["titleId"] is not null && config["devSecret"] is not null)
if (config["titleId"] != null && config["devSecret"] != null && config["titleId"] != "<YourTitleId>" &&
config["devSecret"] != "<YourDevSecret>")
{
pfConfig = new PlayFabConfig(config["titleId"]!, config["devSecret"]!);
adminEntityToken = pfConfig.InitAsync().Result;
Expand Down Expand Up @@ -67,8 +69,8 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
services.AddTransient<IPolicyAdapter, PolicyAdapter>();

// Register KUSTO
if (config["PFDataCluster"] is not null || config["PFDataClientId"] is not null ||
config["PFDataClientSecret"] is not null)
if (config["PFDataCluster"].IsNotNullOrEmpty() && config["PFDataClientId"].IsNotNullOrEmpty() &&
config["PFDataClientSecret"].IsNotNullOrEmpty())
{
var kustoConnectionString = new KustoConnectionStringBuilder(config["PFDataCluster"], config["titleId"])
.WithAadApplicationKeyAuthentication(config["PFDataClientId"], config["PFDataClientSecret"],
Expand All @@ -79,7 +81,6 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
services.AddTransient<IDataExplorerAdapter, DataExplorerAdapter>();
}


return services;
}
}

0 comments on commit dd7b359

Please sign in to comment.