# TraconWebhookOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconwebhookoptions/
> Summary: TraconWebhookOptions: Event publishing (webhook) settings.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Core.dll</code></div>

Event publishing (webhook) settings.

```csharp
public sealed class TraconWebhookOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconwebhookoptions/">TraconWebhookOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

Read from the `Tracon:Webhooks` configuration section.

## Constructors

### <a id="Tracon_TraconWebhookOptions__ctor"></a> TraconWebhookOptions\(\)

```csharp
public TraconWebhookOptions()
```

## Fields

### <a id="Tracon_TraconWebhookOptions_SectionName"></a> SectionName

The configuration section name.

```csharp
public const string SectionName = "Tracon:Webhooks"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconWebhookOptions_AllowInsecureHttp"></a> AllowInsecureHttp

Whether unencrypted `http` targets are allowed. Even when
allowed, only **loopback** addresses are accepted.

```csharp
public bool AllowInsecureHttp { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

Needed to test a listener in local development. The loopback
restriction is not lifted: sending an unencrypted event to a
publicly reachable address would expose the event's content to the network.

### <a id="Tracon_TraconWebhookOptions_AllowPrivateNetworkTargets"></a> AllowPrivateNetworkTargets

Whether delivery to private network addresses is allowed.
**Disabled by default.**

```csharp
public bool AllowPrivateNetworkTargets { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

Enabling this opens up an SSRF surface: the server becomes able to
send requests to any service on the internal network, and to the
cloud metadata endpoint (`169.254.169.254`). It should only be
enabled deliberately, on a closed network.

### <a id="Tracon_TraconWebhookOptions_AllowedConfigurationPrefix"></a> AllowedConfigurationPrefix

Gets or sets the only prefix under which a subscription may reference a
configuration key: its signing secret and every entry of its
`headerConfigurationKeys`. Default is `"Tracon:WebhookSecrets:"`.

```csharp
public string AllowedConfigurationPrefix { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Remarks

A security boundary, not a convenience default — the same reason as
[TraconTenantProviderOptions.AllowedConfigurationPrefix](/api/tracon.tracontenantprovideroptions/#Tracon_TraconTenantProviderOptions_AllowedConfigurationPrefix).
Without it, a subscription could name an unrelated configuration key as
its "signing secret" and Tracon would sign deliveries with a value
that was never meant to leave the process.

### <a id="Tracon_TraconWebhookOptions_DisableAfterConsecutiveFailures"></a> DisableAfterConsecutiveFailures

If a subscription fails this many times in a row, it is automatically
disabled and the event is written to the audit trail.

```csharp
public int DisableAfterConsecutiveFailures { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconWebhookOptions_Enabled"></a> Enabled

Whether event publishing is enabled. While disabled, a subscription
can be registered, but no event is written to the queue.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_TraconWebhookOptions_MaxExtraHeaders"></a> MaxExtraHeaders

Gets or sets how many extra headers a subscription may add to a
delivery, plain `headers` and `headerConfigurationKeys`
together. Default 20.

```csharp
public int MaxExtraHeaders { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

Extra headers are administrator input and travel on every delivery. A
save over the limit is rejected with `400`; a stored subscription
over it (saved before the rule, or by another store) sends the headers
read from configuration first, so the limit only cuts plain headers.
Headers whose name Tracon sets itself are always dropped, whatever
this limit is.

### <a id="Tracon_TraconWebhookOptions_MaxResponseBytes"></a> MaxResponseBytes

The maximum bytes read from the recipient's response body.

```csharp
public int MaxResponseBytes { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

The response body is kept only for diagnostics. Reading it without a
limit would let a malicious recipient exhaust memory.

### <a id="Tracon_TraconWebhookOptions_RetryDelays"></a> RetryDelays

The retry ladder. The list's length is also the maximum number of attempts.

```csharp
public IList<TimeSpan> RetryDelays { get; }
```

#### Property Value

 [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist\-1)<[TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)\>

#### Remarks

This ladder is handed to the queue through
`ReleaseForRetryAsync(retryAfter)`; a second queue or scheduler
is not written.

In configuration, a list (`RetryDelays:0 = "00:01:00"`) that replaces the
default. Each delay must be greater than zero: a delay of zero or below, or
one that is not a [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan), stops the application at startup
with an `Options.OptionsValidationException`
that names `RetryDelays` and quotes the entry as written. Such an entry
used to be dropped without a word.

### <a id="Tracon_TraconWebhookOptions_SignatureTolerance"></a> SignatureTolerance

The signature timestamp tolerance the recipient should accept. This is
the value recommended to the recipient in the README; Tracon only documents it.

```csharp
public TimeSpan SignatureTolerance { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

### <a id="Tracon_TraconWebhookOptions_Timeout"></a> Timeout

The timeout for a single delivery attempt.

```csharp
public TimeSpan Timeout { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

Covers the **whole** attempt: opening the connection,
sending the payload, and reading the recipient's response body up to
[TraconWebhookOptions.MaxResponseBytes](/api/tracon.traconwebhookoptions/#Tracon_TraconWebhookOptions_MaxResponseBytes). A recipient that answers its headers
quickly and then stalls on the body is cut off at the same deadline.
Must be from one millisecond to about 49.7 days; any other value fails at
startup.
