mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
Add multi-database data layer
Introduce aether-data-schema and driver-specific schema generation for Postgres, MySQL, and SQLite. Split data backends, lifecycle, repositories, and gateway runtime integration across database drivers. Verified with cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.
This commit is contained in:
297
crates/aether-data/schema/logical/003_auth_config.toml
Normal file
297
crates/aether-data/schema/logical/003_auth_config.toml
Normal file
@@ -0,0 +1,297 @@
|
||||
[table.system_configs]
|
||||
domain = "auth_config"
|
||||
order = 10
|
||||
primary_key = ["id"]
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "id"
|
||||
type = "text_id"
|
||||
length = 64
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "key"
|
||||
type = "text"
|
||||
length = 255
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "value"
|
||||
type = "long_text"
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "description"
|
||||
type = "long_text"
|
||||
nullable = true
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "created_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.system_configs.columns]]
|
||||
name = "updated_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.system_configs.uniques]]
|
||||
name = "system_configs_key_key"
|
||||
columns = ["key"]
|
||||
|
||||
[table.auth_modules]
|
||||
domain = "auth_config"
|
||||
order = 20
|
||||
primary_key = ["id"]
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "id"
|
||||
type = "text_id"
|
||||
length = 64
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "module_type"
|
||||
type = "text"
|
||||
length = 128
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "enabled"
|
||||
type = "bool"
|
||||
default = true
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "config"
|
||||
type = "json"
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "created_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.auth_modules.columns]]
|
||||
name = "updated_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.auth_modules.uniques]]
|
||||
name = "auth_modules_module_type_key"
|
||||
columns = ["module_type"]
|
||||
|
||||
[table.oauth_providers]
|
||||
domain = "auth_config"
|
||||
order = 30
|
||||
primary_key = ["provider_type"]
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "provider_type"
|
||||
type = "text"
|
||||
length = 64
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "display_name"
|
||||
type = "text"
|
||||
length = 255
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "client_id"
|
||||
type = "long_text"
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "client_secret_encrypted"
|
||||
type = "long_text"
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "authorization_url_override"
|
||||
type = "text"
|
||||
length = 500
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "token_url_override"
|
||||
type = "text"
|
||||
length = 500
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "userinfo_url_override"
|
||||
type = "text"
|
||||
length = 500
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "scopes"
|
||||
type = "json"
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "redirect_uri"
|
||||
type = "text"
|
||||
length = 500
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "frontend_callback_url"
|
||||
type = "text"
|
||||
length = 500
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "attribute_mapping"
|
||||
type = "json"
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "extra_config"
|
||||
type = "json"
|
||||
nullable = true
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "is_enabled"
|
||||
type = "bool"
|
||||
default = false
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "created_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.oauth_providers.columns]]
|
||||
name = "updated_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[table.ldap_configs]
|
||||
domain = "auth_config"
|
||||
order = 40
|
||||
primary_key = ["id"]
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "id"
|
||||
type = "int64"
|
||||
auto_increment = true
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "server_url"
|
||||
type = "text"
|
||||
length = 255
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "bind_dn"
|
||||
type = "long_text"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "bind_password_encrypted"
|
||||
type = "long_text"
|
||||
nullable = true
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "base_dn"
|
||||
type = "long_text"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "user_search_filter"
|
||||
type = "long_text"
|
||||
default = "(uid={username})"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "username_attr"
|
||||
type = "text"
|
||||
length = 50
|
||||
default = "uid"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "email_attr"
|
||||
type = "text"
|
||||
length = 50
|
||||
default = "mail"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "display_name_attr"
|
||||
type = "text"
|
||||
length = 50
|
||||
default = "cn"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "is_enabled"
|
||||
type = "bool"
|
||||
default = false
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "is_exclusive"
|
||||
type = "bool"
|
||||
default = false
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "use_starttls"
|
||||
type = "bool"
|
||||
default = false
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "connect_timeout"
|
||||
type = "int32"
|
||||
default = 10
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "created_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.ldap_configs.columns]]
|
||||
name = "updated_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[table.user_oauth_links]
|
||||
domain = "auth_config"
|
||||
order = 50
|
||||
primary_key = ["id"]
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "id"
|
||||
type = "text_id"
|
||||
length = 64
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "user_id"
|
||||
type = "text_id"
|
||||
length = 64
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "provider_type"
|
||||
type = "text"
|
||||
length = 64
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "provider_user_id"
|
||||
type = "text"
|
||||
length = 255
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "provider_username"
|
||||
type = "text"
|
||||
length = 255
|
||||
nullable = true
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "provider_email"
|
||||
type = "text"
|
||||
length = 255
|
||||
nullable = true
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "extra_data"
|
||||
type = "json"
|
||||
nullable = true
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "linked_at"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.user_oauth_links.columns]]
|
||||
name = "last_login_at"
|
||||
type = "unix_seconds"
|
||||
nullable = true
|
||||
|
||||
[[table.user_oauth_links.indexes]]
|
||||
name = "user_oauth_links_provider_type_idx"
|
||||
columns = ["provider_type"]
|
||||
|
||||
[[table.user_oauth_links.indexes]]
|
||||
name = "user_oauth_links_user_id_idx"
|
||||
columns = ["user_id"]
|
||||
|
||||
[[table.user_oauth_links.uniques]]
|
||||
name = "uq_user_oauth_links_provider_user"
|
||||
columns = ["provider_type", "provider_user_id"]
|
||||
|
||||
[[table.user_oauth_links.uniques]]
|
||||
name = "uq_user_oauth_links_user_provider"
|
||||
columns = ["user_id", "provider_type"]
|
||||
Reference in New Issue
Block a user