Add tests and implement StubBearer authentication for Signer endpoints
- Created SignerEndpointsTests to validate the SignDsse and VerifyReferrers endpoints. - Implemented StubBearerAuthenticationDefaults and StubBearerAuthenticationHandler for token-based authentication. - Developed ConcelierExporterClient for managing Trivy DB settings and export operations. - Added TrivyDbSettingsPageComponent for UI interactions with Trivy DB settings, including form handling and export triggering. - Implemented styles and HTML structure for Trivy DB settings page. - Created NotifySmokeCheck tool for validating Redis event streams and Notify deliveries.
This commit is contained in:
@@ -5,9 +5,16 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.DependencyInjection\StellaOps.DependencyInjection.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Notify.Engine\StellaOps.Notify.Engine.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Notify.Models\StellaOps.Notify.Models.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.DependencyInjection\StellaOps.DependencyInjection.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Notify.Engine\StellaOps.Notify.Engine.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Notify.Models\StellaOps.Notify.Models.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Notify.Connectors.Shared\StellaOps.Notify.Connectors.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="notify-plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
| ID | Status | Owner(s) | Depends on | Description | Exit Criteria |
|
||||
|----|--------|----------|------------|-------------|---------------|
|
||||
| NOTIFY-CONN-WEBHOOK-15-801 | TODO | Notify Connectors Guild | NOTIFY-ENGINE-15-303 | Implement webhook connector: JSON payload, signature (HMAC/Ed25519), retries/backoff, status code handling. | Integration tests with webhook stub validate signatures, retries, error handling; payload schema documented. |
|
||||
| NOTIFY-CONN-WEBHOOK-15-802 | DOING (2025-10-19) | Notify Connectors Guild | NOTIFY-CONN-WEBHOOK-15-801 | Health/test-send support with signature validation hints and secret management. | Test-send returns success with sample payload; docs include verification guide; secrets never logged. |
|
||||
| NOTIFY-CONN-WEBHOOK-15-803 | TODO | Notify Connectors Guild | NOTIFY-CONN-WEBHOOK-15-802 | Package Webhook connector as restart-time plug-in (manifest + host registration). | Plugin manifest added; host loads connector from `plugins/notify/webhook/`; restart validation passes. |
|
||||
| NOTIFY-CONN-WEBHOOK-15-802 | BLOCKED (2025-10-20) | Notify Connectors Guild | NOTIFY-CONN-WEBHOOK-15-801 | Health/test-send support with signature validation hints and secret management. | Test-send returns success with sample payload; docs include verification guide; secrets never logged. |
|
||||
| NOTIFY-CONN-WEBHOOK-15-803 | DONE (2025-10-20) | Notify Connectors Guild | NOTIFY-CONN-WEBHOOK-15-802 | Package Webhook connector as restart-time plug-in (manifest + host registration). | Plugin manifest added; host loads connector from `plugins/notify/webhook/`; restart validation passes. |
|
||||
|
||||
@@ -48,11 +48,8 @@ public sealed class WebhookChannelTestProvider : INotifyChannelTestProvider
|
||||
ChannelTestPreviewUtilities.ComputeBodyHash(body),
|
||||
context.Request.Attachments);
|
||||
|
||||
var metadata = new Dictionary<string, string>(StringComparer.Ordinal)
|
||||
{
|
||||
["webhook.endpoint"] = context.Target
|
||||
};
|
||||
|
||||
return Task.FromResult(new ChannelTestPreviewResult(preview, metadata));
|
||||
}
|
||||
}
|
||||
var metadata = WebhookMetadataBuilder.Build(context);
|
||||
|
||||
return Task.FromResult(new ChannelTestPreviewResult(preview, metadata));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
using StellaOps.Notify.Connectors.Shared;
|
||||
using StellaOps.Notify.Engine;
|
||||
using StellaOps.Notify.Models;
|
||||
|
||||
namespace StellaOps.Notify.Connectors.Webhook;
|
||||
|
||||
/// <summary>
|
||||
/// Builds metadata for Webhook previews and health diagnostics.
|
||||
/// </summary>
|
||||
internal static class WebhookMetadataBuilder
|
||||
{
|
||||
private const int SecretHashLengthBytes = 8;
|
||||
|
||||
public static ConnectorMetadataBuilder CreateBuilder(ChannelTestPreviewContext context)
|
||||
=> CreateBaseBuilder(
|
||||
channel: context.Channel,
|
||||
target: context.Target,
|
||||
timestamp: context.Timestamp,
|
||||
properties: context.Channel.Config.Properties,
|
||||
secretRef: context.Channel.Config.SecretRef);
|
||||
|
||||
public static ConnectorMetadataBuilder CreateBuilder(ChannelHealthContext context)
|
||||
=> CreateBaseBuilder(
|
||||
channel: context.Channel,
|
||||
target: context.Target,
|
||||
timestamp: context.Timestamp,
|
||||
properties: context.Channel.Config.Properties,
|
||||
secretRef: context.Channel.Config.SecretRef);
|
||||
|
||||
public static IReadOnlyDictionary<string, string> Build(ChannelTestPreviewContext context)
|
||||
=> CreateBuilder(context).Build();
|
||||
|
||||
public static IReadOnlyDictionary<string, string> Build(ChannelHealthContext context)
|
||||
=> CreateBuilder(context).Build();
|
||||
|
||||
private static ConnectorMetadataBuilder CreateBaseBuilder(
|
||||
NotifyChannel channel,
|
||||
string target,
|
||||
DateTimeOffset timestamp,
|
||||
IReadOnlyDictionary<string, string>? properties,
|
||||
string secretRef)
|
||||
{
|
||||
var builder = new ConnectorMetadataBuilder();
|
||||
|
||||
builder.AddTarget("webhook.endpoint", target)
|
||||
.AddTimestamp("webhook.preview.generatedAt", timestamp)
|
||||
.AddSecretRefHash("webhook.secretRef.hash", secretRef, SecretHashLengthBytes)
|
||||
.AddConfigProperties("webhook.config.", properties);
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
18
src/StellaOps.Notify.Connectors.Webhook/notify-plugin.json
Normal file
18
src/StellaOps.Notify.Connectors.Webhook/notify-plugin.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"schemaVersion": "1.0",
|
||||
"id": "stellaops.notify.connector.webhook",
|
||||
"displayName": "StellaOps Webhook Notify Connector",
|
||||
"version": "0.1.0-alpha",
|
||||
"requiresRestart": true,
|
||||
"entryPoint": {
|
||||
"type": "dotnet",
|
||||
"assembly": "StellaOps.Notify.Connectors.Webhook.dll"
|
||||
},
|
||||
"capabilities": [
|
||||
"notify-connector",
|
||||
"webhook"
|
||||
],
|
||||
"metadata": {
|
||||
"org.stellaops.notify.channel.type": "webhook"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user