You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "okumin (via GitHub)" <gi...@apache.org> on 2025/03/23 04:14:13 UTC
[PR] HIVE-28840: HMH Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
okumin opened a new pull request, #5710:
URL: https://github.com/apache/hive/pull/5710
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
Let HMSCatalog, the Iceberg REST catalog on HMS, respect the parameter.
### Why are the changes needed?
We can't configure the auth mode of the catalog API
### Does this PR introduce _any_ user-facing change?
No. This feature has not been released yet
### Is the change a dependency upgrade?
No
### How was this patch tested?
I ran the server on my local machine
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009117564
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
Review Comment:
````
public ServletSecurity(Configuration conf, String authTypeStr) {
this(conf, isAuthJwt(authTypeStr));
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009113202
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
- }
-
public ServletSecurity(Configuration conf, boolean jwt) {
this.conf = conf;
this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled();
this.jwtAuthEnabled = jwt;
}
- public static boolean isAuthJwt(Configuration configuration) {
Review Comment:
can we keep a method?
````
private static boolean isAuthJwt(String authTypeStr) {
return "jwt".equalsIgnoreCase(authTypeStr);
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2776090626
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2028602557
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,8 +85,10 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
+ public ServletSecurity(String authType, Configuration conf) {
+ this.conf = conf;
Review Comment:
Just my bad. Updated!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2778469952
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMH Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2746027970
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2779500249
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5710&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5710&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5710&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5710)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009096402
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
Just clarifying. Do you propose using PROPERTIES_SERVLET_AUTH for Iceberg REST Catalog Servlet? I honestly don't know when we should use PropertyServlet, and I assume it is a different endpoint from Iceberg REST Catalog. Users of Iceberg REST are other computing engines, and those of PropertyServlet don't seem so. So, a separate parameter makes sense to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009117347
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java:
##########
@@ -313,7 +313,8 @@ public static ServletServerBuilder.Descriptor createServlet(Configuration config
int port = MetastoreConf.getIntVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_PORT);
String path = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_PATH);
if (port >= 0 && path != null && !path.isEmpty()) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
+ ServletSecurity security = new ServletSecurity(configuration, "jwt".equalsIgnoreCase(auth));
Review Comment:
````
String authTypeStr = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
ServletSecurity security = new ServletSecurity(configuration, authTypeStr);
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009113202
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
- }
-
public ServletSecurity(Configuration conf, boolean jwt) {
this.conf = conf;
this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled();
this.jwtAuthEnabled = jwt;
}
- public static boolean isAuthJwt(Configuration configuration) {
Review Comment:
can we keep a method just add an extra. param
````
public static boolean isAuthJwt(Configuration conf, MetastoreConf.ConfVars var) {
return "jwt".equalsIgnoreCase(MetastoreConf.getVar(conf, var));
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009117564
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
Review Comment:
````
public ServletSecurity(String authTypeStr, Configuration conf) {
this(conf, isAuthJwt(authTypeStr));
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009065630
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
do we even need `ICEBERG_CATALOG_SERVLET_AUTH`config, it's only set in tests?
````
public static boolean isAuthJwt(Configuration configuration) {
String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
return "jwt".equalsIgnoreCase(auth);
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2766249458
hi @okumin, ping in case you missed the comments update
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009113202
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
- }
-
public ServletSecurity(Configuration conf, boolean jwt) {
this.conf = conf;
this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled();
this.jwtAuthEnabled = jwt;
}
- public static boolean isAuthJwt(Configuration configuration) {
Review Comment:
can we keep a method?
````
public static boolean isAuthJwt(String authTypeStr) {
return "jwt".equalsIgnoreCase(authTypeStr);
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009065630
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
do we even need `ICEBERG_CATALOG_SERVLET_AUTH`config, it's only set in tests?
````
public static boolean isAuthJwt(Configuration configuration) {
String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
return "jwt".equalsIgnoreCase(auth);
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009117347
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java:
##########
@@ -313,7 +313,8 @@ public static ServletServerBuilder.Descriptor createServlet(Configuration config
int port = MetastoreConf.getIntVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_PORT);
String path = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_PATH);
if (port >= 0 && path != null && !path.isEmpty()) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
+ ServletSecurity security = new ServletSecurity(configuration, "jwt".equalsIgnoreCase(auth));
Review Comment:
````
String authTypeStr = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
ServletSecurity security = new ServletSecurity(authTypeStr, configuration);
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on PR #5710:
URL: https://github.com/apache/hive/pull/5710#issuecomment-2775812500
@deniskuzZ Sorry, I could not respond promptly. I updated the branch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin merged PR #5710:
URL: https://github.com/apache/hive/pull/5710
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2027216650
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,8 +85,10 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
+ public ServletSecurity(String authType, Configuration conf) {
+ this.conf = conf;
Review Comment:
@okumin, why not call the existing constructor?
````
this(conf, isAuthJwt(authTypeStr));
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009113202
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
- }
-
public ServletSecurity(Configuration conf, boolean jwt) {
this.conf = conf;
this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled();
this.jwtAuthEnabled = jwt;
}
- public static boolean isAuthJwt(Configuration configuration) {
Review Comment:
can we keep a method just add an extra param?
````
public static boolean isAuthJwt(Configuration conf, MetastoreConf.ConfVars var) {
return "jwt".equalsIgnoreCase(MetastoreConf.getVar(conf, var));
}
````
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java:
##########
@@ -85,21 +85,12 @@ public class ServletSecurity {
private final Configuration conf;
private JWTValidator jwtValidator = null;
- public ServletSecurity(Configuration conf) {
- this(conf, isAuthJwt(conf));
- }
-
public ServletSecurity(Configuration conf, boolean jwt) {
this.conf = conf;
this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled();
this.jwtAuthEnabled = jwt;
}
- public static boolean isAuthJwt(Configuration configuration) {
Review Comment:
can we keep a method just add an extra param?
````
public static boolean isAuthJwt(Configuration conf, MetastoreConf.ConfVars var) {
return "jwt".equalsIgnoreCase(MetastoreConf.getVar(conf, var));
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009084870
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
I think so. I want to add a new auth mode, NONE. Some query engines support neither SIMPLE nor JWT. JWT is hard to prepare for PoC
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009089612
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
Can't we extend PROPERTIES_SERVLET_AUTH and use it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28840: HMS Iceberg Catalog doesn't respect ICEBERG_CATALOG_SERVLET_AUTH [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5710:
URL: https://github.com/apache/hive/pull/5710#discussion_r2009111126
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -117,7 +118,8 @@ protected Catalog createCatalog() {
* @return the servlet
*/
protected HttpServlet createServlet(Catalog catalog) {
- ServletSecurity security = new ServletSecurity(configuration);
+ String auth = MetastoreConf.getVar(configuration, ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
Review Comment:
sorry, my bad, I thought we had a generic SERVLET_AUTH config.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org