MCPcopy
hub / github.com/authlib/authlib / extract_segment

Function extract_segment

authlib/jose/util.py:25–33  ·  view source on GitHub ↗
(segment, error_cls, name="payload")

Source from the content-addressed store, hash-verified

23
24
25def extract_segment(segment, error_cls, name="payload"):
26 if len(segment) > 256000:
27 raise ValueError(f"Value of {name} is too long")
28
29 try:
30 return urlsafe_b64decode(segment)
31 except (TypeError, binascii.Error) as exc:
32 msg = f"Invalid {name} padding"
33 raise error_cls(msg) from exc
34
35
36def ensure_dict(s, structure_name):

Callers 5

_extract_signatureFunction · 0.90
_extract_payloadFunction · 0.90
deserialize_compactMethod · 0.90
deserialize_jsonMethod · 0.90
extract_headerFunction · 0.85

Calls 1

urlsafe_b64decodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…