Skip to content

Commit cb5b07f

Browse files
committed
Correcting resource strings for commands as well as delete unused commented code in authentication service
#98
1 parent 52d8712 commit cb5b07f

23 files changed

Lines changed: 275 additions & 113 deletions

src/FlowCtl.Infrastructure/Services/Authentication/AuthenticationManager.cs

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -86,70 +86,4 @@ private void Save(AuthenticationData data)
8686
{
8787
File.WriteAllText(ConfigPath, _jsonSerializer.Serialize(data));
8888
}
89-
}
90-
91-
92-
//public class AuthenticationManager : IAuthenticationManager
93-
//{
94-
// private const string ConfigPath = "config.json";
95-
// private readonly IJsonSerializer _jsonSerializer;
96-
// private readonly IJsonDeserializer _jsonDeserializer;
97-
98-
// public AuthenticationManager(IJsonSerializer jsonSerializer, IJsonDeserializer jsonDeserializer)
99-
// {
100-
// _jsonSerializer = jsonSerializer;
101-
// _jsonDeserializer = jsonDeserializer;
102-
// }
103-
104-
// public bool IsLoggedIn => File.Exists(ConfigPath) && Load() is { } data && (
105-
// data.Type == AuthenticationType.Basic || data.Expiry is null || data.Expiry > DateTime.UtcNow
106-
// );
107-
108-
// public bool IsBasicAuthenticationUsed => File.Exists(ConfigPath) && Load() is { } data &&
109-
// data.Type == AuthenticationType.Basic;
110-
111-
// public AuthenticationData LoginBasic(string username, string password)
112-
// {
113-
// var data = new AuthenticationData
114-
// {
115-
// Type = AuthenticationType.Basic,
116-
// Username = username,
117-
// Password = password
118-
// };
119-
// Save(data);
120-
// return data;
121-
// }
122-
123-
// public AuthenticationData LoginBearer(string token)
124-
// {
125-
// var data = new AuthenticationData
126-
// {
127-
// Type = AuthenticationType.Bearer,
128-
// AccessToken = token,
129-
// Expiry = DateTime.UtcNow.AddHours(1)
130-
// };
131-
// Save(data);
132-
// return data;
133-
// }
134-
135-
// public AuthenticationData? GetData()
136-
// {
137-
// return Load();
138-
// }
139-
140-
// public void Logout()
141-
// {
142-
// if (File.Exists(ConfigPath)) File.Delete(ConfigPath);
143-
// }
144-
145-
// private AuthenticationData? Load()
146-
// {
147-
// if (!File.Exists(ConfigPath)) return null;
148-
// return _jsonDeserializer.Deserialize<AuthenticationData>(File.ReadAllText(ConfigPath));
149-
// }
150-
151-
// private void Save(AuthenticationData data)
152-
// {
153-
// File.WriteAllText(ConfigPath, _jsonSerializer.Serialize(data));
154-
// }
155-
//}
89+
}

src/FlowCtl/Commands/Plugins/Install/InstallPluginCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class InstallPluginCommand : BaseCommand<InstallPluginCommandOptions, I
77
public InstallPluginCommand() : base("install", Resources.Commands_Plugins_InstallDescription)
88
{
99
var typeOption = new Option<string>(new[] { "-t", "--type" },
10-
description: Resources.Commands_Plugins_TypeOption) { IsRequired = true };
10+
description: Resources.Commands_Plugins_Install_TypeOption) { IsRequired = true };
1111

1212
var versionOption = new Option<string>(new[] { "-v", "--version" },
1313
description: Resources.Commands_Plugins_VersionOption) { IsRequired = true };

src/FlowCtl/Commands/Plugins/Uninstall/UninstallPluginCommand.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using FlowCtl.Commands.Plugins.Install;
2-
using System.CommandLine;
1+
using System.CommandLine;
32

43
namespace FlowCtl.Commands.Plugins.Uninstall;
54

@@ -8,7 +7,7 @@ internal class UninstallPluginCommand : BaseCommand<UninstallPluginCommandOption
87
public UninstallPluginCommand() : base("uninstall", Resources.Commands_Plugins_UninstallDescription)
98
{
109
var typeOption = new Option<string>(new[] { "-t", "--type" },
11-
description: Resources.Commands_Plugins_TypeOption) { IsRequired = true };
10+
description: Resources.Commands_Plugins_UnInstall_TypeOption) { IsRequired = true };
1211

1312
var versionOption = new Option<string>(new[] { "-v", "--version" },
1413
description: Resources.Commands_Plugins_VersionOption) { IsRequired = true };

src/FlowCtl/Commands/Plugins/Update/UpdatePluginCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class UpdatePluginCommand : BaseCommand<UpdatePluginCommandOptions, Upd
77
public UpdatePluginCommand() : base("update", Resources.Commands_Plugins_UpdateDescription)
88
{
99
var typeOption = new Option<string>(new[] { "-t", "--type" },
10-
description: Resources.Commands_Plugins_TypeOption) { IsRequired = true };
10+
description: Resources.Commands_Plugins_Install_TypeOption) { IsRequired = true };
1111

1212
var oldVersionOption = new Option<string>(new[] { "-o", "--old-version" },
1313
description: Resources.Commands_Plugins_OldVersionOption) { IsRequired = true };

