Add basic authentication option for Telegram bot (#148247)

This commit is contained in:
hanwg 2025-07-08 04:08:49 +08:00 committed by GitHub
parent 9d2ffa6372
commit 0409c05265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 58 additions and 45 deletions

View File

@ -82,6 +82,14 @@ send_photo:
example: "My image" example: "My image"
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -90,13 +98,6 @@ send_photo:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:
@ -163,6 +164,14 @@ send_sticker:
example: CAACAgIAAxkBAAEDDldhZD-hqWclr6krLq-FWSfCrGNmOQAC9gAD9HsZAAFeYY-ltPYnrCEE example: CAACAgIAAxkBAAEDDldhZD-hqWclr6krLq-FWSfCrGNmOQAC9gAD9HsZAAFeYY-ltPYnrCEE
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -171,13 +180,6 @@ send_sticker:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:
@ -235,6 +237,14 @@ send_animation:
example: "My animation" example: "My animation"
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -243,13 +253,6 @@ send_animation:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:
@ -316,6 +319,14 @@ send_video:
example: "My video" example: "My video"
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -324,13 +335,6 @@ send_video:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:
@ -397,6 +401,14 @@ send_voice:
example: "My microphone recording" example: "My microphone recording"
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -405,13 +417,6 @@ send_voice:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:
@ -469,6 +474,14 @@ send_document:
example: Document Title xy example: Document Title xy
selector: selector:
text: text:
authentication:
selector:
select:
options:
- "basic"
- "digest"
- "bearer_token"
translation_key: "authentication"
username: username:
example: myuser example: myuser
selector: selector:
@ -477,13 +490,6 @@ send_document:
example: myuser_pwd example: myuser_pwd
selector: selector:
text: text:
authentication:
default: digest
selector:
select:
options:
- "digest"
- "bearer_token"
target: target:
example: "[12345, 67890] or 12345" example: "[12345, 67890] or 12345"
selector: selector:

View File

@ -130,6 +130,13 @@
"html": "HTML", "html": "HTML",
"plain_text": "Plain text" "plain_text": "Plain text"
} }
},
"authentication": {
"options": {
"basic": "Basic",
"digest": "Digest",
"bearer_token": "Bearer token"
}
} }
}, },
"services": { "services": {
@ -213,15 +220,15 @@
}, },
"username": { "username": {
"name": "[%key:common::config_flow::data::username%]", "name": "[%key:common::config_flow::data::username%]",
"description": "Username for a URL which require HTTP authentication." "description": "Username for a URL which requires HTTP `basic` or `digest` authentication."
}, },
"password": { "password": {
"name": "[%key:common::config_flow::data::password%]", "name": "[%key:common::config_flow::data::password%]",
"description": "Password (or bearer token) for a URL which require HTTP authentication." "description": "Password (or bearer token) for a URL which require authentication."
}, },
"authentication": { "authentication": {
"name": "Authentication method", "name": "Authentication method",
"description": "Define which authentication method to use. Set to `digest` to use HTTP digest authentication, or `bearer_token` for OAuth 2.0 bearer token authentication. Defaults to `basic`." "description": "Define which authentication method to use. Set to `basic` for HTTP basic authentication, `digest` for HTTP digest authentication, or `bearer_token` for OAuth 2.0 bearer token authentication."
}, },
"target": { "target": {
"name": "Target", "name": "Target",