Documentation ¶
Index ¶
Constants ¶
const ( // DoLoginURI URL used for login DoLoginURI string = "/login/dologin" // IsLoggedInURI URL used to check if user is logged in IsLoggedInURI string = "/actions/GetNotificationCounts" )
const GetRSAKeyURI = "/login/getrsakey"
GetRSAKeyURI is the URI used to get the RSA Key in prod
Variables ¶
var ErrCaptchaNeededNeeded = errors.New("Captcha needed")
ErrCaptchaNeededNeeded is returned when the login requires a captcha
var ErrEmailAuthNeeded = errors.New("Email auth needed")
ErrEmailAuthNeeded is returned when the login requires an email code
var ErrTwoFactorNeeded = errors.New("Two factor auth needed")
ErrTwoFactorNeeded is returned when the user needs to give a two factor code
Functions ¶
func AlignTime ¶
func AlignTime() error
AlignTime Aligns system time with the Steam server time. Not super advanced; probably not taking some things into account that it should. Necessary to generate up-to-date codes. In general, this will have an error of less than a second, assuming Steam is operational.
func EncryptPassword ¶
EncryptPassword will RSA encode the password with the key provided
func GetSteamTime ¶
func GetSteamTime() int64
GetSteamTime return the time adjusted with the steam diff
Types ¶
type OAuth ¶
type OAuth struct { SteamID mangosteam.SteamID `db:"osteam_id" json:"steamid,string"` OAuthToken string `json:"auth"` Token string `json:"token"` TokenSecure string `json:"token_secure"` LastSessionID string `json:"webcookie"` }
OAuth is what will be used in future requests to specify we are logged in
type RSAKey ¶
type RSAKey struct { PublicKeyModulus string `json:"publickey_mod"` PublicKeyExponent string `json:"publickey_exp"` Timestamp string `json:"timestamp"` }
RSAKey represent the key for encoding password
type SteamGuardAccount ¶
type SteamGuardAccount struct { SerialNumber string `json:"serial_number"` RevocationCode string `json:"revocation_code"` URI string `json:"uri"` ServerTime int64 `json:"server_time,string"` AccountName string `json:"account_name"` TokenGID string `json:"token_gid"` IdentitySecret string `json:"identity_secret"` Secret1 string `json:"secret_1"` Status int32 `json:"status"` DeviceID string `json:"device_id"` // Set to true if the authenticator has actually been applied to the account. FullyEnrolled bool `json:"fully_enrolled"` }
SteamGuardAccount represents the data needed to generate a code
func (*SteamGuardAccount) GenerateSteamGuardCode ¶
func (a *SteamGuardAccount) GenerateSteamGuardCode() (string, error)
GenerateSteamGuardCode gives a steamgaurd code for login
func (*SteamGuardAccount) GenerateSteamGuardCodeForTime ¶
func (a *SteamGuardAccount) GenerateSteamGuardCodeForTime(t int64) (string, error)
GenerateSteamGuardCodeForTime according to the server time