Skip to content

Commit 5047ed1

Browse files
committed
Remove oauth_cb workaround for KIP-768 support
Fixes #49.
1 parent 3da0388 commit 5047ed1

File tree

4 files changed

+8
-84
lines changed

4 files changed

+8
-84
lines changed

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ classifiers = [
2121
"Typing :: Typed",
2222
]
2323
dependencies = [
24-
"authlib",
2524
"certifi",
26-
"confluent-kafka >= 2.2.0",
27-
"requests",
25+
"confluent-kafka >= 2.11.0",
2826
]
2927
requires-python = ">=3.9"
3028
dynamic = [ "version" ]

src/gcn_kafka/core.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@
77
import confluent_kafka
88
import confluent_kafka.admin
99

10-
from .oidc import set_oauth_cb
11-
1210

1311
def get_config(mode, config, **kwargs):
1412
# Merge configuration from user.
1513
config = update_config(config, **kwargs)
1614

1715
# SSL configuration.
1816
if config.setdefault("security.protocol", "sasl_ssl") == "sasl_ssl":
19-
if not config.get("ssl.ca.location"):
20-
# confluent-kafka wheels are statically linked against openssl,
21-
# but _that_ version of openssl may expect to find the CA cert
22-
# bundle at a different location than the users's system. Provide
23-
# certificate bundle from Certifi.
24-
config["ssl.ca.location"] = certifi.where()
17+
# confluent-kafka wheels are statically linked against openssl,
18+
# but _that_ version of openssl may expect to find the CA cert
19+
# bundle at a different location than the users's system. Provide
20+
# certificate bundle from Certifi.
21+
default_cert_location = certifi.where()
22+
config.setdefault("ssl.ca.location", default_cert_location)
23+
config.setdefault("https.ca.location", default_cert_location)
2524

2625
domain = config.pop("domain", "gcn.nasa.gov")
2726
client_id = config.pop("client_id", None)
@@ -46,7 +45,6 @@ def get_config(mode, config, **kwargs):
4645
if mode == "producer":
4746
config.setdefault("compression.type", "zstd")
4847

49-
set_oauth_cb(config)
5048
return config
5149

5250

@@ -81,9 +79,6 @@ def __init__(
8179
**kwargs,
8280
)
8381
)
84-
# Workaround for https://github.com/confluentinc/librdkafka/issues/3753#issuecomment-1058272987.
85-
# FIXME: Remove once fixed upstream, or on removal of oauth_cb.
86-
self.poll(0)
8782

8883

8984
class Consumer(confluent_kafka.Consumer):
@@ -111,9 +106,6 @@ def __init__(
111106
**kwargs,
112107
)
113108
)
114-
# Workaround for https://github.com/confluentinc/librdkafka/issues/3753#issuecomment-1058272987.
115-
# FIXME: Remove once fixed upstream, or on removal of oauth_cb.
116-
self.poll(0)
117109

118110

119111
class AdminClient(confluent_kafka.admin.AdminClient):
@@ -141,6 +133,3 @@ def __init__(
141133
**kwargs,
142134
)
143135
)
144-
# Workaround for https://github.com/confluentinc/librdkafka/issues/3753#issuecomment-1058272987.
145-
# FIXME: Remove once fixed upstream, or on removal of oauth_cb.
146-
self.poll(0)

src/gcn_kafka/oidc.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/test_oidc.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)