package authenticator import ( "context" "crypto/hmac" "crypto/sha1" "encoding/base64" "encoding/binary" "encoding/json" "errors" "fmt" "net/http" "net/url" "regexp" "strconv" "strings" "git.wxccs.org/iceking2nd/winauth-go/internal/global" ) // Steam mobileconf endpoints. Trade confirmations live on the // community domain, not the WebAPI. const ( steamMobileConfList = "/mobileconf/conf" steamMobileConfDetails = "/mobileconf/details/" steamMobileConfAjaxOp = "/mobileconf/ajaxop" ) // Regexes ported verbatim from the C# SteamClient. The Steam mobile // confirmations page is plain HTML and Valve has not provided a JSON // alternative, so we have to scrape. Keep flags ((?is) = case-insensitive, // dot matches newline) aligned with the C# Singleline|IgnoreCase combo. var ( steamRegexTrades = regexp.MustCompile(`(?is)"mobileconf_list_entry"(.*?)>(.*?)"mobileconf_list_entry_sep"`) steamRegexTradeConfID = regexp.MustCompile(`(?is)data-confid\s*=\s*"([^"]+)"`) steamRegexTradeKey = regexp.MustCompile(`(?is)data-key\s*=\s*"([^"]+)"`) steamRegexTradePlayer = regexp.MustCompile(`(?is)"mobileconf_list_entry_icon"(.*?)src="([^"]+)"`) steamRegexTradeDetails = regexp.MustCompile(`(?is)"mobileconf_list_entry_description".*?