fix(transport): carry Transport + OAuth2 authority/scope on SmtpConfigDto (OAuth2 fields were silently dropped)

This commit is contained in:
Joseph Doherty
2026-08-10 06:43:43 -04:00
parent 2f217f5742
commit 8df15b34b8
6 changed files with 159 additions and 2 deletions
@@ -186,7 +186,12 @@ public sealed class EntitySerializer
MaxConcurrentConnections: smtp.MaxConcurrentConnections,
MaxRetries: smtp.MaxRetries,
RetryDelay: smtp.RetryDelay,
Secrets: secrets);
Secrets: secrets,
// Non-sensitive delivery metadata: the OAuth2 endpoint pair and
// the Smtp/Ews transport selector travel as plain DTO fields.
OAuth2Authority: smtp.OAuth2Authority,
OAuth2Scope: smtp.OAuth2Scope,
Transport: smtp.Transport);
}).ToList(),
// Inbound API keys are not transported between environments:
// the bundle carries API methods only. ApiMethod.ApprovedApiKeyIds is also
@@ -486,6 +491,11 @@ public sealed class EntitySerializer
MaxConcurrentConnections = dto.MaxConcurrentConnections,
MaxRetries = dto.MaxRetries,
RetryDelay = dto.RetryDelay,
// Null on a bundle written before these fields were carried, which
// is exactly the entity's "use the provider defaults / Smtp" state.
OAuth2Authority = dto.OAuth2Authority,
OAuth2Scope = dto.OAuth2Scope,
Transport = dto.Transport,
})
.ToList();