Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add signature server #28

Open
wants to merge 47 commits into
base: release/1.2.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7e1393d
phone config and nftitems
portkeyzli May 6, 2023
316282e
change key from big to small
portkeyzli May 6, 2023
f458f14
add ClaimToken Functions
CanghaiWY May 8, 2023
00c5a4c
Add ClaimToken Google Recaptcha
CanghaiWY May 8, 2023
ef648fa
add claimToken Google Recaptcha
CanghaiWY May 9, 2023
bb799da
phone config and nftitems
portkeyzli May 6, 2023
701fa63
feat: add activity display.
felix-zhaolei May 10, 2023
88e4d37
phone config and nftitems
portkeyzli May 6, 2023
a222e6b
feat: add activity display.
felix-zhaolei May 10, 2023
3eaa194
Merge remote-tracking branch 'origin/feature/1.2.6' into feature/1.2.6
felix-zhaolei May 10, 2023
f224d9c
modify: modify activity type.
felix-zhaolei May 10, 2023
64a726e
feat: modify IsDelegated.
felix-zhaolei May 10, 2023
c59a2af
Merge remote-tracking branch 'origin/feature/1.2.6' into feature/1.2.6
CanghaiWY May 10, 2023
bd271e6
modify redis cache key name
CanghaiWY May 10, 2023
b0d7889
fix: fix IsDelegated.
felix-zhaolei May 10, 2023
14a36b6
remove repeated configuration
CanghaiWY May 11, 2023
0e957d5
feat:resolve PR problem.
felix-zhaolei May 17, 2023
20cb183
feat: Add signature server
so00up May 17, 2023
24a10ac
feat: Fix pr
so00up May 17, 2023
727fa0c
feat: Fix pr with log and transaction
so00up May 17, 2023
55e990b
feat: Fix pr with http client factory and ioption inject.
so00up May 17, 2023
fc642fd
feat: Fix pr with charging signature provider to single module.
so00up May 17, 2023
e9bdb37
feat: Fix pr with execute tx with random privatekey with no money, an…
so00up May 18, 2023
4a4ab1f
feat: Fix pr with add signature module into application grain eventha…
so00up May 19, 2023
77c5186
feat: Fix pr :signature server.
so00up May 22, 2023
95036c7
feat: remove transaction dto in application, move it to provider.
so00up May 24, 2023
6ec92e4
feat: change contract method name.
so00up May 24, 2023
c54795a
fix: pr: add params in send&call transaction method.
so00up May 25, 2023
f823c1d
fix: pr: add params in send&call transaction method.
so00up May 25, 2023
6ecf758
fix: pr: claim token with clainTokenContractAddress in option.
so00up May 25, 2023
6a754f2
feat:update unit test
CanghaiWY May 26, 2023
d7b83b3
Merge feature/1.2.8 to release/1.2.8 (#35)
felix-zhaolei May 29, 2023
5510a43
Add ut (#37)
felix-zhaolei May 30, 2023
7e63156
Set GoogleReCaptcha Redis cache DefaultValue (#38)
CanghaiWY Jun 1, 2023
7cddf2a
feat:SMS anti-theft brush
CanghaiWY Jun 2, 2023
eeb71d3
feat:update method name
CanghaiWY Jun 2, 2023
a0e3b04
Merge remote-tracking branch 'origin/feature/1.2.9' into feature/sign…
so00up Jun 5, 2023
c1dc51d
fix: fix merge to feature 1.2.9 problem
so00up Jun 5, 2023
6e72e45
feat: add signature server port by Kestrel.
so00up Jun 5, 2023
a152a60
fix:fix pr problem.
so00up Jun 5, 2023
614537f
fix:fix pr problem.
so00up Jun 5, 2023
8828586
fix:fix pr problem.
so00up Jun 5, 2023
0b20f49
fix:fix pr UT problem.
so00up Jun 5, 2023
f4cc584
fix:change snapshot options.
so00up Jun 5, 2023
75434d4
fix:remove duplicate packageReference.
so00up Jun 5, 2023
3843930
fix:fix contract options.
so00up Jun 5, 2023
6b93645
fix:fix signature relate ci.
so00up Jun 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ grpc_csharp_plugin

launchSettings.json

# dev settings
*/**/appsettings.Development.json

yarn.lock

results/coverage.json
Expand Down
28 changes: 28 additions & 0 deletions CAServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.EntityEventHandler
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.HttpApi.Tests", "test\CAServer.HttpApi.Tests\CAServer.HttpApi.Tests.csproj", "{A79C3A46-D7FA-435F-BFB0-6C41B27C33EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.Signature.HttpApi", "src\CAServer.Signature.HttpApi\CAServer.Signature.HttpApi.csproj", "{E591184A-51BB-4B30-9613-3D71B0A37827}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.Signature.HttpApi.Host", "src\CAServer.Signature.HttpApi.Host\CAServer.Signature.HttpApi.Host.csproj", "{13DC2010-60D4-4925-BE24-996A0516F0B6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.Signature.HttpApi.Tests", "test\CAServer.Signature.HttpApi.Tests\CAServer.Signature.HttpApi.Tests.csproj", "{B0079C9F-368D-4CDB-B097-27A6250BD402}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAServer.Signature", "src\CAServer.Signature\CAServer.Signature.csproj", "{EC87414A-45DA-4FEB-9A25-874C5A852B91}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -187,6 +195,22 @@ Global
{A79C3A46-D7FA-435F-BFB0-6C41B27C33EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A79C3A46-D7FA-435F-BFB0-6C41B27C33EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A79C3A46-D7FA-435F-BFB0-6C41B27C33EE}.Release|Any CPU.Build.0 = Release|Any CPU
{E591184A-51BB-4B30-9613-3D71B0A37827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E591184A-51BB-4B30-9613-3D71B0A37827}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E591184A-51BB-4B30-9613-3D71B0A37827}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E591184A-51BB-4B30-9613-3D71B0A37827}.Release|Any CPU.Build.0 = Release|Any CPU
{13DC2010-60D4-4925-BE24-996A0516F0B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13DC2010-60D4-4925-BE24-996A0516F0B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13DC2010-60D4-4925-BE24-996A0516F0B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13DC2010-60D4-4925-BE24-996A0516F0B6}.Release|Any CPU.Build.0 = Release|Any CPU
{B0079C9F-368D-4CDB-B097-27A6250BD402}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0079C9F-368D-4CDB-B097-27A6250BD402}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0079C9F-368D-4CDB-B097-27A6250BD402}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0079C9F-368D-4CDB-B097-27A6250BD402}.Release|Any CPU.Build.0 = Release|Any CPU
{EC87414A-45DA-4FEB-9A25-874C5A852B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC87414A-45DA-4FEB-9A25-874C5A852B91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC87414A-45DA-4FEB-9A25-874C5A852B91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC87414A-45DA-4FEB-9A25-874C5A852B91}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -221,6 +245,10 @@ Global
{1B1FA09C-98AC-4893-9D76-EC34071E55C5} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{484F985C-3BCC-484D-B2D4-5A366388C249} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{A79C3A46-D7FA-435F-BFB0-6C41B27C33EE} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E591184A-51BB-4B30-9613-3D71B0A37827} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{13DC2010-60D4-4925-BE24-996A0516F0B6} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{B0079C9F-368D-4CDB-B097-27A6250BD402} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{EC87414A-45DA-4FEB-9A25-874C5A852B91} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
Expand Down
14 changes: 6 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
# - script: PowerShell.exe -file build.ps1 --target=Upload-Coverage-Azure
# displayName: 'Upload data to Codecov'
# All tasks on Linux
- job: build_all_linux
displayName: Build all tasks (Linux)
# - job: build_all_linux
# displayName: Build all tasks (Linux)
# timeoutInMinutes: 120
# pool:
# vmImage: ubuntu-latest
Expand Down Expand Up @@ -60,21 +60,19 @@ jobs:
# - script: bash build.sh --target=Upload-Coverage-Azure
# displayName: 'Upload data to Codecov'
#All tasks on macOS
# - job: build_all_darwin
# displayName: Build all tasks (macOS)
- job: build_all_darwin
displayName: Build all tasks (macOS)
timeoutInMinutes: 120
pool:
name: Default
demands:
- Agent.OS -equals Linux
vmImage: macos-latest
variables:
CI_TEST: true
steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 7.0.x
- script: cd scripts && bash elasticsearch-linux.sh
- script: cd scripts && bash elasticsearch-macOS.sh
displayName: 'Start an elasticsearch'
- script: bash build.sh --target=Test-with-Codecov
displayName: 'Build and Test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class AppleAuthOptions
public List<string> Audiences { get; set; }
public string RedirectUrl { get; set; }
public string BingoRedirectUrl { get; set; }
public string UnifyRedirectUrl { get; set; }
public ExtensionConfig ExtensionConfig { get; set; }
}

