0.9.0
Compatibility
| Compatible with | All Buffer, Broker, Storage, Auth, and Host plugins |
| Product | Notiway Notify |
Installation
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
Infra__Plugins__TenantValidation__Name | Yes | — | Set to Http |
Infra__Plugins__TenantValidation__Version | Yes | — | Plugin version (e.g., 0.9.0) |
Infra__Plugins__TenantValidation__Config__ValidationEndpoint | Yes | — | URL of the HTTP endpoint to call for tenant validation (e.g., https://api.example.com/validate-tenant) |
Infrastructure
- Deploy an HTTP validation endpoint that is accessible from the Notiway instance.
- The endpoint must accept POST requests with user and tenant information and respond with
200 OK(allow) or403 Forbidden(reject).
Docker Compose
docker-compose.yml
services:
notiway:
image: notiway/notify:portable-0.5.0
ports:
- "5000:8080"
environment:
- Infra__Plugins__TenantValidation__Name=Http
- Infra__Plugins__TenantValidation__Version=0.9.0
- Infra__Plugins__TenantValidation__Config__ValidationEndpoint=https://api.example.com/validate-tenantUsage
Implement a validation endpoint in your backend that checks whether a user belongs to the requested tenant. Return 200 OK to allow the subscription or 403 Forbidden to reject it.
app.MapPost("/validate-tenant", (HttpRequest request) =>
{
var userId = request.Query["userId"];
var tenantId = request.Query["tenantId"];
var isMember = CheckTenantMembership(userId, tenantId);
return isMember ? Results.Ok() : Results.Forbid();
});app.post("/validate-tenant", (req, res) => {
const { userId, tenantId } = req.query;
const isMember = checkTenantMembership(userId, tenantId);
res.sendStatus(isMember ? 200 : 403);
});@app.post("/validate-tenant")
def validate_tenant(userId: str, tenantId: str):
is_member = check_tenant_membership(userId, tenantId)
if is_member:
return Response(status_code=200)
return Response(status_code=403)