-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from EasyAbp/3rd-party-services-tokens
Third party platform services and tokens management
- Loading branch information
Showing
69 changed files
with
688 additions
and
990 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
....OpenPlatform.HttpApi/Handlers/TicketRecordingWeChatThirdPartyPlatformAuthEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.ThirdPartyPlatform; | ||
using EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.ThirdPartyPlatform.VerifyTicket; | ||
|
||
namespace EasyAbp.Abp.WeChat.OpenPlatform.Handlers; | ||
|
||
public class TicketRecordingWeChatThirdPartyPlatformAuthEventHandler : IWeChatThirdPartyPlatformAuthEventHandler | ||
{ | ||
public string InfoType => WeChatThirdPartyPlatformAuthEventInfoTypes.ComponentVerifyTicket; | ||
|
||
private readonly IComponentVerifyTicketStore _componentVerifyTicketStore; | ||
|
||
public TicketRecordingWeChatThirdPartyPlatformAuthEventHandler( | ||
IComponentVerifyTicketStore componentVerifyTicketStore) | ||
{ | ||
_componentVerifyTicketStore = componentVerifyTicketStore; | ||
} | ||
|
||
public virtual async Task HandleAsync(WeChatThirdPartyPlatformAuthEventHandlerContext context) | ||
{ | ||
if (context.Model.ComponentVerifyTicket.IsNullOrWhiteSpace()) | ||
{ | ||
return; | ||
} | ||
|
||
await _componentVerifyTicketStore.SetAsync(context.Model.AppId, context.Model.ComponentVerifyTicket); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...nPlatform/AbpWeChatOpenPlatformOptions.cs → ...orm/AbpWeChatThirdPartyPlatformOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
...OpenPlatform/EasyAbp.Abp.WeChat.OpenPlatform/Infrastructure/DefaultAccessTokenAccessor.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
src/OpenPlatform/EasyAbp.Abp.WeChat.OpenPlatform/Infrastructure/IAccessTokenAccessor.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
....WeChat.OpenPlatform/Infrastructure/Models/ThirdPartyPlatform/ApiComponentTokenRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.Models.ThirdPartyPlatform; | ||
|
||
public class ApiComponentTokenRequest : OpenPlatformCommonRequest | ||
{ | ||
[JsonProperty("component_appid")] | ||
public string ComponentAppId { get; set; } | ||
|
||
[JsonProperty("component_appsecret")] | ||
public string ComponentAppSecret { get; set; } | ||
|
||
[JsonProperty("component_verify_ticket")] | ||
public string ComponentVerifyTicket { get; set; } | ||
} |
12 changes: 12 additions & 0 deletions
12
...WeChat.OpenPlatform/Infrastructure/Models/ThirdPartyPlatform/ApiComponentTokenResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.Models.ThirdPartyPlatform; | ||
|
||
public class ApiComponentTokenResponse : OpenPlatformCommonResponse | ||
{ | ||
[JsonProperty("component_access_token")] | ||
public string ComponentAccessToken { get; set; } | ||
|
||
[JsonProperty("expires_in")] | ||
public int ExpiresIn { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...bp.WeChat.OpenPlatform/Infrastructure/Models/ThirdPartyPlatform/AuthorizerTokenRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.Models.ThirdPartyPlatform; | ||
|
||
public class AuthorizerTokenRequest : OpenPlatformCommonRequest | ||
{ | ||
[JsonProperty("component_appid")] | ||
public string ComponentAppId { get; set; } | ||
|
||
[JsonProperty("authorizer_appid")] | ||
public string AuthorizerAppId { get; set; } | ||
|
||
[JsonProperty("authorizer_refresh_token")] | ||
public string AuthorizerRefreshToken { get; set; } | ||
} |
15 changes: 15 additions & 0 deletions
15
...p.WeChat.OpenPlatform/Infrastructure/Models/ThirdPartyPlatform/AuthorizerTokenResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace EasyAbp.Abp.WeChat.OpenPlatform.Infrastructure.Models.ThirdPartyPlatform; | ||
|
||
public class AuthorizerTokenResponse : OpenPlatformCommonResponse | ||
{ | ||
[JsonProperty("authorizer_access_token")] | ||
public string AuthorizerAccessToken { get; set; } | ||
|
||
[JsonProperty("expires_in")] | ||
public int ExpiresIn { get; set; } | ||
|
||
[JsonProperty("authorizer_refresh_token")] | ||
public string AuthorizerRefreshToken { get; set; } | ||
} |
18 changes: 0 additions & 18 deletions
18
....WeChat.OpenPlatform/Infrastructure/OptionsResolve/AbpWeChatOpenPlatformResolveOptions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.