diff --git a/docs/config.png b/docs/config.png index a5e468d6..7e2bf4fa 100644 Binary files a/docs/config.png and b/docs/config.png differ diff --git a/docs/config.puml b/docs/config.puml index 17d14e02..8f0a4400 100644 --- a/docs/config.puml +++ b/docs/config.puml @@ -1,5 +1,12 @@ @startuml classes set namespaceSeparator none +class "AccessRule" as src.models.config.AccessRule { + actions : list[Action] + role : str +} +class "Action" as src.models.config.Action { + name +} class "AuthenticationConfiguration" as src.models.config.AuthenticationConfiguration { jwk_config : Optional[JwkConfiguration] jwk_configuration @@ -9,6 +16,9 @@ class "AuthenticationConfiguration" as src.models.config.AuthenticationConfigura skip_tls_verification : bool check_authentication_model() -> Self } +class "AuthorizationConfiguration" as src.models.config.AuthorizationConfiguration { + access_rules : Optional[list[AccessRule]] +} class "CORSConfiguration" as src.models.config.CORSConfiguration { allow_credentials : bool allow_headers : list[str] @@ -18,6 +28,7 @@ class "CORSConfiguration" as src.models.config.CORSConfiguration { } class "Configuration" as src.models.config.Configuration { authentication + authorization : Optional[AuthorizationConfiguration] customization : Optional[Customization] database inference @@ -28,6 +39,9 @@ class "Configuration" as src.models.config.Configuration { user_data_collection dump(filename: str) -> None } +class "ConfigurationBase" as src.models.config.ConfigurationBase { + model_config +} class "Customization" as src.models.config.Customization { disable_query_system_prompt : bool system_prompt : Optional[str] @@ -46,14 +60,27 @@ class "InferenceConfiguration" as src.models.config.InferenceConfiguration { default_provider : Optional[str] check_default_model_and_provider() -> Self } +class "JsonPathOperator" as src.models.config.JsonPathOperator { + name +} class "JwkConfiguration" as src.models.config.JwkConfiguration { jwt_configuration url : AnyHttpUrl } class "JwtConfiguration" as src.models.config.JwtConfiguration { + role_rules : Optional[list[JwtRoleRule]] user_id_claim : str username_claim : str } +class "JwtRoleRule" as src.models.config.JwtRoleRule { + jsonpath : str + negate : bool + operator + roles : list[str] + value : Any + check_jsonpath() -> Self + check_roles() -> Self +} class "LlamaStackConfiguration" as src.models.config.LlamaStackConfiguration { api_key : Optional[str] library_client_config_path : Optional[str] @@ -105,10 +132,29 @@ class "UserDataCollection" as src.models.config.UserDataCollection { transcripts_storage : Optional[str] check_storage_location_is_set_when_needed() -> Self } +src.models.config.AccessRule --|> src.models.config.ConfigurationBase +src.models.config.AuthenticationConfiguration --|> src.models.config.ConfigurationBase +src.models.config.AuthorizationConfiguration --|> src.models.config.ConfigurationBase +src.models.config.CORSConfiguration --|> src.models.config.ConfigurationBase +src.models.config.Configuration --|> src.models.config.ConfigurationBase +src.models.config.Customization --|> src.models.config.ConfigurationBase +src.models.config.DatabaseConfiguration --|> src.models.config.ConfigurationBase +src.models.config.InferenceConfiguration --|> src.models.config.ConfigurationBase +src.models.config.JwkConfiguration --|> src.models.config.ConfigurationBase +src.models.config.JwtConfiguration --|> src.models.config.ConfigurationBase +src.models.config.JwtRoleRule --|> src.models.config.ConfigurationBase +src.models.config.LlamaStackConfiguration --|> src.models.config.ConfigurationBase +src.models.config.ModelContextProtocolServer --|> src.models.config.ConfigurationBase +src.models.config.PostgreSQLDatabaseConfiguration --|> src.models.config.ConfigurationBase +src.models.config.SQLiteDatabaseConfiguration --|> src.models.config.ConfigurationBase +src.models.config.ServiceConfiguration --|> src.models.config.ConfigurationBase +src.models.config.TLSConfiguration --|> src.models.config.ConfigurationBase +src.models.config.UserDataCollection --|> src.models.config.ConfigurationBase src.models.config.AuthenticationConfiguration --* src.models.config.Configuration : authentication src.models.config.CORSConfiguration --* src.models.config.ServiceConfiguration : cors src.models.config.DatabaseConfiguration --* src.models.config.Configuration : database src.models.config.InferenceConfiguration --* src.models.config.Configuration : inference +src.models.config.JsonPathOperator --* src.models.config.JwtRoleRule : operator src.models.config.JwtConfiguration --* src.models.config.JwkConfiguration : jwt_configuration src.models.config.LlamaStackConfiguration --* src.models.config.Configuration : llama_stack src.models.config.SQLiteDatabaseConfiguration --* src.models.config.DatabaseConfiguration : sqlite diff --git a/docs/config.svg b/docs/config.svg index b4f8c086..8ec02c99 100644 --- a/docs/config.svg +++ b/docs/config.svg @@ -1,277 +1,442 @@ - + + + + + + + AccessRule + + actions : list[Action] + role : str + + + + + + + + Action + + name + + - - - - AuthenticationConfiguration - - jwk_config : Optional[JwkConfiguration] - jwk_configuration - k8s_ca_cert_path : Optional[FilePath] - k8s_cluster_api : Optional[AnyHttpUrl] - module : str - skip_tls_verification : bool - - check_authentication_model() -> Self + + + + AuthenticationConfiguration + + jwk_config : Optional[JwkConfiguration] + jwk_configuration + k8s_ca_cert_path : Optional[FilePath] + k8s_cluster_api : Optional[AnyHttpUrl] + module : str + skip_tls_verification : bool + + check_authentication_model() -> Self + + + + + + + AuthorizationConfiguration + + access_rules : Optional[list[AccessRule]] + - - - - CORSConfiguration - - allow_credentials : bool - allow_headers : list[str] - allow_methods : list[str] - allow_origins : list[str] - - check_cors_configuration() -> Self + + + + CORSConfiguration + + allow_credentials : bool + allow_headers : list[str] + allow_methods : list[str] + allow_origins : list[str] + + check_cors_configuration() -> Self - - - - Configuration - - authentication - customization : Optional[Customization] - database - inference - llama_stack - mcp_servers : list[ModelContextProtocolServer] - name : str - service - user_data_collection - - dump(filename: str) -> None + + + + Configuration + + authentication + authorization : Optional[AuthorizationConfiguration] + customization : Optional[Customization] + database + inference + llama_stack + mcp_servers : list[ModelContextProtocolServer] + name : str + service + user_data_collection + + dump(filename: str) -> None + + + + + + + ConfigurationBase + + model_config + - - - - Customization - - disable_query_system_prompt : bool - system_prompt : Optional[str] - system_prompt_path : Optional[FilePath] - - check_customization_model() -> Self + + + + Customization + + disable_query_system_prompt : bool + system_prompt : Optional[str] + system_prompt_path : Optional[FilePath] + + check_customization_model() -> Self - - - - DatabaseConfiguration - - config - db_type - postgres : Optional[PostgreSQLDatabaseConfiguration] - sqlite : Optional[SQLiteDatabaseConfiguration] - - check_database_configuration() -> Self + + + + DatabaseConfiguration + + config + db_type + postgres : Optional[PostgreSQLDatabaseConfiguration] + sqlite : Optional[SQLiteDatabaseConfiguration] + + check_database_configuration() -> Self - - - - InferenceConfiguration - - default_model : Optional[str] - default_provider : Optional[str] - - check_default_model_and_provider() -> Self + + + + InferenceConfiguration + + default_model : Optional[str] + default_provider : Optional[str] + + check_default_model_and_provider() -> Self + + + + + + + JsonPathOperator + + name + - - - - JwkConfiguration - - jwt_configuration - url : AnyHttpUrl - + + + + JwkConfiguration + + jwt_configuration + url : AnyHttpUrl + - - - - JwtConfiguration - - user_id_claim : str - username_claim : str - + + + + JwtConfiguration + + role_rules : Optional[list[JwtRoleRule]] + user_id_claim : str + username_claim : str + + + + + + + + JwtRoleRule + + jsonpath : str + negate : bool + operator + roles : list[str] + value : Any + + check_jsonpath() -> Self + check_roles() -> Self - - - - LlamaStackConfiguration - - api_key : Optional[str] - library_client_config_path : Optional[str] - url : Optional[str] - use_as_library_client : Optional[bool] - - check_llama_stack_model() -> Self + + + + LlamaStackConfiguration + + api_key : Optional[str] + library_client_config_path : Optional[str] + url : Optional[str] + use_as_library_client : Optional[bool] + + check_llama_stack_model() -> Self - - - - ModelContextProtocolServer - - name : str - provider_id : str - url : str - + + + + ModelContextProtocolServer + + name : str + provider_id : str + url : str + - - - - PostgreSQLDatabaseConfiguration - - ca_cert_path : Optional[FilePath] - db : str - gss_encmode : str - host : str - namespace : Optional[str] - password : str - port : Annotated - ssl_mode : str - user : str - - check_postgres_configuration() -> Self + + + + PostgreSQLDatabaseConfiguration + + ca_cert_path : Optional[FilePath] + db : str + gss_encmode : str + host : str + namespace : Optional[str] + password : str + port : Annotated + ssl_mode : str + user : str + + check_postgres_configuration() -> Self - - - - SQLiteDatabaseConfiguration - - db_path : str - + + + + SQLiteDatabaseConfiguration + + db_path : str + - - - - ServiceConfiguration - - access_log : bool - auth_enabled : bool - color_log : bool - cors - host : str - port : Annotated - tls_config - workers : Annotated - - check_service_configuration() -> Self + + + + ServiceConfiguration + + access_log : bool + auth_enabled : bool + color_log : bool + cors + host : str + port : Annotated + tls_config + workers : Annotated + + check_service_configuration() -> Self - - - - TLSConfiguration - - tls_certificate_path : Optional[FilePath] - tls_key_password : Optional[FilePath] - tls_key_path : Optional[FilePath] - - check_tls_configuration() -> Self + + + + TLSConfiguration + + tls_certificate_path : Optional[FilePath] + tls_key_password : Optional[FilePath] + tls_key_path : Optional[FilePath] + + check_tls_configuration() -> Self - - - - UserDataCollection - - feedback_enabled : bool - feedback_storage : Optional[str] - transcripts_enabled : bool - transcripts_storage : Optional[str] - - check_storage_location_is_set_when_needed() -> Self + + + + UserDataCollection + + feedback_enabled : bool + feedback_storage : Optional[str] + transcripts_enabled : bool + transcripts_storage : Optional[str] + + check_storage_location_is_set_when_needed() -> Self + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - authentication + + + authentication - - - cors + + + cors - - - database + + + database - - - inference + + + inference + + + + + + operator - - - jwt_configuration + + + jwt_configuration - - - llama_stack + + + llama_stack - - - sqlite + + + sqlite - - - service + + + service - - - tls_config + + + tls_config - - - user_data_collection + + + user_data_collection - +