feat(notifications): configurable OAuth2 authority + scope per SMTP configuration (defaults preserve M365) — entity + EF + migration + token service

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-10 04:07:13 -04:00
parent 178ae35308
commit 9e60347bde
8 changed files with 2201 additions and 5 deletions
@@ -126,5 +126,14 @@ public class SmtpConfigurationConfiguration : IEntityTypeConfiguration<SmtpConfi
builder.Property(s => s.FromAddress)
.IsRequired()
.HasMaxLength(500);
// Optional OAuth2 token-endpoint overrides — null preserves the M365 defaults.
builder.Property(s => s.OAuth2Authority)
.IsRequired(false)
.HasMaxLength(500);
builder.Property(s => s.OAuth2Scope)
.IsRequired(false)
.HasMaxLength(500);
}
}
@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
{
/// <inheritdoc />
public partial class AddSmtpOAuth2AuthorityScope : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "OAuth2Authority",
table: "SmtpConfigurations",
type: "nvarchar(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "OAuth2Scope",
table: "SmtpConfigurations",
type: "nvarchar(500)",
maxLength: 500,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OAuth2Authority",
table: "SmtpConfigurations");
migrationBuilder.DropColumn(
name: "OAuth2Scope",
table: "SmtpConfigurations");
}
}
}
@@ -984,6 +984,14 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
b.Property<int>("MaxRetries")
.HasColumnType("int");
b.Property<string>("OAuth2Authority")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("OAuth2Scope")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<int>("Port")
.HasColumnType("int");