Skip to content

Commit 5d4e97e

Browse files
author
Mindaugas Veblauskas
committed
Merge branch 'release/2.3.1'
2 parents b62859a + e90073f commit 5d4e97e

File tree

140 files changed

+2109
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2109
-567
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ dotnet_naming_rule.members_are_pascal_case.style=member_style
254254
# Constant Fields Should Be PascalCase
255255
dotnet_naming_rule.constant_fields_should_be_upper_case.severity=warning
256256
dotnet_naming_rule.constant_fields_should_be_upper_case.symbols=constant_fields
257-
dotnet_naming_rule.constant_fields_should_be_upper_case.style=pascal_case_style
257+
dotnet_naming_rule.constant_fields_should_be_upper_case.style=upper_case_style
258258
dotnet_naming_symbols.constant_fields.applicable_kinds=field
259259
dotnet_naming_symbols.constant_fields.required_modifiers=const
260260
dotnet_naming_style.pascal_case_style.capitalization=pascal_case

src/Api/ProtonVPN.Api.Contracts/IApiClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using ProtonVPN.Api.Contracts.Common;
2626
using ProtonVPN.Api.Contracts.Events;
2727
using ProtonVPN.Api.Contracts.Geographical;
28+
using ProtonVPN.Api.Contracts.Partners;
2829
using ProtonVPN.Api.Contracts.Profiles;
2930
using ProtonVPN.Api.Contracts.ReportAnIssue;
3031
using ProtonVPN.Api.Contracts.Servers;
@@ -55,6 +56,7 @@ public interface IApiClient : IClientBase
5556
Task<ApiResponseResult<VpnConfig.VpnConfigResponse>> GetVpnConfig();
5657
Task<ApiResponseResult<AnnouncementsResponse>> GetAnnouncementsAsync(AnnouncementsRequest request);
5758
Task<ApiResponseResult<StreamingServicesResponse>> GetStreamingServicesAsync();
59+
Task<ApiResponseResult<PartnersResponse>> GetPartnersAsync();
5860
Task<ApiResponseResult<BaseResponse>> CheckAuthenticationServerStatusAsync();
5961
Task<ApiResponseResult<CertificateResponse>> RequestAuthCertificateAsync(CertificateRequest request);
6062
Task<ApiResponseResult<BaseResponse>> ApplyPromoCodeAsync(PromoCodeRequest promoCodeRequest);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2022 Proton Technologies AG
3+
*
4+
* This file is part of ProtonVPN.
5+
*
6+
* ProtonVPN is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* ProtonVPN is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
using System.Collections.Generic;
21+
using Newtonsoft.Json;
22+
23+
namespace ProtonVPN.Api.Contracts.Partners
24+
{
25+
public class PartnerResponse
26+
{
27+
public string Name { get; set; }
28+
29+
public string Description { get; set; }
30+
31+
[JsonProperty("WebsiteURL")]
32+
public string WebsiteUrl { get; set; }
33+
34+
[JsonProperty("IconURL")]
35+
public string IconUrl { get; set; }
36+
37+
public List<string> LogicalIDs { get; set; }
38+
}
39+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2022 Proton Technologies AG
3+
*
4+
* This file is part of ProtonVPN.
5+
*
6+
* ProtonVPN is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* ProtonVPN is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
using System.Collections.Generic;
21+
using Newtonsoft.Json;
22+
23+
namespace ProtonVPN.Api.Contracts.Partners
24+
{
25+
public class PartnerTypeResponse
26+
{
27+
public string Type { get; set; }
28+
29+
public string Description { get; set; }
30+
31+
[JsonProperty("IconURL")]
32+
public string IconUrl { get; set; }
33+
34+
public List<PartnerResponse> Partners { get; set; }
35+
}
36+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2022 Proton Technologies AG
3+
*
4+
* This file is part of ProtonVPN.
5+
*
6+
* ProtonVPN is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* ProtonVPN is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
using System.Collections.Generic;
21+
using ProtonVPN.Api.Contracts.Common;
22+
23+
namespace ProtonVPN.Api.Contracts.Partners
24+
{
25+
public class PartnersResponse : BaseResponse
26+
{
27+
public List<PartnerTypeResponse> PartnerTypes { get; set; }
28+
}
29+
}

src/Api/ProtonVPN.Api.Contracts/ProtonVPN.Api.Contracts.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
<Compile Include="ExpandedHttpStatusCodes.cs" />
7070
<Compile Include="IApiHostProvider.cs" />
7171
<Compile Include="IFileDownloadHttpClientFactory.cs" />
72+
<Compile Include="Partners\PartnerResponse.cs" />
73+
<Compile Include="Partners\PartnersResponse.cs" />
74+
<Compile Include="Partners\PartnerTypeResponse.cs" />
7275
<Compile Include="Profiles\BaseProfileResponse.cs" />
7376
<Compile Include="Common\BaseResponse.cs" />
7477
<Compile Include="Common\BaseResponseDetail.cs" />

src/Api/ProtonVPN.Api/ApiClient.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
using ProtonVPN.Api.Contracts.Common;
2929
using ProtonVPN.Api.Contracts.Events;
3030
using ProtonVPN.Api.Contracts.Geographical;
31+
using ProtonVPN.Api.Contracts.Partners;
3132
using ProtonVPN.Api.Contracts.Profiles;
3233
using ProtonVPN.Api.Contracts.ReportAnIssue;
3334
using ProtonVPN.Api.Contracts.Servers;
@@ -105,7 +106,7 @@ public async Task<ApiResponseResult<EventResponse>> GetEventResponse(string last
105106
public async Task<ApiResponseResult<ServersResponse>> GetServersAsync(string ip)
106107
{
107108
HttpRequestMessage request = GetAuthorizedRequest(HttpMethod.Get,
108-
"vpn/logicals?SignServer=Server.EntryIP,Server.Label", ip);
109+
"vpn/logicals?SignServer=Server.EntryIP,Server.Label&WithPartnerLogicals=1", ip);
109110
request.SetRetryCount(SERVERS_RETRY_COUNT);
110111
request.SetCustomTimeout(TimeSpan.FromSeconds(SERVERS_TIMEOUT_IN_SECONDS));
111112
return await SendRequest<ServersResponse>(request, "Get servers");
@@ -215,6 +216,12 @@ public async Task<ApiResponseResult<StreamingServicesResponse>> GetStreamingServ
215216
return await SendRequest<StreamingServicesResponse>(request, "Get streaming services");
216217
}
217218

219+
public async Task<ApiResponseResult<PartnersResponse>> GetPartnersAsync()
220+
{
221+
HttpRequestMessage request = GetAuthorizedRequest(HttpMethod.Get, "vpn/v1/partners");
222+
return await SendRequest<PartnersResponse>(request, "Get partners");
223+
}
224+
218225
public async Task<ApiResponseResult<BaseResponse>> CheckAuthenticationServerStatusAsync()
219226
{
220227
HttpRequestMessage request = GetRequest(HttpMethod.Get, "domains/available?Type=login");

src/GlobalAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

16-
[assembly: AssemblyVersion("2.2.1.0")]
17-
[assembly: AssemblyFileVersion("2.2.1.0")]
16+
[assembly: AssemblyVersion("2.3.1.0")]
17+
[assembly: AssemblyFileVersion("2.3.1.0")]
1818
[assembly: ComVisible(false)]
1919
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]

src/HumanVerification/ProtonVPN.HumanVerification.Gui/WebViewViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ namespace ProtonVPN.HumanVerification.Gui
3333
{
3434
public class WebViewViewModel : ViewModelBase, IWebViewViewModel
3535
{
36-
private readonly IConfiguration _config;
3736
private readonly ILogger _logger;
3837
private readonly ICaptchaUrlProvider _captchaUrlProvider;
3938

@@ -55,7 +54,6 @@ public int Height
5554

5655
public WebViewViewModel(IConfiguration config, ILogger logger, ICaptchaUrlProvider captchaUrlProvider)
5756
{
58-
_config = config;
5957
_logger = logger;
6058
_captchaUrlProvider = captchaUrlProvider;
6159

src/ProtonVPN.App/ConnectionInfo/ConnectionInfoViewModel.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,18 @@ public int LoadNumber
4747

4848

4949
public bool Maintenance { get; }
50-
public object Ip { get; }
5150
public bool SecureCore { get; }
5251
public bool PlusServer { get; }
5352
public bool P2PServer { get; }
5453
public bool TorServer { get; }
5554

56-
private bool _showTooltip;
57-
public bool ShowTooltip
58-
{
59-
get => _showTooltip;
60-
set => Set(ref _showTooltip, value);
61-
}
62-
6355
public ConnectionInfoViewModel(Server server)
6456
{
6557
Ensure.NotNull(server, nameof(server));
6658

6759
LoadNumber = server.Load;
6860
Load = $"{server.Load}%";
6961
Maintenance = server.Status == 0;
70-
Ip = new Ip {Address = server.ExitIp};
7162
PlusServer = server.Tier.Equals(ServerTiers.Plus);
7263
P2PServer = server.SupportsP2P();
7364
TorServer = server.SupportsTor();
@@ -87,11 +78,6 @@ public ConnectionInfoViewModel(Server server)
8778
ExitCountry = Countries.GetName(server.ExitCountry)
8879
};
8980
}
90-
91-
if (server.IsSecureCore() || server.IsFree())
92-
{
93-
Ip = new AutoAssignedIp();
94-
}
9581
}
9682
}
97-
}
83+
}

0 commit comments

Comments
 (0)