Skip to content

Commit

Permalink
Client module-grpc
Browse files Browse the repository at this point in the history
- Made changes following code review

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
  • Loading branch information
tmihalac committed Jul 12, 2024
1 parent bc4d8d3 commit e76a97b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/offline_stores/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
RetrievalMetadata,
)
from feast.infra.registry.base_registry import BaseRegistry
from feast.permissions.client.auth_client_manager import create_flight_call_options
from feast.permissions.client.utils import create_flight_call_options
from feast.repo_config import FeastConfigBaseModel, RepoConfig
from feast.saved_dataset import SavedDatasetStorage

Expand Down
10 changes: 10 additions & 0 deletions sdk/python/feast/permissions/client/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import pyarrow.flight as fl

from feast.permissions.auth.auth_type import AuthType
from feast.permissions.auth_model import AuthConfig
from feast.permissions.client.auth_client_manager import get_auth_client_manager

Expand All @@ -9,3 +12,10 @@ def create_auth_header(
token = auth_client_manager.get_token()

return (("authorization", "Bearer " + token),)


def create_flight_call_options(auth_config: AuthConfig) -> fl.FlightCallOptions:
if auth_config.type != AuthType.NONE.value:
headers = create_auth_header(auth_config)
return fl.FlightCallOptions(headers=headers)
return fl.FlightCallOptions()

0 comments on commit e76a97b

Please sign in to comment.