Google Tiles Auth Provider
Google Photorealistic 3D Tiles auth. Static ?key=<apiKey> on every request; the ?session=<token> from the root response is propagated down the tree.
Properties
Hard-coded identifier used as the discriminator when serializing the provider via Ogc3dAuthCredentials; must survive R8 / ProGuard / Kotlin-Native obfuscation.
Session tokens are minted per root fetch, so re-bootstrapping can cure a rejection.
Functions
Drop the cached session so the next root fetch is forced to bootstrap a fresh one. Called by the fetch queue after a content 401/403 — Google's session tokens are long-lived but not eternal, and on expiry every tile URL minted under the old session is dead.
Google answers an expired/mismatched session= with HTTP 400, not 401/403, so fold it in — otherwise a timed-out session never triggers recovery.
Whether a successful tileset.json body for url should be persisted to the blob cache. Providers whose first response is a redirect envelope rather than a real tileset (Cesium Ion's /endpoint returns {type, url, accessToken}) return false so it never gets cached as if it were tileset content. Default true — root and subtree tileset.json bodies cache normally and replay across sessions, with the embedded session/auth tokens reused as long as the server still accepts them.
Inspect a successful tileset.json fetch result so the provider can update its internal state from the response (e.g. Google's session query parameter on the response URL, Cesium Ion's asset endpoint URL + access token in the response body). Default no-op.
Ask the provider whether a successful tileset fetch should redirect to a different URL. Returns the new URL when the response is itself a redirect envelope (e.g. Cesium Ion's api.cesium.com/v1/assets/<id>/endpoint returns JSON with url + accessToken fields; the actual tileset.json lives at the returned URL), or null when body is the final tileset.json content.
Rewrite a child URI discovered while parsing a tileset. Lets providers propagate persistent query parameters (Google's session token) onto every child URI as soon as the tree is built, instead of waiting until each child fetch fires. Default returns the URI unchanged.
Rewrite an outgoing request. Called once per HTTP fetch immediately before the GET. Implementations may mutate the URL (e.g. append a token) and/or supply extra headers. Returning the input unchanged is fine — see NoAuthProvider.