Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ap-proxy/src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ impl Notifier for TelegramNotifier {
if let Some(b) = buttons {
body["reply_markup"] = serde_json::json!({
"inline_keyboard": [[
{ "text": "Approve", "callback_data": b.approve },
{ "text": "Deny", "callback_data": b.deny },
{ "text": "Approve", "callback_data": b.approve },
]],
});
}
Expand Down
8 changes: 4 additions & 4 deletions crates/ap-proxy/src/notify/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ async fn buttons_message_has_only_fixed_text_id_link_and_buttons() {
format!("{TEXT}\nRequest: {HOLD_ID}\n{VIEW_URL}")
);
let row = &json["reply_markup"]["inline_keyboard"][0];
assert_eq!(row[0]["text"], "Approve");
assert_eq!(row[1]["text"], "Deny");
assert_eq!(row[0]["callback_data"], buttons.approve);
assert_eq!(row[1]["callback_data"], buttons.deny);
assert_eq!(row[0]["text"], "Deny");
assert_eq!(row[1]["text"], "Approve");
assert_eq!(row[0]["callback_data"], buttons.deny);
assert_eq!(row[1]["callback_data"], buttons.approve);
assert_eq!(buttons.approve.len(), poll::CALLBACK_DATA_LEN);
assert_eq!(buttons.deny.len(), poll::CALLBACK_DATA_LEN);
let text = json["text"].as_str().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion docs/design/muse-gated-passthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ login. Approve and deny happen in Telegram. Config: `[notify] buttons = true`, w
and `view_base_url`. `buttons = false` restores option C (3.6.1) with no code change.

- **The message.** Text: the fixed sentence, `Request: <id>`, the link `{view_base_url}/view/<token>`,
and one row of two buttons, `Approve` and `Deny`. Nothing else leaves p1: no body, header, route
and one row of two buttons, `Deny` on the left and `Approve` on the right. Nothing else leaves p1: no body, header, route
path, Discord token, digest or fingerprint. The view token is in the link, and it is the one value
in the message that reads a request (accepted risk 1).
- **Callback data.** `a` or `d`, then the 32-hex request id, then a 24-hex nonce: 57 bytes, under
Expand Down