import "steammessages_base.proto";
import "steammessages_unified_base.steamclient.proto";

option cc_generic_services = true;

message CCredentials_GetSteamGuardDetails_Request {
	optional string webcookie = 2;
	optional fixed32 timestamp_minimum_wanted = 3;
	optional int32 deprecated_ipaddress = 4;
	optional .CMsgIPAddress ip_address = 5;
}

message CCredentials_GetSteamGuardDetails_Response {
	message SessionData {
		optional uint64 machine_id = 1;
		optional string machine_name_userchosen = 2;
		optional fixed32 timestamp_machine_steamguard_enabled = 3;
		optional bool authentication_exists_from_geoloc_before_mintime = 4;
		optional bool authentication_exists_from_same_ip_before_mintime = 6;
		optional uint32 public_ipv4 = 7;
		optional string public_ip_address = 8;
	}

	optional bool is_steamguard_enabled = 1;
	optional fixed32 timestamp_steamguard_enabled = 2;
	optional string deprecated_machine_name_userchosen = 4;
	optional fixed32 deprecated_timestamp_machine_steamguard_enabled = 5;
	optional bool deprecated_authentication_exists_from_geoloc_before_mintime = 6;
	optional uint64 deprecated_machine_id = 7;
	repeated .CCredentials_GetSteamGuardDetails_Response.SessionData session_data = 8;
	optional bool is_twofactor_enabled = 9;
	optional fixed32 timestamp_twofactor_enabled = 10;
	optional bool is_phone_verified = 11;
}

message CCredentials_ValidateEmailAddress_Request {
	optional string stoken = 1;
}

message CCredentials_ValidateEmailAddress_Response {
	optional bool was_validated = 1;
}

message CCredentials_SteamGuardPhishingReport_Request {
	optional string param_string = 1;
	optional string ipaddress_actual = 2;
}

message CCredentials_SteamGuardPhishingReport_Response {
	optional string ipaddress_loginattempt = 1;
	optional string countryname_loginattempt = 2;
	optional string statename_loginattempt = 3;
	optional string cityname_loginattempt = 4;
	optional string ipaddress_actual = 5;
	optional string countryname_actual = 6;
	optional string statename_actual = 7;
	optional string cityname_actual = 8;
	optional string steamguard_code = 9;
}

message CCredentials_LastCredentialChangeTime_Request {
	optional bool user_changes_only = 1;
}

message CCredentials_LastCredentialChangeTime_Response {
	optional fixed32 timestamp_last_password_change = 1;
	optional fixed32 timestamp_last_email_change = 2;
	optional fixed32 timestamp_last_password_reset = 3;
}

message CCredentials_GetAccountAuthSecret_Request {
}

message CCredentials_GetAccountAuthSecret_Response {
	optional int32 secret_id = 1;
	optional bytes secret = 2;
}

service Credentials {
	rpc GetSteamGuardDetails (.CCredentials_GetSteamGuardDetails_Request) returns (.CCredentials_GetSteamGuardDetails_Response);
	rpc ValidateEmailAddress (.CCredentials_ValidateEmailAddress_Request) returns (.CCredentials_ValidateEmailAddress_Response);
	rpc SteamGuardPhishingReport (.CCredentials_SteamGuardPhishingReport_Request) returns (.CCredentials_SteamGuardPhishingReport_Response);
	rpc GetCredentialChangeTimeDetails (.CCredentials_LastCredentialChangeTime_Request) returns (.CCredentials_LastCredentialChangeTime_Response);
	rpc GetAccountAuthSecret (.CCredentials_GetAccountAuthSecret_Request) returns (.CCredentials_GetAccountAuthSecret_Response);
}
