Skip to content

Commit

Permalink
Merge branch 'release/FTP/v2.3.0' into masters/FTP
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuiliescu committed Apr 11, 2022
2 parents a81550d + 5ddf8a6 commit 13a96e2
Show file tree
Hide file tree
Showing 362 changed files with 45,839 additions and 5,293 deletions.
6 changes: 4 additions & 2 deletions Activities/.nuget/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="NuGet" value="https://nuget.org/api/v2/" />
<add key="UiPath-Official" value="https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json" />
<add key="NuGet-v2" value="https://nuget.org/api/v2/" />
<add key="NuGet-v3" value="https://api.nuget.org/v3/index.json" />
<add key="MyGet" value="https://www.myget.org/F/uipath/" />
<add key="MyGet-workflow" value="https://www.myget.org/F/workflow/api/v3/index.json" />
<add key="UiPath-Internal" value="https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json" />
<add key="MyGet_Dev" value="https://www.myget.org/F/uipath-dev/api/v3/index.json" />
<add key="MyGet-Dev" value="https://www.myget.org/F/uipath-dev/api/v3/index.json" />
</packageSources>
</configuration>
16 changes: 5 additions & 11 deletions Activities/.pipelines/tests/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ variables:
- group: SQLServer-tests
- group: Oracle-tests
- name: azureServiceConnectionName
value: 'AzureDevTest-EA'
value: 'AzureDevTest-EA_act-tst-com-we-rg'
- name: aksResourcePrefix
value: 'dvts-ts-ta-we'
value: 'act-tst-com-we'
- name: sftpContainer
value: 'sftpserver-deployment'
value: 'sftpserver'
- name: sqlserverContainer
value: 'sqlserver-deployment'
value: 'sqlserver'
- name: oracleContainer
value: 'oracleserver-deployment'
value: 'oracleserver'
- name: uipathLicenseCode
value: $(LicenseCode)
- name: uipathVersion
Expand Down Expand Up @@ -141,8 +141,6 @@ stages:

- template: steps/clean_aks.yml
parameters:
azureServiceConnectionName: $(azureServiceConnectionName)
aksResourcePrefix: $(aksResourcePrefix)
sftpContainer: $(sftpContainer)
oracleContainer: $(oracleContainer)
sqlserverContainer: $(sqlserverContainer)
Expand Down Expand Up @@ -185,8 +183,6 @@ stages:

- template: steps/clean_aks.yml
parameters:
azureServiceConnectionName: $(azureServiceConnectionName)
aksResourcePrefix: $(aksResourcePrefix)
sftpContainer: $(sftpContainer)
sqlserverContainer: $(sqlserverContainer)
oracleContainer: $(oracleContainer)
Expand Down Expand Up @@ -225,8 +221,6 @@ stages:

