MCPcopy Create free account
hub / github.com/apache/impala / Parse

Method Parse

be/src/util/jwt-util.cc:72–89  ·  view source on GitHub ↗

Perform the parsing and populate JWKS's internal map. Return error status if encountering any error.

Source from the content-addressed store, hash-verified

70 // Perform the parsing and populate JWKS's internal map. Return error status if
71 // encountering any error.
72 Status Parse(const Document& rules_doc) {
73 bool found_keys = false;
74 for (Value::ConstMemberIterator member = rules_doc.MemberBegin();
75 member != rules_doc.MemberEnd(); ++member) {
76 if (strcmp("keys", member->name.GetString()) == 0) {
77 found_keys = true;
78 RETURN_IF_ERROR(ParseKeys(member->value));
79 } else {
80 return Status(TErrorCode::JWKS_PARSE_ERROR,
81 Substitute(
82 "Unexpected property '$0' must be removed", member->name.GetString()));
83 }
84 }
85 if (!found_keys) {
86 return Status(TErrorCode::JWKS_PARSE_ERROR, "An array of keys is required");
87 }
88 return Status::OK();
89 }
90
91 private:
92 JWKSSnapshot* jwks_;

Callers 2

LoadKeysFromFileMethod · 0.45
LoadKeysFromUrlMethod · 0.45

Calls 4

SubstituteFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70
GetStringMethod · 0.45

Tested by

no test coverage detected