android-components / mozilla.components.feature.customtabs.verify / OriginVerifier

OriginVerifier

class OriginVerifier (source)

Used to verify postMessage origin for a designated package name.

Uses Digital Asset Links to confirm that the given origin is associated with the package name. It caches any origin that has been verified during the current application lifecycle and reuses that without making any new network requests.

Constructors

Name Summary
<init> OriginVerifier(packageName: String, relation: Int, packageManager: <ERROR CLASS>, httpClient: Client, apiKey: String?)
Used to verify postMessage origin for a designated package name.

Functions

Name Summary
verifyOrigin suspend fun verifyOrigin(origin: <ERROR CLASS>): <ERROR CLASS>
Verify the claimed origin for the cached package name asynchronously. This will end up making a network request for non-cached origins with a HTTP Client.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.