GitHub

API reference for ApiKey.

An API key named key in a header (case-insensitive), query parameter or cookie; the credential is a Redacted string.

Attributes

AttributeTypeDescription
keystr
in_Literal['header', 'query', 'cookie'] = 'header'

Functions

__init__

__init__(key, in_='header', *, annotations=Context.empty()) -> None
ParameterTypeDescription
keystr
in_Literal['header', 'query', 'cookie'] = 'header'
annotationsContext[Any] = Context.empty()

annotate

annotate[S, T](tag, value) -> Self

This security with an annotation (OpenApi.Description, ...).

ParameterTypeDescription
tagTagLike[S, T]
valueS

Returns Self

def annotate[S, T](self, tag: TagLike[S, T], value: S) -> Self:
    """This security with an annotation (``OpenApi.Description``, ...)."""
    return replace(self, annotations=self.annotations.add(tag, value))

annotate_merge

annotate_merge(annotations) -> Self
ParameterTypeDescription
annotationsContext[Any]

Returns Self

def annotate_merge(self, annotations: Context[Any]) -> Self:
    return replace(self, annotations=self.annotations.merge(annotations))

pipe

pipe[B](f) -> B
ParameterTypeDescription
fCallable[[Self], B]

Returns B

def pipe[B](self, f: Callable[[Self], B], /) -> B:
    return f(self)