docs/changelogs/Groups_Namespaces_Auth_implmentation_summary.md
This document summarizes the implementation of groups and namespaces extraction support in Feast for user authentication in Pull Request https://github.com/feast-dev/feast/pull/5619.
sdk/python/feast/permissions/user.py)groups and namespaces attributeshas_matching_group(): Check if user has required groupshas_matching_namespace(): Check if user has required namespacessdk/python/feast/permissions/policy.py)protos/feast/core/Policy.proto)make compile-protos-pythonsdk/python/feast/permissions/auth/kubernetes_token_parser.py)_extract_groups_and_namespaces_from_token():
user_details_from_access_token() to include groups and namespacessdk/python/feast/permissions/client/kubernetes_auth_client_manager.py)get_token() method to check for user_token in configsdk/python/feast/permissions/auth_model.py)sdk/python/tests/permissions/test_groups_namespaces_auth.py)docs/getting-started/components/groups_namespaces_auth.md)from feast.permissions.policy import GroupBasedPolicy
from feast.permissions.permission import Permission
policy = GroupBasedPolicy(groups=["data-team", "ml-engineers"])
permission = Permission(
name="data_team_access",
types=ALL_RESOURCE_TYPES,
policy=policy,
actions=[AuthzedAction.DESCRIBE] + READ
)
from feast.permissions.policy import NamespaceBasedPolicy
from feast.permissions.permission import Permission
policy = NamespaceBasedPolicy(namespaces=["de-dsp", "ml-dsp"])
permission = Permission(
name="data_team_access",
types=ALL_RESOURCE_TYPES,
policy=policy,
actions=[AuthzedAction.DESCRIBE] + READ
)
from feast.permissions.policy import CombinedGroupNamespacePolicy
policy = CombinedGroupNamespacePolicy(
groups=["data-team"],
namespaces=["production"]
)
from feast.permissions.auth_model import KubernetesAuthConfig
auth_config = KubernetesAuthConfig(
type="kubernetes",
user_token="your-kubernetes-user-token" # For external users
)