Skip to content

Commit 9570694

Browse files
feat: Add options to mutual authentication (#1320)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bd78ad5 commit 9570694

File tree

1 file changed

+10
-3
lines changed
  • enterprise_gateway/services/processproxies

1 file changed

+10
-3
lines changed

enterprise_gateway/services/processproxies/yarn.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# whether we verify the server's TLS certificate in yarn-api-client.
3636
# Or a string, in which case it must be a path to a CA bundle(.pem file) to use.
3737
cert_path = os.getenv("EG_YARN_CERT_BUNDLE", True)
38+
mutual_authentication = os.getenv("EG_YARN_MUTUAL_AUTHENTICATION", "REQUIRED")
3839

3940

4041
class YarnClusterProcessProxy(RemoteProcessProxy):
@@ -91,9 +92,15 @@ def _initialize_resource_manager(self, **kwargs: dict[str, Any] | None) -> None:
9192
endpoints.append(self.alt_yarn_endpoint)
9293

9394
if self.yarn_endpoint_security_enabled:
94-
from requests_kerberos import HTTPKerberosAuth
95-
96-
auth = HTTPKerberosAuth()
95+
from requests_kerberos import DISABLED, OPTIONAL, REQUIRED, HTTPKerberosAuth
96+
97+
auth = HTTPKerberosAuth(
98+
mutual_authentication={
99+
"REQUIRED": REQUIRED,
100+
"OPTIONAL": OPTIONAL,
101+
"DISABLED": DISABLED,
102+
}.get(mutual_authentication.upper())
103+
)
97104
else:
98105
# If we have the appropriate version of yarn-api-client, use its SimpleAuth class.
99106
# This allows EG to continue to issue requests against the YARN api when anonymous

0 commit comments

Comments
 (0)