HopFrame.Security
1.1.0
See the version list below for details.
dotnet add package HopFrame.Security --version 1.1.0
NuGet\Install-Package HopFrame.Security -Version 1.1.0
<PackageReference Include="HopFrame.Security" Version="1.1.0" />
paket add HopFrame.Security --version 1.1.0
#r "nuget: HopFrame.Security, 1.1.0"
// Install HopFrame.Security as a Cake Addin #addin nuget:?package=HopFrame.Security&version=1.1.0 // Install HopFrame.Security as a Cake Tool #tool nuget:?package=HopFrame.Security&version=1.1.0
HopFrame Security module
this module contains all handlers for the login and register validation. It also checks the user permissions.
Services added in this module
You can use these services by specifying them as a dependency. All of them are scoped dependencies.
ITokenContext
This service provides the information given by the current request
public interface ITokenContext {
bool IsAuthenticated { get; }
User User { get; }
Guid AccessToken { get; }
}
IUserService
This service simplifies the data access of the user table in the database.
public interface IUserService {
Task<IList<User>> GetUsers();
Task<User> GetUser(Guid userId);
Task<User> GetUserByEmail(string email);
Task<User> GetUserByUsername(string username);
Task<User> AddUser(UserRegister user);
Task UpdateUser(User user);
Task DeleteUser(User user);
Task<bool> CheckUserPassword(User user, string password);
Task ChangePassword(User user, string password);
}
IPermissionService
This service handles all permission and group interactions with the data source.
public interface IPermissionService {
Task<bool> HasPermission(string permission, Guid user);
Task<IList<PermissionGroup>> GetPermissionGroups();
Task<PermissionGroup> GetPermissionGroup(string name);
Task EditPermissionGroup(PermissionGroup group);
Task<IList<PermissionGroup>> GetUserPermissionGroups(User user);
Task RemoveGroupFromUser(User user, PermissionGroup group);
Task<PermissionGroup> CreatePermissionGroup(string name, bool isDefault = false, string description = null);
Task DeletePermissionGroup(PermissionGroup group);
Task<Permission> GetPermission(string name, IPermissionOwner owner);
Task AddPermission(IPermissionOwner owner, string permission);
Task RemovePermission(Permission permission);
Task<string[]> GetFullPermissions(string user);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- HopFrame.Database (>= 1.1.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.7)
- Microsoft.Extensions.Options (>= 8.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on HopFrame.Security:
Package | Downloads |
---|---|
HopFrame.Api
Package Description |
|
HopFrame.Web
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.