{
  "openapi": "3.0.0",
  "info": {
    "title": "n8n 公共 API",
    "version": "1.1.1"
  },
  "components": {
    "schemas": {
      "samlConfigurationPublicDto.generated": {
        "type": "object",
        "properties": {
          "entityID": {
            "type": "string",
            "description": "服务提供方实体 ID，即元数据 URL。",
            "readOnly": true
          },
          "returnUrl": {
            "type": "string",
            "description": "断言消费服务（ACS）返回 URL。",
            "readOnly": true
          },
          "mapping": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "description": "映射到用户邮箱的 SAML 属性。"
              },
              "firstName": {
                "type": "string",
                "description": "映射到用户名字的 SAML 属性。"
              },
              "lastName": {
                "type": "string",
                "description": "映射到用户姓氏的 SAML 属性。"
              },
              "userPrincipalName": {
                "type": "string",
                "description": "映射到用户主体名称的 SAML 属性。"
              },
              "emailVerified": {
                "type": "string",
                "description": "表明身份提供方是否已验证用户邮箱的 SAML 属性；未使用时为空字符串。"
              },
              "n8nInstanceRole": {
                "type": "string",
                "description": "映射到 n8n 实例角色的 SAML 属性。"
              },
              "n8nProjectRoles": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "映射到 n8n 项目角色的 SAML 属性，格式为 `<projectId>:<role>`。"
              }
            },
            "required": [
              "email",
              "firstName",
              "lastName",
              "userPrincipalName",
              "emailVerified",
              "n8nInstanceRole",
              "n8nProjectRoles"
            ],
            "description": "SAML 属性到 n8n 用户字段的映射。",
            "additionalProperties": false
          },
          "metadata": {
            "type": "string",
            "description": "XML 格式的身份提供方元数据。由于包含 IdP 证书，已设置时会在读取时遮蔽，绝不以明文返回。未设置时使用空字符串。"
          },
          "metadataUrl": {
            "type": "string",
            "description": "获取身份提供方元数据的 URL；未设置时使用空字符串。"
          },
          "ignoreSSL": {
            "type": "boolean",
            "description": "通过 URL 获取元数据时，是否忽略 SSL 证书错误。"
          },
          "loginBinding": {
            "type": "string",
            "enum": [
              "redirect",
              "post"
            ],
            "description": "SAML 登录请求的绑定方式。"
          },
          "loginEnabled": {
            "type": "boolean",
            "description": "是否启用 SAML 登录。"
          },
          "loginLabel": {
            "type": "string",
            "description": "SAML 登录按钮显示的标签。"
          },
          "authnRequestsSigned": {
            "type": "boolean",
            "description": "是否对身份验证请求签名。"
          },
          "wantAssertionsSigned": {
            "type": "boolean",
            "description": "是否要求断言带有签名。"
          },
          "wantMessageSigned": {
            "type": "boolean",
            "description": "是否要求 SAML 消息带有签名。"
          },
          "emailVerifiedRequired": {
            "type": "boolean",
            "description": "按邮箱将登录关联到现有用户之前，是否要求身份提供方断言用户邮箱已验证。关闭时，只有明确的否定断言会被拒绝。"
          },
          "signingPrivateKey": {
            "type": "string",
            "description": "用于签署 SAML AuthnRequests 的 PEM 编码私钥。已设置时，读取会遮蔽，绝不以明文返回。未设置时使用空字符串。"
          },
          "signingCertificate": {
            "type": "string",
            "description": "PEM 编码证书，包含与签名私钥匹配的公钥。已设置时，读取会遮蔽，绝不以明文返回。未设置时使用空字符串。"
          },
          "acsBinding": {
            "type": "string",
            "enum": [
              "redirect",
              "post"
            ],
            "description": "断言消费服务的绑定方式。"
          },
          "signatureConfig": {
            "type": "object",
            "properties": {
              "prefix": {
                "type": "string"
              },
              "location": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "before",
                      "after",
                      "prepend",
                      "append"
                    ]
                  }
                },
                "required": [
                  "reference",
                  "action"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "prefix",
              "location"
            ],
            "description": "SAML 请求与响应中的签名配置。",
            "additionalProperties": false
          },
          "relayState": {
            "type": "string",
            "description": "SAML 请求的默认 relay state 值；未设置时使用空字符串。"
          }
        },
        "required": [
          "entityID",
          "returnUrl",
          "mapping",
          "metadata",
          "metadataUrl",
          "ignoreSSL",
          "loginBinding",
          "loginEnabled",
          "loginLabel",
          "authnRequestsSigned",
          "wantAssertionsSigned",
          "wantMessageSigned",
          "emailVerifiedRequired",
          "signingPrivateKey",
          "signingCertificate",
          "acsBinding",
          "signatureConfig",
          "relayState"
        ],
        "additionalProperties": false
      }
    }
  }
}
