Skip to content

Commit 44c339f

Browse files
lokeshranginenitmihalac
authored andcommitted
Added the arrow flight interceptor to inject the auth header. (feast-dev#68)
* * Added the arrow flight interceptor to inject the auth header. * Injecting grpc interceptor if it is needed when auth type is not NO_AUTH. Signed-off-by: Lokesh Rangineni <19699092+lokeshrangineni@users.noreply.github.com> * Fixing the failing integration test cases by setting the header in binary format. Signed-off-by: Lokesh Rangineni <19699092+lokeshrangineni@users.noreply.github.com> * Refactored method and moved to factory class to incorporate code review comment. Fixed lint error by removing the type of port. and other minor changes. Signed-off-by: Lokesh Rangineni <19699092+lokeshrangineni@users.noreply.github.com> * Incorproating code review comments from Daniel. Signed-off-by: Lokesh Rangineni <19699092+lokeshrangineni@users.noreply.github.com> --------- Signed-off-by: Lokesh Rangineni <19699092+lokeshrangineni@users.noreply.github.com> Signed-off-by: Abdul Hameed <ahameed@redhat.com>
1 parent 204c3a2 commit 44c339f

4 files changed

Lines changed: 1 addition & 54 deletions

File tree

sdk/python/feast/infra/offline_stores/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def _call_get(
354354
client: fl.FlightClient,
355355
command_descriptor: fl.FlightDescriptor,
356356
):
357-
flight = client.get_flight_info(command_descriptor, options)
357+
flight = client.get_flight_info(command_descriptor)
358358
ticket = flight.endpoints[0].ticket
359359
reader = client.do_get(ticket)
360360
return reader.read_all()
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,8 @@
11
from abc import ABC, abstractmethod
22

3-
from feast.permissions.auth.auth_type import AuthType
4-
from feast.permissions.auth_model import (
5-
AuthConfig,
6-
KubernetesAuthConfig,
7-
OidcAuthConfig,
8-
)
9-
103

114
class AuthenticationClientManager(ABC):
125
@abstractmethod
136
def get_token(self) -> str:
147
"""Retrieves the token based on the authentication type configuration"""
158
pass
16-
17-
18-
def get_auth_client_manager(auth_config: AuthConfig) -> AuthenticationClientManager:
19-
if auth_config.type == AuthType.OIDC.value:
20-
assert isinstance(auth_config, OidcAuthConfig)
21-
22-
from feast.permissions.client.oidc_authentication_client_manager import (
23-
OidcAuthClientManager,
24-
)
25-
26-
return OidcAuthClientManager(auth_config)
27-
elif auth_config.type == AuthType.KUBERNETES.value:
28-
assert isinstance(auth_config, KubernetesAuthConfig)
29-
30-
from feast.permissions.client.kubernetes_auth_client_manager import (
31-
KubernetesAuthClientManager,
32-
)
33-
34-
return KubernetesAuthClientManager(auth_config)
35-
else:
36-
raise RuntimeError(
37-
f"No Auth client manager implemented for the auth type:${auth_config.type}"
38-
)

sdk/python/feast/permissions/client/utils.py

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

sdk/python/tests/unit/infra/offline_stores/test_offline_store.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pandas as pd
55
import pyarrow
6-
import pyarrow.flight as fl
76
import pytest
87

98
from feast.infra.offline_stores.contrib.athena_offline_store.athena import (
@@ -216,7 +215,6 @@ def retrieval_job(request, environment):
216215

217216
return RemoteRetrievalJob(
218217
client=MagicMock(),
219-
options=fl.FlightCallOptions(),
220218
api_parameters={
221219
"str": "str",
222220
},

0 commit comments

Comments
 (0)