Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<VersionPrefix>2026.1.1</VersionPrefix>
<VersionPrefix>2026.2.0</VersionPrefix>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
8 changes: 4 additions & 4 deletions example/SeqEnableAAD/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ static async Task Run(string server, string? username, string? tenantId, string?

var user = await connection.Users.FindCurrentAsync();
var provider = await connection.Settings.FindNamedAsync(SettingName.AuthenticationProvider);
var cid = await connection.Settings.FindNamedAsync(SettingName.EntraIDClientId);
var ckey = await connection.Settings.FindNamedAsync(SettingName.EntraIDClientKey);
var aut = await connection.Settings.FindNamedAsync(SettingName.EntraIDAuthority);
var tid = await connection.Settings.FindNamedAsync(SettingName.EntraIDTenantId);
var cid = await connection.Settings.FindNamedAsync(SettingName.EntraIdClientId);
var ckey = await connection.Settings.FindNamedAsync(SettingName.EntraIdClientKey);
var aut = await connection.Settings.FindNamedAsync(SettingName.EntraIdAuthority);
var tid = await connection.Settings.FindNamedAsync(SettingName.EntraIdTenantId);

user.Username = username;
provider.Value = "Microsoft Entra ID";
Expand Down
2 changes: 1 addition & 1 deletion src/Seq.Api/Client/SeqApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed class SeqApiClient : IDisposable
// Future versions of Seq may not completely support vN-1 features, however
// providing this as an Accept header will ensure what compatibility is available
// can be utilized.
const string SeqApiVersionedMediaType = "application/vnd.datalust.seq.v14+json";
const string SeqApiVersionedMediaType = "application/vnd.datalust.seq.v15+json";
const string ApiKeyHeaderName = "X-Seq-ApiKey";
const string CsrfTokenHeaderName = "X-Seq-CsrfToken";

Expand Down
6 changes: 6 additions & 0 deletions src/Seq.Api/Model/Events/EventEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public class EventEntity : Entity
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string SpanKind { get; set; }

/// <summary>
/// If the event is a span, any links it carries.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public List<object> SpanLinks { get; set; }

/// <summary>
/// A collection of properties describing the origin of the event, if any. These correspond to resource
Expand Down
5 changes: 5 additions & 0 deletions src/Seq.Api/Model/Indexes/IndexEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@ public class IndexEntity: Entity
/// The storage used by this index.
/// </summary>
public ulong StorageBytes { get; set; }

/// <summary>
/// If the last attempt at indexing failed to build this index.
/// </summary>
public bool IsIndexingFailing { get; set; }
}
}
33 changes: 33 additions & 0 deletions src/Seq.Api/Model/Settings/AuthenticationSettingsTestResultPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright © Datalust and contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Seq.Api.Model.Settings
{
/// <summary>
/// The outcome of testing proposed authentication settings.
/// </summary>
public class AuthenticationSettingsTestResultPart
{
/// <summary>
/// If <c>true</c>, the settings passed testing. Some aspects of the configuration can only be verified
/// by signing in, so passing does not guarantee that sign-in will work.
/// </summary>
public bool Passed { get; set; }

/// <summary>
/// If the test failed, a human-readable description of the problem.
/// </summary>
public string Error { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Seq.Api/Model/Settings/SettingEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,19 @@ public class SettingEntity : Entity
/// The value of the setting.
/// </summary>
public object Value { get; set; }

/// <summary>
/// Indicates that the setting has a value, even when the server redacts that value and
/// returns it as <c>null</c> (the case for passwords and similar secrets). Ignored when
/// saving values: <c>null</c> will always clear a setting, irrespective of the value sent
/// for this property.
/// </summary>
public bool HasValue { get; set; }

/// <summary>
/// Indicates that the setting's value is overridden in the server's configuration, and can't be changed through
/// the API. Ignored when saving values.
/// </summary>
public bool IsReadOnly { get; set; }
}
}
93 changes: 83 additions & 10 deletions src/Seq.Api/Model/Settings/SettingName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,64 @@ public enum SettingName
DataAgeWarningThresholdMilliseconds,

/// <summary>
/// The Microsoft Entra ID authority. The default is <c>login.windows.net</c>; government cloud users may
/// The Microsoft Entra ID authority. The default is <c>login.microsoftonline.com</c>; government cloud users may
/// require <c>login.microsoftonline.us</c> or similar.
/// </summary>
// ReSharper disable once InconsistentNaming
EntraIDAuthority,
EntraIdAuthority,

/// <summary>
/// The Microsoft Entra ID client id.
/// </summary>
// ReSharper disable once InconsistentNaming
EntraIDClientId,
EntraIdClientId,

/// <summary>
/// The Microsoft Entra ID client key.
/// </summary>
// ReSharper disable once InconsistentNaming
EntraIDClientKey,
EntraIdClientKey,

/// <summary>
/// The Microsoft Entra ID tenant id.
/// </summary>
// ReSharper disable once InconsistentNaming
EntraIDTenantId,
EntraIdTenantId,

/// <summary>
/// The Microsoft Entra ID credential source type. By default (<c>ClientSecret</c>), a client key (client
/// secret) is expected in <see cref="EntraIdClientKey"/>. Specify <c>SignedAssertionFromManagedIdentity</c>
/// and, optionally, a value for <see cref="EntraIdManagedIdentityClientId"/> to authenticate using a
/// managed identity instead. If no <see cref="EntraIdManagedIdentityClientId"/> is specified, the
/// system-assigned managed identity is used. Specify <c>SignedAssertionFile</c> to authenticate using
/// a signed assertion (for example, a Kubernetes projected service account token) read from the file named
/// by the <c>AZURE_FEDERATED_TOKEN_FILE</c> environment variable; the file is re-read on each sign-in so
/// that rotated tokens are picked up. Specify <c>CertificateFile</c> to authenticate using a client
/// certificate and private key from the Seq server's certificates folder.
/// Specify <c>CertificateThumbprint</c> or <c>CertificateSubject</c> to authenticate using a client
/// certificate identified by <see cref="EntraIdClientCertificateThumbprint"/> or
/// <see cref="EntraIdClientCertificateSubject"/>, respectively; these options are only supported on Windows.
/// </summary>
EntraIdCredentialType,

/// <summary>
/// The client id of the user-assigned managed identity that the app registration's federated identity
/// credential trusts. Considered only when <see cref="EntraIdCredentialType"/> is
/// <c>SignedAssertionFromManagedIdentity</c>.
/// </summary>
EntraIdManagedIdentityClientId,

/// <summary>
/// The SHA-1 thumbprint of a client certificate, with private key, in the <c>LocalMachine</c> or
/// <c>CurrentUser</c> Personal (<c>My</c>) Windows certificate store. Considered only when
/// <see cref="EntraIdCredentialType"/> is <c>CertificateThumbprint</c>.
/// </summary>
EntraIdClientCertificateThumbprint,

/// <summary>
/// The subject common name, or full distinguished name, of a client certificate in the
/// <c>LocalMachine</c> or <c>CurrentUser</c> Personal (<c>My</c>) Windows certificate store. The newest
/// currently-valid matching certificate with a private key is used, so that rolled-over certificates are
/// picked up automatically. Considered only when <see cref="EntraIdCredentialType"/> is
/// <c>CertificateSubject</c>.
/// </summary>
EntraIdClientCertificateSubject,

/// <summary>
/// Server-local filesystem location where automatic backups are stored.
Expand Down Expand Up @@ -131,6 +166,11 @@ public enum SettingName
/// Seq will stop accepting new events.
/// </summary>
MinimumFreeStorageSpace,

/// <summary>
/// The minimum length of passwords for local username/password authentication.
/// </summary>
MinimumPasswordLength,

/// <summary>
/// A dictionary of `(string, string)` pairs that will be used to initialize the
Expand Down Expand Up @@ -192,11 +232,23 @@ public enum SettingName
/// list. For example, <c>openid, profile, email</c>.
/// </summary>
OpenIdConnectScopes,

/// <summary>
/// If using OpenID Connect, the URI that the provider will redirect to after the user signs out.
/// </summary>
OpenIdConnectEndSessionRedirectUri,

/// <summary>
/// If using OpenID Connect, overrides the URI of the provider's metadata endpoint.
/// </summary>
OpenIdConnectMetadataAddress,

/// <summary>
/// The character classes that local username/password authentication passwords must include, as a string
/// containing any of <c>a</c> (lowercase letter), <c>A</c> (uppercase letter), <c>0</c> (digit), and
/// <c>!</c> (punctuation).
/// </summary>
PasswordRequiredCharacterClasses,

/// <summary>
/// If <c>true</c>, ingestion requests incoming via HTTP must be authenticated using an API key or
Expand All @@ -214,6 +266,22 @@ public enum SettingName
/// </summary>
RawPayloadMaximumContentLength,

/// <summary>
/// If <c>true</c>, the SCIM 2.0 user provisioning endpoints under <c>/scim/v2</c> are enabled. Only
/// effective when <see cref="IsAuthenticationEnabled"/> is <c>true</c>.
/// </summary>
ScimEnabled,

/// <summary>
/// The default duration, in seconds, that searches will cover.
/// </summary>
SearchDurationSeconds,

/// <summary>
/// An expression that identifies the service associated with an event or span.
/// </summary>
ServiceNameExpression,

/// <summary>
/// Tracks whether an admin user has dismissed the secret key backup warning.
/// </summary>
Expand All @@ -228,6 +296,11 @@ public enum SettingName
/// <summary>
/// A snippet of CSS that will be included in the front-end's user interface styles.
/// </summary>
ThemeStyles
ThemeStyles,

/// <summary>
/// If <c>true</c>, user avatars will be retrieved from Gravatar.
/// </summary>
UseGravatar
}
}
48 changes: 48 additions & 0 deletions src/Seq.Api/Model/Settings/SettingsValuesPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright © Datalust and contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Collections.Generic;
using Newtonsoft.Json;