Expand Down

This file was deleted.

37 changes: 35 additions & 2 deletions src/CAServer.Application.Contracts/CAActivity/ActivityConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ namespace CAServer.CAActivity;

public static class ActivityConstants
{
public static readonly Dictionary<string, string> TypeMap = new()
{
{ "Transfer", "Transfer" },
{ "CrossChainTransfer", "CrossChain Transfer" },
{ "SocialRecovery", "Social Recovery" },
{ "RemoveManagerInfo", "Exit Wallet" },
{ "AddManagerInfo", "Scan code login" },
{ "CreateCAHolder", "Create CA address" },
{ "AddGuardian", "Add guardian" },
{ "RemoveGuardian", "Remove guardian" },
{ "UpdateGuardian", "Edit guardian" },
{ "SetGuardianForLogin", "Set login account" },
{ "UnsetGuardianForLogin", "Unset login account" },
{ "RemoveOtherManagerInfo", "Remove device" },
{ "ClaimToken", "Transfer" },
{ "Register", "Register" },
{ "Approve", "Approve" },
{ "Bingo", "Bingo" },
{ "Play", "Play" }
};

public static readonly List<string> DefaultTypes = new()
{
"Transfer", "SocialRecovery", "RemoveManagerInfo", "AddManagerInfo"
Expand All @@ -13,7 +34,7 @@ public static class ActivityConstants
{
"Transfer", "CrossChainTransfer", "CrossChainReceiveToken", "SocialRecovery", "RemoveManagerInfo",
"AddManagerInfo", "CreateCAHolder", "AddGuardian", "RemoveGuardian", "UpdateGuardian", "SetGuardianForLogin",
"UnsetGuardianForLogin", "RemoveOtherManagerInfo", "ClaimToken", "Approve", "Bingo", "Play"
"UnsetGuardianForLogin", "RemoveOtherManagerInfo", "ClaimToken", "Register", "Approve", "Bingo", "Play"
};

public static readonly List<string> TransferTypes = new()
Expand All @@ -24,7 +45,9 @@ public static class ActivityConstants
public static readonly List<string> ContractTypes = new()
{
"SocialRecovery", "RemoveManagerInfo", "AddManagerInfo", "CreateCAHolder", "AddGuardian", "RemoveGuardian",
"UpdateGuardian", "SetGuardianForLogin", "UnsetGuardianForLogin", "RemoveOtherManagerInfo", "Approve", "Bingo", "Play"
"UpdateGuardian", "SetGuardianForLogin", "UnsetGuardianForLogin", "RemoveOtherManagerInfo", "Register",
"Approve", "Bingo",
"Play"
};

public static readonly List<string> ShowPriceTypes = new()
Expand All @@ -34,5 +57,15 @@ public static class ActivityConstants
"UnsetGuardianForLogin", "RemoveOtherManagerInfo", "ClaimToken", "Approve", "Bingo", "Play"
};

public static readonly List<string> ShowNftTypes = new()
{
"Transfer", "CrossChainTransfer"
};

public static readonly List<string> RecentTypes = new()
{
"Transfer", "CrossChainTransfer", "ClaimToken"
};

public static readonly string Zero = "0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class ActivityBase
public string TransactionId { get; set; }
public string BlockHash { get; set; }
public string TransactionType { get; set; }
public string TransactionName { get; set; }
public string Amount { get; set; }
public string Symbol { get; set; }
public string Decimals { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;
using CAServer.UserAssets;
using Volo.Abp.Application.Dtos;

namespace CAServer.CAActivity.Dtos;

public class GetTwoCaTransactionRequestDto : PagedResultRequestDto
{
public List<CAAddressInfo> TargetAddressInfos { get; set; }

public List<CAAddressInfo> CaAddressInfos { get; set; }
public string ChainId { get; set; }
public string Symbol { get; set; }

public int Width { get; set; }

public int Height { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public class IndexerTransactions
public CaHolderTransaction CaHolderTransaction { get; set; }
}

public class TransactionsDto
{
public CaHolderTransaction TwoCaHolderTransaction { get; set; }
}

public class CaHolderTransaction
{
public List<IndexerTransaction> Data { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace CAServer.CAActivity;

public interface IUserActivityAppService:IApplicationService
{
Task<GetActivitiesDto> GetTwoCaTransactionsAsync(GetTwoCaTransactionRequestDto request);
Task<GetActivitiesDto> GetActivitiesAsync(GetActivitiesRequestDto request);
Task<GetActivityDto> GetActivityAsync(GetActivityRequestDto request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<Orleans_CodeGenInputs Remove="Sample\ISampleAppService.cs" />
<Orleans_CodeGenInputs Remove="Sample\TestDto.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace CAServer.Commons;

public static class AElfContractMethodName
{
public const string GetHolderInfo = "GetHolderInfo";
public const string GetVerifierServers = "GetVerifierServers";
public const string GetBalance = "GetBalance";
public const string ClaimToken = "ClaimToken";
public const string Transfer = "Transfer";
}

This file was deleted.

69 changes: 69 additions & 0 deletions src/CAServer.Application.Contracts/Notify/Dtos/CmsNotifyDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace CAServer.Notify.Dtos;

public class CmsNotifyDto
{
public List<CmsNotify> Data { get; set; }
}

public class CmsNotify
{
public int Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public string AppId { get; set; }
public CmsTargetVersion TargetVersion { get; set; }
public List<CmsAppVersion> AppVersions { get; set; }
public string DownloadUrl { get; set; }
[JsonProperty("date_created")] public DateTime ReleaseTime { get; set; }
public List<CmsDeviceType> DeviceTypes { get; set; }
public List<CmsDeviceBrand> DeviceBrands { get; set; }
public List<CmsOperatingSystemVersion> OperatingSystemVersions { get; set; }
public List<CmsCountry> Countries { get; set; }
public CmsStyleType StyleType { get; set; }
public bool IsForceUpdate { get; set; }
public bool IsApproved { get; set; }
}

public class CmsAppVersion
{
[JsonProperty("appVersion_id")] public CmsValue<string> AppVersion { get; set; }
}

public class CmsCountry
{
[JsonProperty("country_id")] public CmsValue<string> Country { get; set; }
}

public class CmsDeviceBrand
{
[JsonProperty("deviceBrand_id")] public CmsValue<string> DeviceBrand { get; set; }
}

public class CmsDeviceType
{
[JsonProperty("deviceType_id")] public CmsValue<int> DeviceType { get; set; }
}

public class CmsTargetVersion
{
public string Value { get; set; }
}

public class CmsStyleType
{
public int Value { get; set; }
}

public class CmsOperatingSystemVersion
{
[JsonProperty("operatingSystemVersion_id")] public CmsValue<string> OperatingSystemVersion { get; set; }
}

public class CmsValue<T>
{
public T Value { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ public class NotifyBaseDto
public string[] OperatingSystemVersions { get; set; }
public NotifySendType[] SendTypes { get; set; }
[Required] public bool IsForceUpdate { get; set; }
public int NotifyId { get; set; }
public bool IsApproved { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public class PullNotifyDto
public string DeviceBrand { get; set; }
public string OperatingSystemVersion { get; set; }
[Required] public string AppId { get; set; }
public bool IsColdBoot { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public class PullNotifyResultDto
public string TargetVersion { get; set; }
public string DownloadUrl { get; set; }
public bool IsForceUpdate { get; set; }
public StyleType StyleType { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CAServer.Notify.Dtos;

Expand All @@ -10,4 +11,7 @@ public interface INotifyAppService
Task<NotifyResultDto> CreateAsync(CreateNotifyDto notifyDto);
Task<NotifyResultDto> UpdateAsync(Guid id, UpdateNotifyDto notifyDto);
Task DeleteAsync(Guid id);

Task<List<NotifyResultDto>> CreateFromCmsAsync(string version);
Task<NotifyResultDto> UpdateFromCmsAsync(Guid id);
}
1 change: 1 addition & 0 deletions src/CAServer.Application.Contracts/Notify/NotifyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ public class NotifyBase
public string DownloadUrl { get; set; }
public DateTime ReleaseTime { get; set; }
public bool IsForceUpdate { get; set; }
public StyleType StyleType { get; set; }
}
2 changes: 2 additions & 0 deletions src/CAServer.Application.Contracts/Notify/NotifyRulesBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ namespace CAServer.Notify;

public class NotifyRulesBase
{
public int NotifyId { get; set; }
public string AppId { get; set; }
public string[] AppVersions { get; set; }
public string[] DeviceTypes { get; set; }
public string[] DeviceBrands { get; set; }
public string[] OperatingSystemVersions { get; set; }
public string[] Countries { get; set; }
public NotifySendType[] SendTypes { get; set; }
public bool IsApproved { get; set; }
}
Loading