Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
HIVE-26071: JWT authentication mechanism for Thrift over HTTP in Hive…
…Metastore (#3233) (Sourabh Goyal, reviewed by Yu-wen, Deng and Sai) What changes were proposed in this pull request? This PR is a follow up of #3105. It adds a support for JWT authentication in HiveMetastore server when run in HTTP transport mode. Why are the changes needed? It supports a new authentication mechanism ie JWT in HiveMetastore server. Does this PR introduce any user-facing change? No How was this patch tested? Added new unit tests that cover cases like successfully authenticating valid JWT failing to authenticate expired, invalid JWTs * Add JWTValidator and URLBasedJWKSProvider code from HS2 Change-Id: I969f57daf640adb16f228e95b1b522f8ffc24ffe * Add JWT authentication in HiveMetastore Change-Id: I6d84517a1ee97df492ad3816ec866c0b785ed5ed * Better error handling for authentication failures. Added integration tests for validating JWT Change-Id: I6b9da531db4e4a805d8daa1ba6d941c5643bf514 * Added test JWTs for jwt authentication tests Change-Id: Ice36a703d8af7d4dbf28a48c9bb96127100fd8c7 * moved jwt test keys under jwt directory Change-Id: I8bf0b4bbc101a0acb3f69bb1963b9c4bcda5b719 * Fixes failures in metastore jwt unit tests Change-Id: I2877730a34dff7d3184b100ec04031032611838a * Addresses review comments Change-Id: I8498e85212476c663cf735211848a28baaa3bad5 * Addresses nits from review comments Change-Id: Id67588c106104732a0f6e49e5c983cb5f7287c3e * Added more comments in the code Change-Id: Ia51f490362985d109778a6a0aa92a281436d5d21 * removes unsed import statement Change-Id: I94633bdce0db87a9085968dde79d8ff6cd9bf4a3
- Loading branch information
Showing
13 changed files
with
746 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. See accompanying LICENSE file. | ||
*/ | ||
|
||
package org.apache.hadoop.hive.metastore.auth; | ||
|
||
/* | ||
Encapsulates any exceptions thrown by HiveMetastore server | ||
when authenticating http requests | ||
*/ | ||
public class HttpAuthenticationException extends Exception { | ||
|
||
private static final long serialVersionUID = 0; | ||
|
||
/** | ||
* @param cause original exception | ||
*/ | ||
public HttpAuthenticationException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* @param msg exception message | ||
*/ | ||
public HttpAuthenticationException(String msg) { | ||
super(msg); | ||
} | ||
|
||
/** | ||
* @param msg exception message | ||
* @param cause original exception | ||
*/ | ||
public HttpAuthenticationException(String msg, Throwable cause) { | ||
super(msg, cause); | ||
} | ||
|
||
} |
Oops, something went wrong.