![]() |
VOOZH | about |
dotnet add package Kephas.Security --version 11.1.0
NuGet\Install-Package Kephas.Security -Version 11.1.0
<PackageReference Include="Kephas.Security" Version="11.1.0" />
<PackageVersion Include="Kephas.Security" Version="11.1.0" />Directory.Packages.props
<PackageReference Include="Kephas.Security" />Project file
paket add Kephas.Security --version 11.1.0
#r "nuget: Kephas.Security, 11.1.0"
#:package Kephas.Security@11.1.0
#addin nuget:?package=Kephas.Security&version=11.1.0Install as a Cake Addin
#tool nuget:?package=Kephas.Security&version=11.1.0Install as a Cake Tool
This package provides abstractions and base building blocks for authentication, authorization, and cryptography.
Packages providing advanced cryptography:
// normally you would get the encryption service injected into the service constructor.
var encryptionService = injector.Resolve<IEncryptionService>();
var encrypted = encryptionService.Encrypt("my-password");
var decrypted = encryptionService.Decrypt(encrypted);
Assert.AreEqual("my-password", decrypted);
The authorization service is used to ensure that a certain context has the required authorization.
This is a singleton application service contract providing a single method:
AuthorizeAsync(authContext: IAuthorizationContext, cancellationToken: CancellationToken = default): Task<bool>An authorization context contains:
IContext): the identity requesting authorization.true): A boolean value indicating whether to throw on authorization failure. If <c>false</c> is indicated, the authorization check will return <c>false</c> upon failure, otherwise an exception will occur.Data must be protected from unauthorized access for different kind of reasons. Kephas brings the required support at multiple levels providing built-in services supporting multiple authorization scenarios.
Permissions are basically string tokens required by certain operations in a given context. Permissions:
Permissions have associated metadata collected by the model space. They may be defined using interfaces with multiple inheritance, or (abstract) classes annotated with [GrantPermission] attributes. To define custom permissions, use the following steps:
[PermissionType("admin")]
public interface IAdminPermission : ICrudPermission, IExportImportPermission
{
}
// alternative way using abstract classes.
[PermissionType("admin")]
[GrantsPermission(typeof(CrudPermission), typeof(ExportImportPermission))]
public abstract class AdminPermission
{
}
[PermissionAssembly] attribute.[assembly: PermissionAssembly("MyApp.Security.Permissions")]
[RequiresPermission] or [SupportsPermission] attributes. Alternatively, such attributes support also permission names (strings), but it is not that safe for refactorings./// <summary>
/// An export hierarchy message.
/// </summary>
[RequiresPermission(typeof(IExportImportPermission))]
public class ExportHierarchyMessage : EntityActionMessage
{
/// <summary>
/// Gets or sets the export media type to use.
/// </summary>
/// <value>
/// The export media type.
/// </value>
public string MediaType { get; set; }
}
Note: It may be more practical to use interfaces, because this way the inheritance hierarchy can be displayed in a class diagram. Anyway, the interface inheritance model and the grants model can be combined, having the same effect.
Permissions may indicate a certain application scope. This can be:
Global: No scoping required for this permission type, it will be granted and verified at global level.Type: The scope for this permission is the entity type.Instance: The scope for this permission is the entity instance.These values are flags which can be combined to provide multiple supported scenarios for a specific permission type.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Kephas.Security:
| Package | Downloads |
|---|---|
|
Kephas.Core
Aggregates the most used Kephas infrastructure to provide a . Typically used areas and classes/interfaces/services: - AmbientServices - Data: IIdGenerator, DefaultIdGenerator. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems. |
|
|
Kephas.Mail
Provides the abstract infrastructure for mailing. Typically used areas and classes/interfaces/services: - IEmailMessage, IEmailAddress, IEmailAttachment - Services: IEmailSenderService, ISystemEmailSenderService. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems. |
|
|
Kephas.Security.Permissions
Provides an infrastructure for permissions. Typically used areas and classes/interfaces/services: - IPermissionService. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems. |
|
|
Kephas.Application.Abstractions
Provides abstractions for the application infrastructure. Typically used areas and classes/interfaces/services: - Application management: IAppRuntime, StaticAppRuntime, DynamicAppRuntime, IAppLifecyclebehavior, AppIdentity. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems. |
|
|
Kephas.Security.Cryptography
Provides implementations for the cryptographic services. Typically used areas and classes/interfaces/services: - AesEncryptionService. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.1.0 | 20,069 | 4/13/2022 |
| 11.1.0-dev.4 | 351 | 4/6/2022 |
| 11.1.0-dev.3 | 317 | 3/30/2022 |
| 11.1.0-dev.2 | 313 | 3/23/2022 |
| 11.1.0-dev.1 | 294 | 3/23/2022 |
| 11.0.0 | 18,136 | 3/11/2022 |
| 11.0.0-dev.7 | 304 | 3/7/2022 |
| 11.0.0-dev.6 | 325 | 2/28/2022 |
| 11.0.0-dev.5 | 316 | 2/26/2022 |
| 11.0.0-dev.4 | 322 | 2/24/2022 |
| 11.0.0-dev.3 | 295 | 2/23/2022 |
| 11.0.0-dev.2 | 324 | 2/18/2022 |
| 11.0.0-dev.1 | 309 | 2/7/2022 |
| 10.3.0 | 17,390 | 1/18/2022 |
| 10.2.0 | 10,771 | 12/3/2021 |
| 10.1.0 | 15,010 | 11/23/2021 |
| 10.1.0-dev.7 | 372 | 11/17/2021 |
| 10.1.0-dev.6 | 337 | 11/16/2021 |
| 10.1.0-dev.5 | 355 | 11/10/2021 |
| 10.1.0-dev.4 | 358 | 11/8/2021 |
Please check https://github.com/kephas-software/kephas/releases for the change log.
Also check the documentation and the samples from https://github.com/kephas-software/kephas/wiki and https://github.com/kephas-software/kephas/tree/master/Samples.