MCPcopy Create free account
hub / github.com/3rdparty/libprocess / decode

Function decode

src/jwt.cpp:42–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40namespace {
41
42Try<JSON::Object> decode(const string& component)
43{
44 const Try<string> decoded = base64::decode_url_safe(component);
45
46 if (decoded.isError()) {
47 return Error("Failed to base64url-decode: " + decoded.error());
48 }
49
50 const Try<JSON::Object> json = JSON::parse<JSON::Object>(decoded.get());
51
52 if (json.isError()) {
53 return Error("Failed to parse into JSON: " + json.error());
54 }
55
56 return json;
57}
58
59
60Try<JWT::Header> parse_header(const string& component)

Callers 10

authenticateMethod · 0.70
parse_headerFunction · 0.70
parse_payloadFunction · 0.70
on_message_completeMethod · 0.70
on_headers_completeMethod · 0.70
parseFunction · 0.70
handleMethod · 0.70
absolutePathMethod · 0.70
consumeMethod · 0.70
TEST_PFunction · 0.50

Calls 1

getMethod · 0.45

Tested by 1

TEST_PFunction · 0.40