🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

zaria.ai.aspnetcore

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

zaria.ai.aspnetcore

1.1.0
unpublished
Maintainers
0

Release 1.0.0 Notes

The package provides built-in support for using Zaria.AI in AspNetCore web applications. Added helper funcitons to IApplicationBuilder and IServiceCollection. With these, Zaria.AI can be used in WebApi applications in the same manner as console. To leverage Zaria.AI add the following calls during application statup.

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddZaria();

 //other boilerplate web api stuff would go here

 app.UseZaria();
 app.Run();

The UseZaria method can optionally accept a string representing the root path that will trigger Zaria functionality (by default this is /zaria). So zaria would be triggered for

http://some host/zaria/echo "hello world"

which would show in the address bar as:

http://some host/zaria/echo%20"hello%20world"

If app.UseZaria("sampler") is used then the correct url to trigger it would be:

http://some host/sampler/echo "hello world"

AddZaria can optionally accept a delegate that allows you to configure the processor as needed. The following sample illustrtes loading remote patterns into the processor.

 // Add services to the container.
builder.Services.AddZaria(processor =>
{
    processor.ScanReferencedAssembly<MyAssemblyIdentifier>();
    processor.LoadRemotePatternRepository("""
                {
                "Patterns": [
                {
                    "Pattern": "you dey craze1",
                    "HandlerURI": "http://localhost:5227/zaria/echo 888",
                    "Method": "get"
                },
                {
                    "Pattern": "you dey mad2",
                    "HandlerURI": "http://localhost:5227/zaria/echo 999",
                    "Method": "get"
                }
                ]
            }
            """);
});

FAQs

Did you know?

Socket

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.

Install

Related posts