CompanyDomainProviderExtensions
Builder-pattern sugar for declaring the dyndns provider while building a Company. Chain it on the CompanyBuilder (right after Company.CreateBuilder(...)). The registration is stashed process-statically (keyed by company name) and lifted by LiberatorWithWinDCTranslator after Translate(), which sets config.DomainProvider AND inserts a DomainProvider User named "DomainProvider" carrying the secret (config-driven-credentials rule).
public static class CompanyDomainProviderExtensions
1. Methods
1.1. AddDomainProvider(CompanyBuilder, string, SecretString, IReadOnlyList<string>, string, string, string)
Declare the dyndns provider used to keep the customer’s public A records pointed at the dynamic WAN IP. Builder-chained:
var company = Company.CreateBuilder("test.zh", "CH", "Zurich")
.AddDomainProvider("noip", "secret".ToSecretString(), new[] { "@", "mail", "nextcloud" })
.AddDevice(...)
.Build();
public static CompanyBuilder AddDomainProvider(this CompanyBuilder builder, string provider, SecretString secret, IReadOnlyList<string> hosts, string username = null, string secretKey = "password", string domain = null)
| Name | Type | Description |
|---|---|---|
builder |
CompanyBuilder |
CompanyBuilder under construction. |
provider |
string |
ddns-updater provider name (noip, duckdns, dyn, cloudflare, …). |
secret |
SecretString |
Token or password. Lands on the inserted "DomainProvider" User. |
hosts |
IReadOnlyList<string> |
Labels to update under domain ("@" for the zone root). |
username |
string |
Optional provider login username (omit for token-only providers). |
secretKey |
string |
ddns-updater settings key for the secret ("password" or "token"). |
domain |
string |
dyndns TARGET zone (the dynamic-DNS hostname’s zone, e.g. "no-ip.com" / "ddns.net"). In the "hosting → CNAME → dyndns" topology this is the No-IP zone, NOT the customer domain. Null ⇒ fall back to CustomerDomain (own-zone topology). |
Returns: CompanyBuilder
1.2. Clear()
Test seam: drop all registered entries.
public static void Clear()
1.3. TryGetDomainProvider(Company)
Lookup the stashed dyndns registration for a company. Null when no AddDomainProvider call referenced this company name.
public static DomainProviderRegistration TryGetDomainProvider(Company company)
| Name | Type | Description |
|---|---|---|
company |
Company |
Returns: DomainProviderRegistration