mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-01 16:24:44 +00:00
updates
This commit is contained in:
parent
fd86961c88
commit
529b12dc5e
4 changed files with 2220 additions and 2210 deletions
|
@ -180,7 +180,7 @@ class KubernetesAuthProvider(AuthProvider):
|
||||||
JWT_AUDIENCE = "llama-stack"
|
JWT_AUDIENCE = "llama-stack"
|
||||||
|
|
||||||
|
|
||||||
class JWKSAuthProviderConfig(BaseModel):
|
class JWTAuthProviderConfig(BaseModel):
|
||||||
"""Configuration for JWT token authentication provider."""
|
"""Configuration for JWT token authentication provider."""
|
||||||
|
|
||||||
# The JWKS URI for collecting public keys
|
# The JWKS URI for collecting public keys
|
||||||
|
@ -189,10 +189,10 @@ class JWKSAuthProviderConfig(BaseModel):
|
||||||
cache_ttl: int = 3600
|
cache_ttl: int = 3600
|
||||||
|
|
||||||
|
|
||||||
class JWKSAuthProvider(AuthProvider):
|
class JWTAuthProvider(AuthProvider):
|
||||||
"""JWT token authentication provider that validates tokens against the JWT token."""
|
"""JWT token authentication provider that validates tokens against the JWT token."""
|
||||||
|
|
||||||
def __init__(self, config: JWKSAuthProviderConfig):
|
def __init__(self, config: JWTAuthProviderConfig):
|
||||||
self.config = config
|
self.config = config
|
||||||
self._jwks_at: float = 0.0
|
self._jwks_at: float = 0.0
|
||||||
self._jwks: dict[str, str] = {}
|
self._jwks: dict[str, str] = {}
|
||||||
|
@ -334,8 +334,8 @@ def create_auth_provider(config: AuthProviderConfig) -> AuthProvider:
|
||||||
return KubernetesAuthProvider(KubernetesAuthProviderConfig.model_validate(config.config))
|
return KubernetesAuthProvider(KubernetesAuthProviderConfig.model_validate(config.config))
|
||||||
elif provider_type == "custom":
|
elif provider_type == "custom":
|
||||||
return CustomAuthProvider(CustomAuthProviderConfig.model_validate(config.config))
|
return CustomAuthProvider(CustomAuthProviderConfig.model_validate(config.config))
|
||||||
elif provider_type == "jwks":
|
elif provider_type == "jwt":
|
||||||
return JWKSAuthProvider(JWKSAuthProviderConfig.model_validate(config.config))
|
return JWTAuthProvider(JWTAuthProviderConfig.model_validate(config.config))
|
||||||
else:
|
else:
|
||||||
supported_providers = ", ".join([t.value for t in AuthProviderType])
|
supported_providers = ", ".join([t.value for t in AuthProviderType])
|
||||||
raise ValueError(f"Unsupported auth provider type: {provider_type}. Supported types are: {supported_providers}")
|
raise ValueError(f"Unsupported auth provider type: {provider_type}. Supported types are: {supported_providers}")
|
||||||
|
|
|
@ -23,6 +23,7 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"blobfile",
|
"blobfile",
|
||||||
"fire",
|
"fire",
|
||||||
|
"jose",
|
||||||
"httpx",
|
"httpx",
|
||||||
"huggingface-hub",
|
"huggingface-hub",
|
||||||
"jinja2>=3.1.6",
|
"jinja2>=3.1.6",
|
||||||
|
|
|
@ -23,6 +23,7 @@ huggingface-hub==0.29.0
|
||||||
idna==3.10
|
idna==3.10
|
||||||
jinja2==3.1.6
|
jinja2==3.1.6
|
||||||
jiter==0.8.2
|
jiter==0.8.2
|
||||||
|
jose==1.0.0
|
||||||
jsonschema==4.23.0
|
jsonschema==4.23.0
|
||||||
jsonschema-specifications==2024.10.1
|
jsonschema-specifications==2024.10.1
|
||||||
kubernetes==32.0.1
|
kubernetes==32.0.1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue