import Cdn from '../Loaders/Cdn'; /** Keeps CDN credentials separate while preserving other query values verbatim. */ export default class CdnTokenRegistry { private _authParamNames; private _learnedCredentialByHost; private _decisionTokenByHost; private _decisionCdns; private _retainedHosts; /** Keeps these hosts' credentials when a later decision no longer lists them (see `_retainedHosts`). */ retainHosts(hosts: string[]): void; /** The credential last known for `host`: the one it issued itself, else its decision token. */ credentialForHost(host: string): string; learnFromDecision(cdnList: Map): void; learnFromRedirect(requestUrl?: string, responseUrl?: string): void; credentialFor(cdn: Cdn): string; hasCredentialFor(cdn: Cdn): boolean; stripAuthParams(query?: string): string; /** * For a request where we apply no credential: keeps a credential param only when the request goes to * the host that credential was issued for, other params untouched and in order. The issuer is the * CDN host that minted it when this registry knows it (a decision token, a redirect-learned token); * any other credential came with the player's URL, so it belongs to that URL's host, `sourceHost`. * Android `CdnTokenRegistry.isolateCredentials` parity. */ isolateCredentials(query: string | undefined, sourceHost: string, targetHost: string): string; /** Whether the query carries any param known to be a CDN credential. */ hasKnownCredential(query?: string): boolean; /** The hosts this registry saw issue exactly this `name=value` credential. */ private _issuersOf; getAuthParamNames(): string[]; private _pairsIn; private _nameOf; }