Skip to content

Fix auth failure: Ssid::Display returns raw auth message instead of debug label#72

Merged
theshadow76 merged 2 commits intomasterfrom
copilot/fix-auth-errors-ssid
Mar 3, 2026
Merged

Fix auth failure: Ssid::Display returns raw auth message instead of debug label#72
theshadow76 merged 2 commits intomasterfrom
copilot/fix-auth-errors-ssid

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

Ssid::to_string() was returning human-readable labels ("DemoSsid(uid=..., demo=true)", "RealSsid(uid=..., demo=false)") instead of the original Socket.IO auth frame. Since InitModule uses ssid.to_string() to send credentials during the WebSocket handshake, the server received an invalid message and rejected every connection.

Changes

  • ssid.rsDisplay for Demo and Real now returns self.raw (the captured original string, e.g. 42["auth",{"session":"...","isDemo":0,"uid":12345,"platform":2}]) instead of the debug label.
// Before
impl fmt::Display for Demo {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "DemoSsid(uid={}, demo=true)", self.uid)  // sent to server — rejected
    }
}

// After
impl fmt::Display for Demo {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.raw)  // e.g. 42["auth",{...}]
    }
}

This also fixes the pre-existing failing test_parse_ssid unit test, which asserts that Ssid::parse(ssid.to_string()) round-trips correctly — impossible when to_string() produces an unparseable string.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.ipify.org
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1eu.expertoption.com
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1eu.expertoption.finance
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1hk.expertoption.com
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1hk.expertoption.finance
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1in.expertoption.com
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1in.expertoption.finance
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1sg.expertoption.com
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1sg.expertoption.finance
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1us.expertoption.com
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • fr24g1us.expertoption.finance
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • httpbin.org
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • i.pn
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • ifconfig.co
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • ip.pn
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • ipapi.co
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • ipv4.myip.coffee
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)
  • ipwho.is
    • Triggering command: /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 /home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_options_tools/target/debug/deps/binary_options_tools-2678295eb6eb95d8 cfg(feature, values()) -C metadata=cccdbdd16cfc308b 253a�� ons_tools/target/debug/deps/libproc_macro2-69a0217bb9567edd.rlib ons_tools/target/debug/deps/libunicode_ident-498eaa0ff289065f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc tionsTools-v2/crcc tionsTools-v2/cr-Wl,--version-script=/tmp/rustc5HnBO8/list ates/binary_opti-Wl,--no-undefined-version lib/rustlib/x86_-m64 lib/�� lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_optibash lib/rustlib/x86_/home/REDACTED/work/BinaryOptionsTools-v2/BinaryOptionsTools-v2/crates/binary_opti--norc bin/rustc ates/binary_optigit ript_build-22200ls-files ates/binary_opti--exclude-standard bin/rustc (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>auth errors with valid ssid</issue_title>
<issue_description>## Description

Authorization algorithm not working properly.

Reproduction

  1. Copy basic code from candles tutorial
  2. Auth does not pass

Expected Behavior

    try:
        success = await api.connect()

        if success is True:
            print("connection + auth successful")
        else:
            print("connection returned false -> auth problem") # this is what is being printed
    except Exception as e:
        print(f"connection / auth failed immediately: {type(e).__name__}: {e}")

Should pass successfully

Context

  • macOS Tahoe 26.4:
  • Python 3.14.3_1:
  • binaryoptionstoolsv2 0.2.8:
  • pip

Evidence

Code Sample

    ssid = config.SSID.get_secret_value()
    api = PocketOptionAsync(ssid)
    
    try:
        success = await api.connect()

        if success is True:
            print("connection + auth successful")
        else:
            print("connection returned false -> auth problem")
    except Exception as e:
        print(f"connection / auth failed immediately: {type(e).__name__}: {e}")
        

Error Logs

connection returned false -> auth problem

Additional Information

The login/subscription algorithm might be updated.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…play impl

Co-authored-by: theshadow76 <59869868+theshadow76@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix authorization algorithm for valid SSID Fix auth failure: Ssid::Display returns raw auth message instead of debug label Mar 3, 2026
@theshadow76 theshadow76 marked this pull request as ready for review March 3, 2026 17:52
Copilot AI review requested due to automatic review settings March 3, 2026 17:52
@theshadow76 theshadow76 merged commit 94309a5 into master Mar 3, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes PocketOption WebSocket authentication failures caused by sending a human-readable SSID label instead of the original Socket.IO 42["auth", ...] frame during the handshake.

Changes:

  • Update fmt::Display for SSID variants to output the captured raw auth frame so .to_string() round-trips and can be sent to the server.
  • Add an Unreleased changelog entry describing the auth fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/binary_options_tools/src/pocketoption/ssid.rs Changes Display for Demo/Real to return self.raw (the Socket.IO auth message).
CHANGELOG.md Documents the SSID/auth fix under Unreleased.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 306 to 315
impl fmt::Display for Demo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DemoSsid(uid={}, demo=true)", self.uid)
write!(f, "{}", self.raw)
}
}

impl fmt::Display for Real {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "RealSsid(uid={}, demo=false)", self.uid)
write!(f, "{}", self.raw)
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Display for Demo/Real unconditionally prints self.raw, but raw can be empty when these structs are constructed directly (e.g., in tests/examples that use raw: String::new()). In that case .to_string() becomes an empty credential string and would break any code that relies on it. Consider a fallback when raw.is_empty() (e.g., reconstruct the 42["auth",...] frame from the struct fields / json_raw), or make raw non-empty by construction (private fields + constructor).

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
### Fixed

- N/a
- Fixed auth failure with valid SSID: `Ssid::Display` now returns the raw auth message (`42["auth",{...}]`) instead of a human-readable label, so the correct credential string is sent to the server during WebSocket handshake.
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry refers to Ssid::Display, which isn’t an actual item/path in Rust. Consider rewording to something like “Display impl for Ssid (and its Demo/Real variants) now returns the captured raw auth frame …” to avoid confusing readers.

Suggested change
- Fixed auth failure with valid SSID: `Ssid::Display` now returns the raw auth message (`42["auth",{...}]`) instead of a human-readable label, so the correct credential string is sent to the server during WebSocket handshake.
- Fixed auth failure with valid SSID: the `Display` implementation for `Ssid` (and its `Demo`/`Real` variants) now returns the captured raw auth frame (`42["auth",{...}]`) instead of a human-readable label, so the correct credential string is sent to the server during the WebSocket handshake.

Copilot uses AI. Check for mistakes.
Comment on lines 306 to 315
impl fmt::Display for Demo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DemoSsid(uid={}, demo=true)", self.uid)
write!(f, "{}", self.raw)
}
}

impl fmt::Display for Real {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "RealSsid(uid={}, demo=false)", self.uid)
write!(f, "{}", self.raw)
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt::Display now returns the full raw Socket.IO auth frame, which includes sensitive session credentials. This makes accidental logging/printing via {} / .to_string() a credential leak. Consider keeping Display redacted/human-readable and adding an explicit API for the raw auth payload (and update the handshake code to use that), or otherwise ensuring the displayed value is safely redacted.

Copilot uses AI. Check for mistakes.
@sixtysixx sixtysixx deleted the copilot/fix-auth-errors-ssid branch March 4, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth errors with valid ssid

3 participants