feat(api/v2): store user agent details in the session (#6711)

This change adds the ability to set and get user agent data, such as fingerprint, IP, request headers and a description to the session. All fields are optional.

Closes #6028
This commit is contained in:
Tim Möhlmann
2023-10-12 15:16:59 +03:00
committed by GitHub
parent a272b1201f
commit c71bf85b7a
16 changed files with 634 additions and 147 deletions

View File

@@ -39,6 +39,7 @@ message Session {
description: "\"custom key value list\"";
}
];
UserAgent user_agent = 7;
}
message Factors {
@@ -131,3 +132,18 @@ message SearchQuery {
message IDsQuery {
repeated string ids = 1;
}
message UserAgent {
optional string fingerprint_id = 1;
optional string ip = 2;
optional string description = 3;
// A header may have multiple values.
// In Go, headers are defined
// as map[string][]string, but protobuf
// doesn't allow this scheme.
message HeaderValues {
repeated string values = 1;
}
map<string,HeaderValues> header = 4;
}

View File

@@ -274,6 +274,7 @@ message CreateSessionRequest{
}
];
RequestChallenges challenges = 3;
UserAgent user_agent = 4;
}
message CreateSessionResponse{