From a2d37b818384a18ac3350aafac1d12181bd65ea1 Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Mon, 2 Mar 2026 18:04:27 +0800 Subject: [PATCH] docs: add private site password hint to all API docs (#850) docs: add x-custom-auth private site password hint to all API docs Co-authored-by: Claude Opus 4.6 --- .../docs/en/guide/feature/mail-api.md | 32 +++++++++++++++---- .../docs/en/guide/feature/new-address-api.md | 2 ++ .../docs/en/guide/feature/send-mail-api.md | 3 +- .../docs/zh/guide/feature/mail-api.md | 32 +++++++++++++++---- .../docs/zh/guide/feature/new-address-api.md | 2 ++ .../docs/zh/guide/feature/send-mail-api.md | 3 +- 6 files changed, 58 insertions(+), 16 deletions(-) diff --git a/vitepress-docs/docs/en/guide/feature/mail-api.md b/vitepress-docs/docs/en/guide/feature/mail-api.md index 8035cbe7..1dc631db 100644 --- a/vitepress-docs/docs/en/guide/feature/mail-api.md +++ b/vitepress-docs/docs/en/guide/feature/mail-api.md @@ -11,7 +11,7 @@ res = requests.get( f"https:///api/mails?limit={limit}&offset={offset}", headers={ "Authorization": f"Bearer {your-JWT-password}", - # "x-custom-auth": "", # If custom password is enabled + # "x-custom-auth": "", # If private site password is enabled "Content-Type": "application/json" } ) @@ -33,7 +33,10 @@ querystring = { "address":"xxxx@awsl.uk" } -headers = {"x-admin-auth": ""} +headers = { + "x-admin-auth": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.get(url, headers=headers, params=querystring) @@ -52,7 +55,10 @@ import requests mail_id = 1 url = f"https:///admin/mails/{mail_id}" -headers = {"x-admin-auth": ""} +headers = { + "x-admin-auth": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.delete(url, headers=headers) @@ -69,7 +75,10 @@ import requests address_id = 1 url = f"https:///admin/delete_address/{address_id}" -headers = {"x-admin-auth": ""} +headers = { + "x-admin-auth": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.delete(url, headers=headers) @@ -86,7 +95,10 @@ import requests address_id = 1 url = f"https:///admin/clear_inbox/{address_id}" -headers = {"x-admin-auth": ""} +headers = { + "x-admin-auth": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.delete(url, headers=headers) @@ -103,7 +115,10 @@ import requests address_id = 1 url = f"https:///admin/clear_sent_items/{address_id}" -headers = {"x-admin-auth": ""} +headers = { + "x-admin-auth": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.delete(url, headers=headers) @@ -126,7 +141,10 @@ querystring = { "address":"xxxx@awsl.uk" } -headers = {"x-user-token": ""} +headers = { + "x-user-token": "", + # "x-custom-auth": "", # If private site password is enabled + } response = requests.get(url, headers=headers, params=querystring) diff --git a/vitepress-docs/docs/en/guide/feature/new-address-api.md b/vitepress-docs/docs/en/guide/feature/new-address-api.md index d98c25e1..147700ba 100644 --- a/vitepress-docs/docs/en/guide/feature/new-address-api.md +++ b/vitepress-docs/docs/en/guide/feature/new-address-api.md @@ -16,6 +16,7 @@ res = requests.post( }, headers={ 'x-admin-auth': "", + # "x-custom-auth": "", # If private site password is enabled "Content-Type": "application/json" } ) @@ -59,6 +60,7 @@ def fetch_email_data(name): }, headers={ 'x-admin-auth': "", + # "x-custom-auth": "", # If private site password is enabled "Content-Type": "application/json" } ) diff --git a/vitepress-docs/docs/en/guide/feature/send-mail-api.md b/vitepress-docs/docs/en/guide/feature/send-mail-api.md index 2091b3e9..a4f4e16a 100644 --- a/vitepress-docs/docs/en/guide/feature/send-mail-api.md +++ b/vitepress-docs/docs/en/guide/feature/send-mail-api.md @@ -18,7 +18,7 @@ res = requests.post( "http://localhost:8787/api/send_mail", json=send_body, headers={ "Authorization": f"Bearer {your_JWT_password}", - # "x-custom-auth": "", # If custom password is enabled + # "x-custom-auth": "", # If private site password is enabled "Content-Type": "application/json" } ) @@ -36,6 +36,7 @@ send_body = { res = requests.post( "http://localhost:8787/external/api/send_mail", json=send_body, headers={ + # "x-custom-auth": "", # If private site password is enabled "Content-Type": "application/json" } ) diff --git a/vitepress-docs/docs/zh/guide/feature/mail-api.md b/vitepress-docs/docs/zh/guide/feature/mail-api.md index 913b6ad5..7669fd33 100644 --- a/vitepress-docs/docs/zh/guide/feature/mail-api.md +++ b/vitepress-docs/docs/zh/guide/feature/mail-api.md @@ -11,7 +11,7 @@ res = requests.get( f"https://<你的worker地址>/api/mails?limit={limit}&offset={offset}", headers={ "Authorization": f"Bearer {你的JWT密码}", - # "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码 + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 "Content-Type": "application/json" } ) @@ -33,7 +33,10 @@ querystring = { "address":"xxxx@awsl.uk" } -headers = {"x-admin-auth": "<你的Admin密码>"} +headers = { + "x-admin-auth": "<你的Admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.get(url, headers=headers, params=querystring) @@ -52,7 +55,10 @@ import requests mail_id = 1 url = f"https://<你的worker地址>/admin/mails/{mail_id}" -headers = {"x-admin-auth": "<你的Admin密码>"} +headers = { + "x-admin-auth": "<你的Admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.delete(url, headers=headers) @@ -69,7 +75,10 @@ import requests address_id = 1 url = f"https://<你的worker地址>/admin/delete_address/{address_id}" -headers = {"x-admin-auth": "<你的Admin密码>"} +headers = { + "x-admin-auth": "<你的Admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.delete(url, headers=headers) @@ -86,7 +95,10 @@ import requests address_id = 1 url = f"https://<你的worker地址>/admin/clear_inbox/{address_id}" -headers = {"x-admin-auth": "<你的Admin密码>"} +headers = { + "x-admin-auth": "<你的Admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.delete(url, headers=headers) @@ -103,7 +115,10 @@ import requests address_id = 1 url = f"https://<你的worker地址>/admin/clear_sent_items/{address_id}" -headers = {"x-admin-auth": "<你的Admin密码>"} +headers = { + "x-admin-auth": "<你的Admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.delete(url, headers=headers) @@ -126,7 +141,10 @@ querystring = { "address":"xxxx@awsl.uk" } -headers = {"x-user-token": "<你的用户JWT Token>"} +headers = { + "x-user-token": "<你的用户JWT Token>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 + } response = requests.get(url, headers=headers, params=querystring) diff --git a/vitepress-docs/docs/zh/guide/feature/new-address-api.md b/vitepress-docs/docs/zh/guide/feature/new-address-api.md index df17477a..0efe3835 100644 --- a/vitepress-docs/docs/zh/guide/feature/new-address-api.md +++ b/vitepress-docs/docs/zh/guide/feature/new-address-api.md @@ -16,6 +16,7 @@ res = requests.post( }, headers={ 'x-admin-auth': "<你的网站admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 "Content-Type": "application/json" } ) @@ -59,6 +60,7 @@ def fetch_email_data(name): }, headers={ 'x-admin-auth': "<你的网站admin密码>", + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 "Content-Type": "application/json" } ) diff --git a/vitepress-docs/docs/zh/guide/feature/send-mail-api.md b/vitepress-docs/docs/zh/guide/feature/send-mail-api.md index befb9ce5..7510bf8d 100644 --- a/vitepress-docs/docs/zh/guide/feature/send-mail-api.md +++ b/vitepress-docs/docs/zh/guide/feature/send-mail-api.md @@ -18,7 +18,7 @@ res = requests.post( "http://localhost:8787/api/send_mail", json=send_body, headers={ "Authorization": f"Bearer {你的JWT密码}", - # "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码 + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 "Content-Type": "application/json" } ) @@ -36,6 +36,7 @@ send_body = { res = requests.post( "http://localhost:8787/external/api/send_mail", json=send_body, headers={ + # "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码 "Content-Type": "application/json" } )