diff --git a/Utilities/GenerateSecurityGraphs/GenerateSecurityGraphs/Program.cs b/Utilities/GenerateSecurityGraphs/GenerateSecurityGraphs/Program.cs index f3bede979..69a5766b2 100644 --- a/Utilities/GenerateSecurityGraphs/GenerateSecurityGraphs/Program.cs +++ b/Utilities/GenerateSecurityGraphs/GenerateSecurityGraphs/Program.cs @@ -45,28 +45,16 @@ internal class Options [Option('f', "force", Default = false, HelpText = "Create a folder at that path if one doesn't already exist.")] public bool Force { get; set; } - [Option('d', "database", Default = "EdFi_Security", HelpText = "The name of the database containing the authorization metadata.")] - public string Database { get; set; } - - [Option( - 's', "server", Default = "(local)", HelpText = "The name of the SQL Server where the authorization metadata database is located.")] - public string Server { get; set; } - - [Option( - 'u', "user", HelpText = - "The SQL Server username to use for connecting to the authorization metadata database. Leave username and password blank to use integrated security.")] - public string User { get; set; } - - [Option( - 'p', "password", HelpText = - "The password to use for connecting to the authorization metadata database. Leave username and password blank to use integrated security.")] - public string Password { get; set; } - [Option( 'g', "graphviz", Default = @"C:\Program Files\Graphviz\", HelpText = "Graphviz installation path.")] public string GraphvizPath { get; set; } + [Option( + 'c', "connectionString", Required = true, + HelpText = "Provide the connection string for the database, including database name, server name, user and password (if necessary)")] + public string ConnectionString { get; set; } + //[HelpOption] public string GetUsage(string[] args) { @@ -119,25 +107,6 @@ private static async Task Main(string[] args) if (failedToParse) return; - string connectionString; - - if (options.User == null || options.Password == null) - { - connectionString = string.Format( - "Server={0};Database={1};Trusted_Connection=True", - options.Server, - options.Database); - } - else - { - connectionString = string.Format( - "Server={0};Database={1};User ID={2};Password={3}", - options.Server, - options.Database, - options.User, - options.Password); - } - string baseFolderPath; if (Path.IsPathRooted(options.OutputFolder)) @@ -204,7 +173,7 @@ private static async Task Main(string[] args) var authorizationMetadata = new Dictionary(); List claimSetNames; - var resourceGraph = LoadAuthorizationMetadataGraph(connectionString, out claimSetNames); + var resourceGraph = LoadAuthorizationMetadataGraph(options.ConnectionString, out claimSetNames); foreach (string claimSetName in claimSetNames) {