Parameterized

class Parameterized : HttpAuthHeader

Describes a parameterized authentication header that is represented by a set of parameters encoded with encoding.

Constructors

<init>

Parameterized(
    authScheme: String,
    parameters: Map<String, String>,
    encoding: HeaderValueEncoding = HeaderValueEncoding.QUOTED_WHEN_REQUIRED)
Parameterized(
    authScheme: String,
    parameters: List<HeaderValueParam>,
    encoding: HeaderValueEncoding = HeaderValueEncoding.QUOTED_WHEN_REQUIRED)

Describes a parameterized authentication header that is represented by a set of parameters encoded with encoding.

Properties

encoding

val encoding: HeaderValueEncoding

parameters encoding method, one of HeaderValueEncoding

parameters

val parameters: List<HeaderValueParam>

a list of auth parameters

Inherited Properties

authScheme

val authScheme: String

auth scheme, usually one of AuthScheme

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

parameter

fun parameter(name: String): String?

Tries to extract the first value of a parameter name. Returns null when not found.

render

fun render(encoding: HeaderValueEncoding): String

Encodes the header with a specified encoding.

fun render(): String

Encodes the header with the default HeaderValueEncoding for this header.

withParameter

fun withParameter(name: String, value: String): Parameterized

Copies this Parameterized appending a new parameter name.

withReplacedParameter

fun withReplacedParameter(
    name: String,
    value: String
): Parameterized

Copies this Parameterized replacing parameters with name assigning new value or appending if no such parameters found. If there were several pairs they will be reduced into a single pair at position of first occurrence discarding following pairs with this name.

Inherited Functions

toString

open fun toString(): String

Encodes the header with the default HeaderValueEncoding for this header.

Extension Functions

sign

fun Parameterized.sign(
    method: HttpMethod,
    baseUrl: String,
    key: String,
    parameters: List<Pair<String, String>>
): Parameterized

Sign an HTTP auth header

toDigestCredential

fun Parameterized.toDigestCredential(): DigestCredential

Converts HttpAuthHeader to DigestCredential