namespace Seq.Api.Model.Settings
{
/// <summary>
/// A set of related setting values, to be applied together, or (for authentication settings) tested without being
/// applied.
/// </summary>
public class SettingsValuesPart
{
/// <summary>
/// Setting values keyed by setting name (see <see cref="SettingName"/>). Settings that are omitted keep their
/// current values. Settings that are read-only (see <see cref="SettingEntity.IsReadOnly"/>) must be omitted.
/// </summary>
/// <remarks>When testing authentication settings, the <c>AuthenticationProvider</c> setting determines which
/// provider is tested, and settings that don't apply to that provider are ignored.</remarks>
public Dictionary<string, object> Settings { get; set; } = new();

/// <summary>
/// When testing settings for providers that check credentials locally (Active Directory), the username to
/// sign in with. Must be <c>null</c> when applying settings.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Username { get; set; }

/// <summary>
/// When testing settings for providers that check credentials locally (Active Directory), the password to
/// sign in with. Must be <c>null</c> when applying settings.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Password { get; set; }
}
}
22 changes: 21 additions & 1 deletion src/Seq.Api/Model/Users/UserEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using Seq.Api.Model.Shared;
using Seq.Api.ResourceGroups;

namespace Seq.Api.Model.Users
{
Expand Down Expand Up @@ -69,7 +70,17 @@ public class UserEntity : Entity
/// The ids of one or more roles that grant permissions to the user. Note that
/// the Seq UI currently only supports a single role when editing users.
/// </summary>
public HashSet<string> RoleIds { get; set; } = new HashSet<string>();
public HashSet<string> RoleIds { get; set; } = new();

/// <summary>
/// If <c>true</c>, the user account is deactivated: the user cannot log in. The account and the entities
/// it owns are retained, and the account can be reactivated later.
/// </summary>
/// <remarks>Read-only; changes to this property are ignored when the entity is updated. Use
/// the <see cref="UsersResourceGroup.DeactivateAsync"/> and <see cref="UsersResourceGroup.ReactivateAsync"/> actions
/// to change it.</remarks>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool IsDeactivated { get; set; }

/// <summary>
/// The authentication provider associated with the user account. This will normally be
Expand All @@ -86,6 +97,15 @@ public class UserEntity : Entity
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string AuthenticationProviderUniqueIdentifier { get; set; }

/// <summary>
/// The identifier assigned to the user by an external provisioning system (the SCIM <c>externalId</c>),
/// if the account is managed through SCIM.
/// </summary>
/// <remarks>Read-only; the value is set by the provisioning system and changes to this property are
/// ignored when the entity is updated.</remarks>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string ScimExternalId { get; set; }

/// <summary>
/// Because the <c>api/users/login</c> endpoint returns a <see cref="UserEntity"/> in the JSON response
Expand Down
9 changes: 4 additions & 5 deletions src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ public async Task<MeasurementTimeseriesPart> GetMeasurementTimeseriesAsync(strin
/// extended to account for the resolution of the underlying data.
/// </summary>
/// <param name="rangeStart">The (inclusive) start of the range to report on. If omitted, the results will report from the
/// earliest stored data. The range start must land on a five-minute boundary.</param>
/// <param name="rangeEnd">The (exclusive) end of the range to report on. If omitted, the results will report from the
/// earliest stored data. The range must be a multiple of the interval size, or a whole number of days if
/// no interval is specified.</param>
/// <param name="intervalSeconds">The bucket size to use. Must be a multiple of 5 minutes. Defaults to 1440 (one day).</param>
/// earliest stored data. The range start must land on a storage tick-aligned boundary.</param>
/// <param name="rangeEnd">The (exclusive) end of the range to report on. If omitted, the results will report to the
/// latest stored data. The range end must lane on a storage tick-aligned boundary.</param>
/// <param name="intervalSeconds">The bucket size to use. Must be a multiple of storage ticks. Defaults to 1440 (one day). A safe minimum value is 300 (5 minutes).</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param>
/// <returns>Storage consumption information.</returns>
public async Task<StorageConsumptionPart> GetStorageConsumptionAsync(
Expand Down
28 changes: 28 additions & 0 deletions src/Seq.Api/ResourceGroups/SettingsResourceGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,33 @@ public async Task UpdateInternalErrorReportingAsync(InternalErrorReportingSettin
{
await GroupPutAsync("InternalErrorReporting", internalErrorReporting, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Update a set of related settings together. Either all of the settings are updated, or none are. Changes to
/// authentication provider settings are applied by reloading the provider, which ends all existing sessions
/// when the provider is OpenID Connect-based. Requires the <c>System</c> permission.
/// </summary>
/// <param name="values">The settings to update. The <see cref="SettingsValuesPart.Username"/> and
/// <see cref="SettingsValuesPart.Password"/> properties must be <c>null</c>.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param>
/// <returns>A task indicating completion.</returns>
public async Task ApplyAsync(SettingsValuesPart values, CancellationToken cancellationToken = default)
{
if (values == null) throw new ArgumentNullException(nameof(values));
await GroupPostAsync("Apply", values, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Check that proposed authentication settings can be used successfully, without applying them. Requires
/// the <c>System</c> permission.
/// </summary>
/// <param name="test">The proposed settings.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param>
/// <returns>The outcome of the test.</returns>
public async Task<AuthenticationSettingsTestResultPart> TestAuthenticationSettingsAsync(SettingsValuesPart test, CancellationToken cancellationToken = default)
{
if (test == null) throw new ArgumentNullException(nameof(test));
return await GroupPostAsync<SettingsValuesPart, AuthenticationSettingsTestResultPart>("AuthTest", test, cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
Loading
Loading