Class SourceCredentialResolver
- Namespace
- Virtufin.WorkManager.Components
- Assembly
- Virtufin.WorkManager.dll
Resolves the effective AuthenticationHeaderValue for a
code source fetch (WorkManager.FetchFromUrlAsync) from a
per-request SourceCredential, replacing the former
RegistryAuthHandler -- a DelegatingHandler
registered unconditionally on the CodeFetcher
IHttpClientFactory client and applied to every request
whose host matched, regardless of whether the caller actually wanted
the org credential used. Credentials are now explicit and per-request:
a directly-supplied Basic/Bearer secret, or a named reference
resolved server-side (see ResolveNamed(string, string, out string?)) so that secret
never has to be distributed to callers.
public static class SourceCredentialResolver
- Inheritance
-
SourceCredentialResolver
- Inherited Members
Methods
Resolve(CodeSourceUrl, SourceCredential?)
Resolves the effective AuthenticationHeaderValue for
fetching urlSource. liveCredential
(a fresh request's own SourceCredential) takes
precedence when present -- covers Basic/Bearer/named alike. Falls
back to NamedCredential (the only
credential kind that survives into persisted state) so a recovery
re-fetch of a worker created with authentication = "virtufin"
keeps working after a WorkManager restart, even with no live
request credential. Returns null (no header) when neither is
present.
public static AuthenticationHeaderValue? Resolve(CodeSourceUrl urlSource, SourceCredential? liveCredential)
Parameters
urlSourceCodeSourceUrlliveCredentialSourceCredential
Returns
Exceptions
- InvalidOperationException
The credential is a
namedreference that can't be resolved (unrecognized name, or the host isn't permitted for it).
ResolveNamed(string, string, out string?)
Resolves a named credential reference against
targetHost. Only Virtufin.WorkManager.Engines.VirtufinRegistry.CredentialName
is recognized (reserved in tui's credentials.toml, so a personal
entry can never shadow it).
public static AuthenticationHeaderValue? ResolveNamed(string name, string targetHost, out string? error)
Parameters
Returns
- AuthenticationHeaderValue
An AuthenticationHeaderValue on success, or
nullwitherrorset if the name is unrecognized, the host isn't permitted for it, or the org credential isn't configured on this instance.