Initial Commit ...
This commit is contained in:
@@ -0,0 +1,283 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using IdentityModel.Client;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using RestSharp;
|
||||
using xHttpService.Constants;
|
||||
using xIdentityModels.Constants;
|
||||
using xIdentityModels.Dtos;
|
||||
using xIdentityModels.Models;
|
||||
using xIdentityModels.Navigations;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xIdentityService.Interfaces {
|
||||
public partial interface IXIdentityProvider {
|
||||
//
|
||||
string BaseUrl { get; }
|
||||
string RevisionSecretKey { get; }
|
||||
|
||||
//
|
||||
#region Tools ...
|
||||
string GetUserSelectByParam (
|
||||
XActionRequest model,
|
||||
bool forceNotNull = true,
|
||||
ICollection<XUserSelectBy> excludes = null
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Tools ...
|
||||
Task<T> RunRestRequest<T> (
|
||||
RestClient client,
|
||||
RestRequest request,
|
||||
XHttpMethod method,
|
||||
bool supportRefreshingTokens = false
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Authentication ...
|
||||
Task<DiscoveryDocumentResponse> RequestDiscoveryDocument ();
|
||||
Task<XTokenResponse> RequestScopeAccessToken (string scope);
|
||||
Task<TokenIntrospectionResponse> Introspection (XTokenResponse model);
|
||||
Task<XLoginResponse> Login (XLoginRequest model);
|
||||
Task Logout (XTokenResponse model);
|
||||
Task<XTokenResponse> Authenticate (XLoginRequest model);
|
||||
Task<XTokenResponse> RefreshTokens (XTokenResponse model);
|
||||
|
||||
Task ChangePassword (
|
||||
XTokenResponse tokens,
|
||||
XActionRequest model
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Profile ...
|
||||
Task<IEnumerable<string>> GetUserNames (
|
||||
XTokenResponse tokens,
|
||||
string userIds
|
||||
);
|
||||
|
||||
Task<IEnumerable<XUserNameIdResponse>> GetUserNameIds (
|
||||
XTokenResponse tokens,
|
||||
XUserNameIdRequest model
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> GetUserProfile (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam
|
||||
);
|
||||
|
||||
Task<XQueryResult<XUserProfileDto>> QueryUsers (
|
||||
XTokenResponse tokens,
|
||||
XQuery query
|
||||
);
|
||||
|
||||
Task<XQueryResult<XUserProfileDto>> QueryInRoleUsers (
|
||||
XTokenResponse tokens,
|
||||
string role,
|
||||
XQuery query,
|
||||
bool forceRole = false
|
||||
);
|
||||
|
||||
Task<XQueryResult<XProfileImage>> QueryAvatars (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam,
|
||||
XQuery query
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> ProfileUpdateAsync (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam,
|
||||
XProfileUpdateRequest model
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> FullProfileUpdateAsync (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam,
|
||||
XProfileUpdateRequest request
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> AddAvatar (
|
||||
XTokenResponse tokens,
|
||||
IFormFile file
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> AddAvatars (
|
||||
XTokenResponse tokens,
|
||||
IFormFileCollection files
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> SetAvatar (
|
||||
XTokenResponse tokens,
|
||||
int avatarId
|
||||
);
|
||||
|
||||
Task<XUserProfileDto> RemoveAvatars (
|
||||
XTokenResponse tokens,
|
||||
string avatarIds
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Registration ...
|
||||
Task<bool> CanRegister (string userSelectByParam);
|
||||
|
||||
Task<XActionResponse> InviteUser (
|
||||
XTokenResponse tokens,
|
||||
XActionRequest model
|
||||
);
|
||||
|
||||
Task<XActionResponse> RequestRegistration (
|
||||
XActionRequest model
|
||||
);
|
||||
|
||||
Task<XActionResponse> AddAccountInfo (
|
||||
XActionRequest model
|
||||
);
|
||||
|
||||
Task<XActionResponse> AttachProfileImage (
|
||||
string actionToken,
|
||||
IFormFile file
|
||||
);
|
||||
|
||||
Task FinishRegistration (XActionRequest model);
|
||||
|
||||
Task<bool> IsConfirmedEmail (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam
|
||||
);
|
||||
|
||||
Task<bool> IsConfirmedMobile (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam
|
||||
);
|
||||
|
||||
Task RequestConfirmRegistration (XActionRequest model);
|
||||
|
||||
Task ConfirmRegistration (
|
||||
XActionRequest model
|
||||
);
|
||||
|
||||
Task<XActionResponse> RequestConfirmMobile (XActionRequest model);
|
||||
|
||||
Task<XActionResponse> ConfirmMobileNumber (XActionRequest model);
|
||||
|
||||
Task<XActionResponse> RequestConfirmEmail (XActionRequest model);
|
||||
|
||||
Task<XActionResponse> ConfirmEmailAddress (XActionRequest model);
|
||||
|
||||
Task<XActionResponse> RequestResetPassword (XActionRequest model);
|
||||
|
||||
Task ResetPassword (XActionRequest model);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Friendship ...
|
||||
Task<XFriendshipFollowing> Follow (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<bool> Cancel (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task UnFollowFollower (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task UnFollowFollowing (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollowing> Block (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollowing> UnBlock (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollower> AcceptRequest (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollower> RejectRequest (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<bool> IsFollower (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollower> GetFollower (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipState> GetFollowerState (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<IEnumerable<XFriendshipFollower>> GetFollowers (XTokenResponse tokens);
|
||||
|
||||
Task<IEnumerable<XFriendshipFollower>> GetAllFollowers (XTokenResponse tokens);
|
||||
|
||||
Task<bool> IsFollowing (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipFollowing> GetFollowing (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<XFriendshipState> GetFollowingState (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
|
||||
Task<IEnumerable<XFriendshipFollowing>> GetFollowings (XTokenResponse tokens);
|
||||
|
||||
Task<IEnumerable<XFriendshipFollowing>> GetAllFollowings (XTokenResponse tokens);
|
||||
|
||||
Task<IEnumerable<string>> GetFollowingList (XTokenResponse tokens);
|
||||
|
||||
Task<IEnumerable<string>> GetFollowersList (XTokenResponse tokens);
|
||||
|
||||
Task<XFriendshipInfoDto> GetFriendshipInfo (
|
||||
XTokenResponse tokens,
|
||||
string destUser
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Admin ...
|
||||
Task<IEnumerable<string>> Ban (
|
||||
XTokenResponse tokens,
|
||||
XUserNameIdRequest model
|
||||
);
|
||||
|
||||
Task<IEnumerable<string>> UnBan (
|
||||
XTokenResponse tokens,
|
||||
XUserNameIdRequest model
|
||||
);
|
||||
|
||||
Task<bool> IsBanned (
|
||||
XTokenResponse tokens,
|
||||
string userSelectByParam
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using xIdentityService.Configuration;
|
||||
|
||||
namespace xIdentityService.Interfaces {
|
||||
public interface IXProxyHelper {
|
||||
/// <summary>
|
||||
/// Proxy Configuration ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
XProxyConfiguration Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// retrie Normalize Host ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string NormalizeHost ();
|
||||
|
||||
/// <summary>
|
||||
/// Validate XProxy Configuration for Client ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool ValidateConfiguration ();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve all Prepared url of Routes ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<string> GetRouteUrls ();
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all registred Routes ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<XProxyRouteDescriptor> GetRoutes ();
|
||||
|
||||
/// <summary>
|
||||
/// Prepare a request url for a Proxy Route ...
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="descriptor"></param>
|
||||
/// <returns></returns>
|
||||
string PrepareActionUrlForXProxyRoute (
|
||||
string url,
|
||||
XProxyRouteDescriptor descriptor
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Prepare a request url for a Selected Proxy Route ...
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <returns></returns>
|
||||
string PrepareActionUrlForXProxyRoute (
|
||||
string url,
|
||||
Expression<Func<XProxyRouteDescriptor, bool>> whereClause
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Find an Specific Route ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <returns></returns>
|
||||
XProxyRouteDescriptor FindRoute (Expression<Func<XProxyRouteDescriptor, bool>> whereClause);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace xIdentityService.Interfaces
|
||||
{
|
||||
public partial interface IXSecurityProvider
|
||||
{
|
||||
string Encrypt(string plainText);
|
||||
string Decrypt(string cipherText);
|
||||
string EncryptFromBytes(byte[] textBytes);
|
||||
string DecryptFromBytes(byte[] cipherBytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Threading.Tasks;
|
||||
using xIdentityModels.Models;
|
||||
|
||||
namespace xIdentityService.Interfaces {
|
||||
public partial interface IXTokenProvider {
|
||||
Task<bool> IsTokenExists (string accessToken);
|
||||
Task<bool> IsTokenExists (XTokenResponse tokens);
|
||||
Task<bool> RemoveToken (string accessToken);
|
||||
Task<bool> RemoveToken (XTokenResponse tokens);
|
||||
Task<XTokenResponse> RetrieveToken (string accessToken);
|
||||
Task<bool> AddToken (XTokenResponse tokens);
|
||||
Task<bool> UpdateToken (XTokenResponse tokens);
|
||||
Task<bool> AddOrUpdateToken (XTokenResponse tokens);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user