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

View File

@ -130,6 +130,13 @@
"html": "HTML",
"plain_text": "Plain text"
}
},
"authentication": {
"options": {
"basic": "Basic",
"digest": "Digest",
"bearer_token": "Bearer token"
}
}
},
"services": {
@ -213,15 +220,15 @@
},
"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": {
"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": {
"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": {
"name": "Target",