Skip to main content

com.bluebillywig.bbnativeshared.data — Functions

headersFor​

fun headersFor(url: String) : Map<String, String>

The headers to send with a request to [url]; empty unless [url] is a Blue Billywig origin.

fromOptions​

fun fromOptions(options: Map<String, Any?>?) : ContentAuth?

The credentials in the player [options], or null when there are none.

optionsWithCredentialsOf​

fun optionsWithCredentialsOf(args: Map<String, Any?>?, options: Map<String, Any?>?) : Map<String, Any?>?

The player [options] with the jwt / rpcToken that the load or updatePlayout [args] carry, as on the web: a key in [args] replaces the option, also with null. Null when [args] carry neither key: the credentials stay as they are (#21000).

A key that is left out is kept. cp-gatekeeper validates the rpcToken and ignores the jwt when both go out, so an app that moves from an rpcToken to a jwt sends rpcToken: "" too.

isBbAuthOrigin​

fun isBbAuthOrigin(url: String) : Boolean

https on bluebillywig.com / bbvms.com or a subdomain, or http(s) on a local dev host. Mirrors isBbAuthOrigin in the web channel (src/util/auth-tokens.ts); keep them in sync.

redactUrl​

fun redactUrl(url: String) : String

[url] with the value of any jwt / rpctoken query parameter replaced, for logging.