src/FlowCtl/Commands/Workflows/Add/AddWorkflowCommandOptionsHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private async Task Execute(AddWorkflowCommandOptions options, CancellationToken
4545
if (!string.IsNullOrEmpty(options.DefinitionFile))
4646
{
4747
if (!File.Exists(options.DefinitionFile))
48-
throw new Exception($"Entered definition file '{options.DefinitionFile}' is not exist.");
48+
throw new Exception(string.Format(Resources.Command_Workflow_AddCommand_FileNotExist, options.DefinitionFile));
4949

5050
definitionJsonData = await File.ReadAllTextAsync(options.DefinitionFile, cancellationToken);
5151
}

src/FlowCtl/Commands/Workflows/Executions/Cancel/WorkflowExecutionCancelCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ namespace FlowCtl.Commands.Workflows.Executions.Cancel;
55
internal class WorkflowExecutionCancelCommand
66
: BaseCommand<WorkflowExecutionCancelCommandOptions, WorkflowExecutionCancelCommandOptionsHandler>
77
{
8-
public WorkflowExecutionCancelCommand() : base("cancel", Resources.Commands_Workflows_DetailsDescription)
8+
public WorkflowExecutionCancelCommand() : base("cancel", Resources.Commands_Workflow_Execution_CancelDescription)
99
{
1010
var workflowIdOption = new Option<string>(new[] { "-w", "--workflow-id" },
11-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
11+
description: Resources.Commands_Workflows_IdentityOption) { IsRequired = true };
1212

1313
var executionIdOption = new Option<string>(new[] { "-e", "--execution-id" },
14-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
14+
description: Resources.Commands_Workflows_Execution_IdentityOption) { IsRequired = true };
1515

1616
var addressOption = new Option<string?>(new[] { "-a", "--address" },
1717
description: Resources.Commands_FlowSynxAddress);

src/FlowCtl/Commands/Workflows/Executions/Details/WorkflowExecutionsDetailsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ namespace FlowCtl.Commands.Workflows.Executions.Details;
66
internal class WorkflowExecutionDetailsCommand
77
: BaseCommand<WorkflowExecutionDetailsCommandOptions, WorkflowExecutionDetailsCommandOptionsHandler>
88
{
9-
public WorkflowExecutionDetailsCommand() : base("details", Resources.Commands_Workflows_DetailsDescription)
9+
public WorkflowExecutionDetailsCommand() : base("details", Resources.Commands_Workflow_Execution_DetailsDescription)
1010
{
1111
var workflowIdOption = new Option<string>(new[] { "-w", "--workflow-id" },
12-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
12+
description: Resources.Commands_Workflows_IdentityOption) { IsRequired = true };
1313

1414
var executionIdOption = new Option<string>(new[] { "-e", "--execution-id" },
15-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
15+
description: Resources.Commands_Workflows_Execution_IdentityOption) { IsRequired = true };
1616

1717
var addressOption = new Option<string?>(new[] { "-a", "--address" },
1818
description: Resources.Commands_FlowSynxAddress);

src/FlowCtl/Commands/Workflows/Executions/Execute/ExecuteWorkflowCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class ExecuteWorkflowCommand : BaseCommand<ExecuteWorkflowCommandOption
77
public ExecuteWorkflowCommand() : base("execute", Resources.Commands_Workflows_ExecuteDescription)
88
{
99
var workflowIdOption = new Option<string>(new[] { "-w", "--workflow-id" },
10-
description: Resources.Commands_Workflows_ExecuteIdentityOption)
10+
description: Resources.Commands_Workflows_IdentityOption)
1111
{ IsRequired = true };
1212

1313
var addressOption = new Option<string?>(new[] { "-a", "--address" },

src/FlowCtl/Commands/Workflows/Executions/Logs/WorkflowExecutionLogsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ namespace FlowCtl.Commands.Workflows.Executions.Logs;
66
internal class WorkflowExecutionLogsCommand
77
: BaseCommand<WorkflowExecutionLogsCommandOptions, WorkflowExecutionLogsCommandOptionsHandler>
88
{
9-
public WorkflowExecutionLogsCommand() : base("logs", Resources.Commands_Workflows_DetailsDescription)
9+
public WorkflowExecutionLogsCommand() : base("logs", Resources.Commands_Workflow_Execution_LogsDescription)
1010
{
1111
var workflowIdOption = new Option<string>(new[] { "-w", "--workflow-id" },
12-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
12+
description: Resources.Commands_Workflows_IdentityOption) { IsRequired = true };
1313

1414
var executionIdOption = new Option<string>(new[] { "-e", "--execution-id" },
15-
description: Resources.Commands_Workflows_DetailsIdentityOption) { IsRequired = true };
15+
description: Resources.Commands_Workflows_Execution_IdentityOption) { IsRequired = true };
1616

1717
var addressOption = new Option<string?>(new[] { "-a", "--address" },
1818
description: Resources.Commands_FlowSynxAddress);

src/FlowCtl/Commands/Workflows/Executions/WorkflowExecutionsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class WorkflowExecutionsCommand : BaseCommand<WorkflowExecutionsCommand
1212
public WorkflowExecutionsCommand() : base("executions", Resources.Commands_Workflows_ExecutionsListDescription)
1313
{
1414
var workflowIdOption = new Option<string>(new[] { "-w", "--workflow-id" },
15-
description: Resources.Commands_Workflows_Executions_IdentityOption) { IsRequired = true };
15+
description: Resources.Commands_Workflows_IdentityOption) { IsRequired = true };
1616

1717
var addressOption = new Option<string?>(new[] { "-a", "--address" },
1818
description: Resources.Commands_FlowSynxAddress);

0 commit comments

Comments
 (0)