Skip to content

Commit e53ffcf

Browse files
committed
Version 1.1
1 parent eaf6f6c commit e53ffcf

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,4 @@ __pycache__/
265265
/Engine/lib/Microsoft.Mashup.OAuth.dll
266266
/Engine/lib/Microsoft.Data.Mashup.dll
267267
/Engine/lib/Microsoft.ApplicationInsights.dll
268+
/.doc

Client/CredentialOData.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@ public class CredentialOData : Credential
1515
/// URL address of the resource
1616
/// </summary>
1717
public string Url { get; set; }
18+
19+
/// <summary>
20+
/// Username value
21+
/// </summary>
22+
public string Username { get; set; }
23+
24+
/// <summary>
25+
/// Password value
26+
/// </summary>
27+
public string Password { get; set; }
1828
}
1929
}

Engine/CommandCredentials.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,19 @@ public void SetCredentialSQL(string sql, string userName, string password)
6565
return;
6666
}
6767

68-
public void SetCredentialOData(string url)
68+
public void SetCredentialOData(string url, string userName, string password)
6969
{
7070
DataSource dataSource = new DataSource("OData", url);
71-
DataSourceSetting dataSourceSetting = new DataSourceSetting("Anonymous");
72-
73-
CredentialStore.SetCredential(dataSource, dataSourceSetting, null);
71+
if (userName == null)
72+
{
73+
DataSourceSetting dataSourceSetting = new DataSourceSetting("Anonymous");
74+
CredentialStore.SetCredential(dataSource, dataSourceSetting, null);
75+
}
76+
else
77+
{
78+
var dataSourceSetting = DataSourceSetting.CreateUsernamePasswordCredential(userName, password);
79+
CredentialStore.SetCredential(dataSource, dataSourceSetting, null);
80+
}
7481

7582
return;
7683
}

PowerQueryNet.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup", "Setup\Setup.wixpro
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Setup.Actions", "Setup.Actions\Setup.Actions.csproj", "{C4521615-F8A1-4021-90C4-A2B85EB09703}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PQNet", "PQNet\PQNet.csproj", "{91D3B517-685E-4806-A17F-5589CFF21E29}"
17+
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1820
Debug|Any CPU = Debug|Any CPU
@@ -58,6 +60,14 @@ Global
5860
{C4521615-F8A1-4021-90C4-A2B85EB09703}.Release|Any CPU.ActiveCfg = Release|x86
5961
{C4521615-F8A1-4021-90C4-A2B85EB09703}.Release|x86.ActiveCfg = Release|x86
6062
{C4521615-F8A1-4021-90C4-A2B85EB09703}.Release|x86.Build.0 = Release|x86
63+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Debug|Any CPU.Build.0 = Debug|Any CPU
65+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Debug|x86.ActiveCfg = Debug|Any CPU
66+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Debug|x86.Build.0 = Debug|Any CPU
67+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Release|Any CPU.ActiveCfg = Release|Any CPU
68+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Release|Any CPU.Build.0 = Release|Any CPU
69+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Release|x86.ActiveCfg = Release|Any CPU
70+
{91D3B517-685E-4806-A17F-5589CFF21E29}.Release|x86.Build.0 = Release|Any CPU
6171
EndGlobalSection
6272
GlobalSection(SolutionProperties) = preSolution
6373
HideSolutionNode = FALSE

Service/PowerQueryService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ public ExecuteResponse Execute(ExecuteRequest executeRequest)
163163
commandCredentials.SetCredentialWeb(credentialWeb.Url);
164164
else if (credential is CredentialSQL credentialSQL)
165165
commandCredentials.SetCredentialSQL(credentialSQL.SQL, credentialSQL.Username, credentialSQL.Password);
166+
else if (credential is CredentialOData credentialOData)
167+
commandCredentials.SetCredentialOData(((CredentialOData)credential).Url, credentialOData.Username, credentialOData.Password);
166168
else
167169
throw new NotImplementedException("This Credential kind is not supported for now.");
168170
}

0 commit comments

Comments
 (0)