mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
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:
17
internal/domain/user_agent.go
Normal file
17
internal/domain/user_agent.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"net"
|
||||
httplib "net/http"
|
||||
)
|
||||
|
||||
type UserAgent struct {
|
||||
FingerprintID *string `json:"fingerprint_id,omitempty"`
|
||||
IP net.IP `json:"ip,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Header httplib.Header `json:"header,omitempty"`
|
||||
}
|
||||
|
||||
func (ua UserAgent) IsEmpty() bool {
|
||||
return ua.FingerprintID == nil && len(ua.IP) == 0 && ua.Description == nil && ua.Header == nil
|
||||
}
|
Reference in New Issue
Block a user