- template: steps/clean_aks.yml
parameters:
azureServiceConnectionName: $(azureServiceConnectionName)
aksResourcePrefix: $(aksResourcePrefix)
sftpContainer: $(sftpContainer)
sqlserverContainer: $(sqlserverContainer)
oracleContainer: $(oracleContainer)
Expand Down
10 changes: 3 additions & 7 deletions Activities/.pipelines/tests/steps/clean_aks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
parameters:
- name: azureServiceConnectionName
type: string
- name: aksResourcePrefix
type: string
- name: sftpContainer
type: string
- name: sqlserverContainer
Expand All @@ -22,17 +18,17 @@ parameters:
steps:
- ${{ if eq(parameters.deploySftpContainer, true) }}:
- script: |
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sftpContainer).yml --namespace=$(namespace)
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sftpContainer)-deployment.yml --namespace=$(namespace)
displayName: clean - kube delete $(sftpContainer)
- ${{ if eq(parameters.deploySqlserverContainer, true) }}:
- script: |
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sqlserverContainer).yml --namespace=$(namespace)
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sqlserverContainer)-deployment.yml --namespace=$(namespace)
displayName: clean - kube delete $(sqlserverContainer)
- ${{ if eq(parameters.deployOracleContainer, true) }}:
- script: |
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(oracleContainer).yml --namespace=$(namespace)
kubectl delete -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(oracleContainer)-deployment.yml --namespace=$(namespace)
displayName: clean - kube delete $(oracleContainer)
- script: |
Expand Down
1 change: 0 additions & 1 deletion Activities/.pipelines/tests/steps/run_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ steps:
parameters:
versions:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
Expand Down
18 changes: 9 additions & 9 deletions Activities/.pipelines/tests/steps/setup_aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ steps:
- ${{ if eq(parameters.deploySqlserverContainer, true) }}:
- script: |
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sqlserverContainer).yml --namespace=$(namespace)
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sqlserverContainer)-deployment.yml --namespace=$(namespace)
displayName: kube deploy $(sqlserverContainer)
- ${{ if eq(parameters.deploySftpContainer, true) }}:
- script: |
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sftpContainer).yml --namespace=$(namespace)
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(sftpContainer)-deployment.yml --namespace=$(namespace)
displayName: kube deploy $(sftpContainer)
- ${{ if eq(parameters.deployOracleContainer, true) }}:
- script: |
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(oracleContainer).yml --namespace=$(namespace)
kubectl apply -f $(Build.SourcesDirectory)/Activities/.pipelines/tests/kube/$(oracleContainer)-deployment.yml --namespace=$(namespace)
displayName: kube deploy $(oracleContainer)
- ${{ if eq(parameters.deploySqlserverContainer, true) }}:
Expand All @@ -63,8 +63,8 @@ steps:
inputs:
targetType: 'inline'
script: |
Start-Sleep -s 30
$ip=((kubectl describe service $(sqlserverContainer) --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Start-Sleep -s 120
$ip=((kubectl describe service $(sqlserverContainer)-deployment --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Write-Host "##vso[task.setvariable variable=sqlPublicIP;]$ip"
Write-Host "SQL IP $ip"
Expand All @@ -74,8 +74,8 @@ steps:
inputs:
targetType: 'inline'
script: |
Start-Sleep -s 30
$ip=((kubectl describe service $(sftpContainer) --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Start-Sleep -s 120
$ip=((kubectl describe service $(sftpContainer)-deployment --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Write-Host "##vso[task.setvariable variable=sftpPublicIP;]$ip"
Write-Host "SFTP IP $ip"
Expand All @@ -85,7 +85,7 @@ steps:
inputs:
targetType: 'inline'
script: |
Start-Sleep -s 30
$ip=((kubectl describe service $(oracleContainer) --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Start-Sleep -s 120
$ip=((kubectl describe service $(oracleContainer)-deployment --namespace=$(namespace)|Select-string "LoadBalancer Ingress").ToString()|Select-String -Pattern "\d{1,3}(\.\d{1,3}){3}" -AllMatches).Matches.Value
Write-Host "##vso[task.setvariable variable=oraclePublicIP;]$ip"
Write-Host "Oracle IP $ip"
63 changes: 63 additions & 0 deletions Activities/Activities.Database.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,99 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.Database.Activities.Packaging", "Database\UiPath.Database.Activities.Packaging\UiPath.Database.Activities.Packaging.csproj", "{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConnectionDialog", "ConnectionDialog", "{F9EBC963-6921-4790-98DB-53C5E63AA881}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.Data.ConnectionUI.Dialog", "Database\ConnectionDialog\UiPath.Data.ConnectionUI.Dialog\UiPath.Data.ConnectionUI.Dialog.csproj", "{BA22A083-23F5-46B5-A037-9618D2E2D185}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|x64.ActiveCfg = Debug|x64
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|x64.Build.0 = Debug|x64
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|x86.ActiveCfg = Debug|x86
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Debug|x86.Build.0 = Debug|x86
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|Any CPU.Build.0 = Release|Any CPU
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|x64.ActiveCfg = Release|x64
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|x64.Build.0 = Release|x64
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|x86.ActiveCfg = Release|x86
{BD4850CC-23BF-4BEA-933E-F1FD7C692451}.Release|x86.Build.0 = Release|x86
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|x64.ActiveCfg = Debug|x64
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|x64.Build.0 = Debug|x64
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|x86.ActiveCfg = Debug|x86
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Debug|x86.Build.0 = Debug|x86
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|Any CPU.Build.0 = Release|Any CPU
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|x64.ActiveCfg = Release|x64
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|x64.Build.0 = Release|x64
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|x86.ActiveCfg = Release|x86
{E6D45FA7-57A7-4136-99C6-6EE89851F4CD}.Release|x86.Build.0 = Release|x86
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|x64.ActiveCfg = Debug|x64
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|x64.Build.0 = Debug|x64
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|x86.ActiveCfg = Debug|x86
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Debug|x86.Build.0 = Debug|x86
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|Any CPU.Build.0 = Release|Any CPU
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|x64.ActiveCfg = Release|x64
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|x64.Build.0 = Release|x64
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|x86.ActiveCfg = Release|x86
{AE083078-F322-408C-ABFC-F2C89BA8DE63}.Release|x86.Build.0 = Release|x86
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|x64.ActiveCfg = Debug|x64
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|x64.Build.0 = Debug|x64
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|x86.ActiveCfg = Debug|x86
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Debug|x86.Build.0 = Debug|x86
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|Any CPU.Build.0 = Release|Any CPU
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|x64.ActiveCfg = Release|x64
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|x64.Build.0 = Release|x64
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|x86.ActiveCfg = Release|x86
{4F6DE5DC-1E17-4713-AF82-BE99643D5326}.Release|x86.Build.0 = Release|x86
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|x64.ActiveCfg = Debug|x64
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|x64.Build.0 = Debug|x64
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|x86.ActiveCfg = Debug|x86
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Debug|x86.Build.0 = Debug|x86
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|Any CPU.Build.0 = Release|Any CPU
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|x64.ActiveCfg = Release|x64
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|x64.Build.0 = Release|x64
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|x86.ActiveCfg = Release|x86
{9417D940-CA01-4044-AEAA-C9EAFC2FA3E6}.Release|x86.Build.0 = Release|x86
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|x64.ActiveCfg = Debug|x64
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|x64.Build.0 = Debug|x64
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|x86.ActiveCfg = Debug|x86
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Debug|x86.Build.0 = Debug|x86
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|Any CPU.Build.0 = Release|Any CPU
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|x64.ActiveCfg = Release|x64
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|x64.Build.0 = Release|x64
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|x86.ActiveCfg = Release|x86
{BA22A083-23F5-46B5-A037-9618D2E2D185}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BA22A083-23F5-46B5-A037-9618D2E2D185} = {F9EBC963-6921-4790-98DB-53C5E63AA881}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5AC55779-EA32-41AD-BAAD-1808F8A412CB}
EndGlobalSection
Expand Down
5 changes: 3 additions & 2 deletions Activities/Community.Activities.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{92E6CB4E-6542-419B-B674-7D8B9FB02BD2}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -34,6 +34,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Database", "Database", "{ED3DF9E3-2366-483E-9124-3FA8766EEF77}"
ProjectSection(SolutionItems) = preProject
Database\Database.build.props = Database\Database.build.props
Database\ConnectionDialog\UiPath.Data.ConnectionUI.Dialog\UiPath.Data.ConnectionUI.Dialog.csproj = Database\ConnectionDialog\UiPath.Data.ConnectionUI.Dialog\UiPath.Data.ConnectionUI.Dialog.csproj
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.Database", "Database\UiPath.Database\UiPath.Database.csproj", "{BD4850CC-23BF-4BEA-933E-F1FD7C692451}"
Expand Down
2 changes: 1 addition & 1 deletion Activities/Credentials/Credentials.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Company>UiPath</Company>
<Copyright>© UiPath</Copyright>
<VersionPrefix>1.3.0</VersionPrefix>
<VersionPrefix>2.0.0</VersionPrefix>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Diagnostics;
using System.IO;
using UiPath.Credentials.Activities.Properties;
using System.Security;
using System.Net;

namespace UiPath.Credentials.Activities
{
Expand All @@ -17,21 +19,25 @@ public class AddCredential : CodeActivity<bool>
[LocalizedDescription(nameof(Resources.UsernameDescription))]
public InArgument<string> Username { get; set; }

[RequiredArgument]
[LocalizedCategory(nameof(Resources.Input))]
[LocalizedDisplayName(nameof(Resources.PasswordDisplayName))]
[LocalizedDescription(nameof(Resources.PasswordDescription))]
public InArgument<string> Password { get; set; }

[LocalizedCategory(nameof(Resources.Input))]
[LocalizedDisplayName(nameof(Resources.PasswordSecureStringDisplayName))]
[LocalizedDescription(nameof(Resources.PasswordSecureStringDescription))]
public InArgument<SecureString> PasswordSecureString { get; set; }

[RequiredArgument]
[LocalizedCategory(nameof(Resources.Input))]
[LocalizedDisplayName(nameof(Resources.TargetDisplayName))]
[LocalizedDescription(nameof(Resources.TargetDescription))]
public InArgument<string> Target { get; set; }

[LocalizedCategory(nameof(Resources.Input))]
[LocalizedDisplayName(nameof(Resources.CredentialTypeDisplayName))]
[LocalizedDescription(nameof(Resources.CredentialTypeDescription))]
[LocalizedDisplayName(nameof(Resources.Activity_AddCredential_Property_CredentialType_Name))]
[LocalizedDescription(nameof(Resources.Activity_AddCredential_Property_CredentialType_Description))]
public CredentialType CredentialType { get; set; }

[LocalizedCategory(nameof(Resources.Input))]
Expand All @@ -44,10 +50,29 @@ public AddCredential()
CredentialType = CredentialType.Generic;
PersistanceType = PersistanceType.Enterprise;
}
protected override void CacheMetadata(CodeActivityMetadata metadata)
{
base.CacheMetadata(metadata);

if (!(CredentialType == CredentialType.Generic || CredentialType == CredentialType.DomainPassword))
metadata.AddValidationError(new ValidationError(Resources.ValidationError_InvalidCredentialType,false,nameof(CredentialType)));
}

protected override bool Execute(CodeActivityContext context)
{
Credential credential = new Credential { Target = Target.Get(context), Username = Username.Get(context), Password = Password.Get(context), Type = CredentialType, PersistanceType = PersistanceType };
SecureString passwordSecureString = PasswordSecureString.Get(context);
string password = Password.Get(context);

if (string.IsNullOrWhiteSpace(password) && passwordSecureString == null)
{
throw new ArgumentNullException(Resources.PasswordAndSecureStringNull);
}
if (password != null && passwordSecureString != null)
{
throw new ArgumentException(Resources.PasswordAndSecureStringNotNull);
}

Credential credential = new Credential { Target = Target.Get(context), Username = Username.Get(context), Password = password != null ? password : new NetworkCredential("", passwordSecureString).Password, Type = CredentialType, PersistanceType = PersistanceType };
return credential.Save();
}
}
Expand Down
Loading

0 comments on commit 13a96e2

Please sign in to comment.