{
  "openapi": "3.0.0",
  "info": {
    "title": "n8n 公共 API",
    "version": "1.1.1"
  },
  "components": {
    "schemas": {
      "ldapConfigurationPublicDto.generated": {
        "type": "object",
        "properties": {
          "loginEnabled": {
            "type": "boolean",
            "description": "是否启用 LDAP 登录。"
          },
          "loginLabel": {
            "type": "string",
            "description": "LDAP 登录按钮显示的标签。"
          },
          "connectionUrl": {
            "type": "string",
            "description": "LDAP 服务器 URL。"
          },
          "allowUnauthorizedCerts": {
            "type": "boolean",
            "description": "是否允许不受信任的证书（自签名证书）。"
          },
          "connectionSecurity": {
            "type": "string",
            "enum": [
              "none",
              "tls",
              "startTls"
            ],
            "description": "LDAP 连接的 TLS/SSL 安全模式。"
          },
          "connectionPort": {
            "type": "number",
            "description": "LDAP 服务器端口。"
          },
          "baseDn": {
            "type": "string",
            "description": "LDAP 搜索查询的基础 DN。"
          },
          "bindingAdminDn": {
            "type": "string",
            "description": "用于绑定的 LDAP 管理员用户 DN。"
          },
          "bindingAdminPassword": {
            "type": "string",
            "description": "LDAP 管理员用户密码。GET 读取时会遮蔽：已存储密码时返回遮蔽占位符，未设置时返回空字符串。提交先前 GET 返回的遮蔽占位符，可保持已存储密码不变。"
          },
          "firstNameAttribute": {
            "type": "string",
            "description": "映射到用户名字的 LDAP 属性。"
          },
          "lastNameAttribute": {
            "type": "string",
            "description": "映射到用户姓氏的 LDAP 属性。"
          },
          "emailAttribute": {
            "type": "string",
            "description": "映射到用户邮箱的 LDAP 属性。"
          },
          "loginIdAttribute": {
            "type": "string",
            "description": "用于登录的 LDAP 属性，通常与 emailAttribute 相同。"
          },
          "ldapIdAttribute": {
            "type": "string",
            "description": "用于唯一标识用户的 LDAP 属性。"
          },
          "userFilter": {
            "type": "string",
            "description": "搜索用户时使用的附加 LDAP 筛选条件；空字符串表示无附加筛选条件。"
          },
          "synchronizationEnabled": {
            "type": "boolean",
            "description": "是否启用 LDAP 自动同步。"
          },
          "synchronizationInterval": {
            "type": "number",
            "description": "自动同步的间隔，单位为分钟；synchronizationEnabled 为 false 时忽略。"
          },
          "searchPageSize": {
            "type": "number",
            "description": "每页搜索获取的 LDAP 条目数量。"
          },
          "searchTimeout": {
            "type": "number",
            "description": "LDAP 搜索超时时长，单位为秒。"
          },
          "enforceEmailUniqueness": {
            "type": "boolean",
            "description": "是否强制 LDAP 用户邮箱唯一。为 true 时，如果两个用户邮箱相同，只导入第一个用户。"
          },
          "linkExistingAccountsByEmail": {
            "type": "boolean",
            "description": "是否允许将 LDAP 用户关联到邮箱相同的现有 n8n 账户。为 false 时，登录和同步都会跳过此类用户。PUT 中此字段可选，省略时保留已存储的值。"
          }
        },
        "required": [
          "loginEnabled",
          "loginLabel",
          "connectionUrl",
          "allowUnauthorizedCerts",
          "connectionSecurity",
          "connectionPort",
          "baseDn",
          "bindingAdminDn",
          "bindingAdminPassword",
          "firstNameAttribute",
          "lastNameAttribute",
          "emailAttribute",
          "loginIdAttribute",
          "ldapIdAttribute",
          "userFilter",
          "synchronizationEnabled",
          "synchronizationInterval",
          "searchPageSize",
          "searchTimeout",
          "enforceEmailUniqueness",
          "linkExistingAccountsByEmail"
        ],
        "description": "完整 LDAP 配置。GET 返回所有字段；请将完整对象作为 PUT 请求体提交。",
        "additionalProperties": false
      }
    }
  }
}
