Skip to content

Class swarmauri_base.pop.PopSignerMixin.PopSignerMixin

swarmauri_base.pop.PopSignerMixin.PopSignerMixin

PopSignerMixin(
    *, kind, header_name, include_query=False, **data
)

Bases: IPoPSigner, BaseModel

Common helpers for IPopSigning implementations.

Source code in swarmauri_base/pop/PopSignerMixin.py
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(
    self,
    *,
    kind: PoPKind,
    header_name: str,
    include_query: bool = False,
    **data,
) -> None:
    super().__init__(**data)
    self._kind = kind
    self._header_name = header_name
    self._include_query = include_query

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

kind property

kind

header_name

header_name()
Source code in swarmauri_base/pop/PopSignerMixin.py
45
46
def header_name(self) -> str:
    return self._header_name

ath_from_token

ath_from_token(token)
Source code in swarmauri_base/pop/PopSignerMixin.py
86
87
88
89
90
91
def ath_from_token(self, token: bytes | str) -> str:
    if isinstance(token, str):
        token_bytes = token.encode("utf-8")
    else:
        token_bytes = token
    return sha256_b64u(token_bytes)