
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Provides abstractions for the security infrastructure. Typically used areas and classes/interfaces/services: - Authentication: IAuthenticationService. - Authorization: IAuthorizationService. - Cryptography: IEncryptionService, IHashingService. - Permissions: IPermissionInfo. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems.
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 false is indicated, the authorization check will return false 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.
FAQs
Provides abstractions for the security infrastructure. Typically used areas and classes/interfaces/services: - Authentication: IAuthenticationService. - Authorization: IAuthorizationService. - Cryptography: IEncryptionService, IHashingService. - Permissions: IPermissionInfo. Kephas Framework ("stone" in aramaic) aims to deliver a solid infrastructure for applications and application ecosystems.
We found that kephas.security demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.