Skip to content
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

Add Susi Policy Id parameter for Code Update #2035

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public ProjectDescriptionReader(IEnumerable<string> files)
}
}

return null;
// If projectDescription cannot be inferred, default to Web App
return ProjectDescriptions.FirstOrDefault(p => string.Equals(ProjectTypes.WebApp, p.Identifier));
}

static readonly JsonSerializerOptions serializerOptionsWithComments = new JsonSerializerOptions
Expand All @@ -52,17 +53,11 @@ public List<ProjectDescription> ProjectDescriptions
{
get
{
if (_projectDescriptions == null)
{
_projectDescriptions = AppProvisioningTool.Properties
_projectDescriptions ??= AppProvisioningTool.Properties
.Where(p => p.Name.StartsWith("dotnet") && p.PropertyType == typeof(byte[]))
.Select(p => GetProjectDescription(p))
.ToList();

// TODO: provide an extension mechanism to add such files outside the tool.
// In that case the validation would not be an exception? but would need to provide error messages
}

return _projectDescriptions;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ private bool ValidateProjectPath()
{
projectSettings.ApplicationParameters.AppIdUri = provisioningToolOptions.HostedAppIdUri;
}
if (!string.IsNullOrEmpty(provisioningToolOptions.SusiPolicyId))
{
projectSettings.ApplicationParameters.SusiPolicy = provisioningToolOptions.SusiPolicyId;
}

return projectSettings;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/dotnet-msidentity/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ internal static async Task<int> HandleClientSecrets(ProvisioningToolOptions prov
"\n\t- Updates the Startup.cs file." +
"\n\t- Updates the user secrets.\n")
{
TenantOption(), UsernameOption(), ClientIdOption(), JsonOption(), ProjectFilePathOption(), ConfigUpdateOption(), CodeUpdateOption(), PackagesUpdateOption(), CallsGraphOption(), CallsDownstreamApiOption(), UpdateUserSecretsOption(), RedirectUriOption()
TenantOption(), UsernameOption(), ClientIdOption(), JsonOption(), ProjectFilePathOption(), ConfigUpdateOption(), CodeUpdateOption(), PackagesUpdateOption(), CallsGraphOption(), CallsDownstreamApiOption(), UpdateUserSecretsOption(), RedirectUriOption(), SusiPolicyIdOption()
};

internal static Command UpdateAppRegistrationCommand() =>
Expand Down