import "common.proto";
import "common_base.proto";

message CAuthenticationSupport_GetTokenHistory_Request {
	optional fixed64 token_id = 1;
}

message CAuthenticationSupport_GetTokenHistory_Response {
	repeated .CSupportRefreshTokenAudit history = 1;
}

message CAuthenticationSupport_QueryRefreshTokenByID_Request {
	optional fixed64 token_id = 1;
}

message CAuthenticationSupport_QueryRefreshTokenByID_Response {
	repeated .CSupportRefreshTokenDescription refresh_tokens = 1;
}

message CAuthenticationSupport_QueryRefreshTokensByAccount_Request {
	optional fixed64 steamid = 1;
	optional bool include_revoked_tokens = 2;
}

message CAuthenticationSupport_QueryRefreshTokensByAccount_Response {
	repeated .CSupportRefreshTokenDescription refresh_tokens = 1;
}

message CAuthenticationSupport_RevokeToken_Request {
	optional fixed64 token_id = 1;
	optional fixed64 steamid = 2;
}

message CAuthenticationSupport_RevokeToken_Response {
}

message CSupportRefreshTokenAudit {
	optional int32 action = 1;
	optional uint32 time = 2;
	optional .CMsgIPAddress ip = 3;
	optional fixed64 actor = 4;
}

message CSupportRefreshTokenDescription {
	optional fixed64 token_id = 1;
	optional string token_description = 2;
	optional uint32 time_updated = 3;
	optional int32 platform_type = 4 [(.description) = "enum"];
	optional int32 token_state = 5 [(.description) = "enum"];
	optional fixed64 owner_steamid = 6;
	optional uint32 os_platform = 7;
	optional int32 os_type = 8;
	optional uint32 auth_type = 9;
	optional uint32 gaming_device_type = 10;
	optional .CSupportRefreshTokenDescription_TokenUsageEvent first_seen = 11;
	optional .CSupportRefreshTokenDescription_TokenUsageEvent last_seen = 12;
}

message CSupportRefreshTokenDescription_TokenUsageEvent {
	optional uint32 time = 1;
	optional .CMsgIPAddress ip = 2;
	optional string country = 3;
	optional string state = 4;
	optional string city = 5;
}

service AuthenticationSupport {
	rpc GetTokenHistory (.CAuthenticationSupport_GetTokenHistory_Request) returns (.CAuthenticationSupport_GetTokenHistory_Response);
	rpc QueryRefreshTokenByID (.CAuthenticationSupport_QueryRefreshTokenByID_Request) returns (.CAuthenticationSupport_QueryRefreshTokenByID_Response);
	rpc QueryRefreshTokensByAccount (.CAuthenticationSupport_QueryRefreshTokensByAccount_Request) returns (.CAuthenticationSupport_QueryRefreshTokensByAccount_Response);
	rpc RevokeToken (.CAuthenticationSupport_RevokeToken_Request) returns (.CAuthenticationSupport_RevokeToken_Response);
}

