corda / net.corda.core.utilities / UntrustworthyData

UntrustworthyData

class UntrustworthyData<out T>

A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

Types

Validator

interface Validator<in T, out R> : Serializable

Constructors

<init>

UntrustworthyData(fromUntrustedWorld: T)

A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

Functions

unwrap

fun <R> unwrap(validator: Validator<T, R>): R

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.

unwrap

fun <T, R> UntrustworthyData<T>.unwrap(validator: (T) -> R): R