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

Method Verify

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

JWTPublicKey member functions. Verify JWT's signature for the given decoded token with jwt-cpp API.

Source from the content-addressed store, hash-verified

273//
274// Verify JWT's signature for the given decoded token with jwt-cpp API.
275Status JWTPublicKey::Verify(
276 const DecodedJWT& decoded_jwt, const std::string& algorithm) const {
277 // Verify if algorithms are matching.
278 if (algorithm_.compare(algorithm) != 0) {
279 return Status(TErrorCode::JWT_VERIFY_FAILED,
280 Substitute("JWT algorithm '$0' is not matching with JWK algorithm '$1'",
281 algorithm, algorithm_));
282 }
283
284 Status status;
285 try {
286 // Call jwt-cpp API to verify token's signature.
287 verifier_.verify(decoded_jwt);
288 } catch (const jwt::error::rsa_exception& e) {
289 status = Status(TErrorCode::JWT_VERIFY_FAILED, Substitute("RSA error: $0", e.what()));
290 } catch (const jwt::error::token_verification_exception& e) {
291 status = Status(TErrorCode::JWT_VERIFY_FAILED,
292 Substitute("Verification failed, error: $0", e.what()));
293 } catch (const std::exception& e) {
294 status = Status(TErrorCode::JWT_VERIFY_FAILED,
295 Substitute("Varification failed, error: $0", e.what()));
296 }
297 return status;
298}
299
300// Create a JWKPublicKey of HS from the JWK.
301Status HSJWTPublicKeyBuilder::CreateJWKPublicKey(

Callers 8

JWTTokenAuthFunction · 0.45
OAuthTokenAuthFunction · 0.45
AuthenticateCookieFunction · 0.45
CheckHashAndDecryptMethod · 0.45
TESTFunction · 0.45
JWTTokenAuthMethod · 0.45
OAuthTokenAuthMethod · 0.45
TEST_FFunction · 0.45

Calls 15

SubstituteFunction · 0.85
OKFunction · 0.85
substrMethod · 0.80
StatusClass · 0.70
compareMethod · 0.65
verifyMethod · 0.45
emptyMethod · 0.45
IsEmptyMethod · 0.45
LookupHSKeyMethod · 0.45
LookupRSAPublicKeyMethod · 0.45
LookupECPublicKeyMethod · 0.45
GetAllHSKeysMethod · 0.45

Tested by 2

TESTFunction · 0.36
TEST_FFunction · 0.36