-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for keyring errors when initializing Flyte for_sandbox config client #2962
base: master
Are you sure you want to change the base?
Changes from all commits
21ebec7
f358477
77bc862
5c9bed0
b42a90f
6cb2d3f
2214e3d
a82cd3a
4475cc5
8f28333
db7cb2f
48600a7
2542435
3e27029
61b35fd
42509fb
0a5afe0
a50078e
456cd5d
9253dc0
c5d9426
7bb5ef3
b7e5146
b97107b
89cf6f6
17c840f
27a6527
857db92
1e56ac7
34f4aba
3bbbf41
9b3916c
0028436
d3ea8e4
5c19192
cf442e6
569558e
c4817cc
3d142c3
e207a64
3f989f7
1f62483
eb43e3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -122,9 +122,12 @@ def upgrade_channel_to_proxy_authenticated(cfg: PlatformConfig, in_channel: grpc | |||||||||||||||||
:param in_channel: grpc.Channel Precreated channel | ||||||||||||||||||
:return: grpc.Channel. New composite channel | ||||||||||||||||||
""" | ||||||||||||||||||
|
||||||||||||||||||
def authenticator_factory(): | ||||||||||||||||||
return get_proxy_authenticator(cfg) | ||||||||||||||||||
|
||||||||||||||||||
if cfg.proxy_command: | ||||||||||||||||||
proxy_authenticator = get_proxy_authenticator(cfg) | ||||||||||||||||||
return grpc.intercept_channel(in_channel, AuthUnaryInterceptor(proxy_authenticator)) | ||||||||||||||||||
return grpc.intercept_channel(in_channel, AuthUnaryInterceptor(authenticator_factory)) | ||||||||||||||||||
else: | ||||||||||||||||||
return in_channel | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -137,8 +140,11 @@ def upgrade_channel_to_authenticated(cfg: PlatformConfig, in_channel: grpc.Chann | |||||||||||||||||
:param in_channel: grpc.Channel Precreated channel | ||||||||||||||||||
:return: grpc.Channel. New composite channel | ||||||||||||||||||
""" | ||||||||||||||||||
authenticator = get_authenticator(cfg, RemoteClientConfigStore(in_channel)) | ||||||||||||||||||
return grpc.intercept_channel(in_channel, AuthUnaryInterceptor(authenticator)) | ||||||||||||||||||
|
||||||||||||||||||
def authenticator_factory(): | ||||||||||||||||||
return get_authenticator(cfg, RemoteClientConfigStore(in_channel)) | ||||||||||||||||||
Comment on lines
+144
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider caching authenticator instance
Consider caching the authenticator instance instead of creating a new one on every call to Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #5371e4 Is this a valid issue, or was it incorrectly flagged by the Agent?
|
||||||||||||||||||
|
||||||||||||||||||
return grpc.intercept_channel(in_channel, AuthUnaryInterceptor(authenticator_factory)) | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
def get_authenticated_channel(cfg: PlatformConfig) -> grpc.Channel: | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider caching the authenticator instance instead of creating a new one on each call to
authenticator_factory()
. This could improve performance by avoiding unnecessary object creation.Code suggestion
Code Review Run #5371e4
Is this a valid issue, or was it incorrectly flagged by the Agent?