mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-22 07:47:29 +00:00
f680dd934d
* chore: rename package errors to zerrors * rename package errors to gerrors * fix error related linting issues * fix zitadel error assertion * fix gosimple linting issues * fix deprecated linting issues * resolve gci linting issues * fix import structure --------- Co-authored-by: Elio Bischof <elio@zitadel.com>
32 lines
857 B
Go
32 lines
857 B
Go
package model
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/zitadel/logging"
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
|
)
|
|
|
|
type AuthRequest struct {
|
|
ID string `json:"id,omitempty"`
|
|
UserAgentID string `json:"userAgentID,omitempty"`
|
|
SelectedIDPConfigID string `json:"selectedIDPConfigID,omitempty"`
|
|
*BrowserInfo
|
|
}
|
|
|
|
type BrowserInfo struct {
|
|
UserAgent string `json:"userAgent,omitempty"`
|
|
AcceptLanguage string `json:"acceptLanguage,omitempty"`
|
|
RemoteIP net.IP `json:"remoteIP,omitempty"`
|
|
}
|
|
|
|
func (a *AuthRequest) SetData(event eventstore.Event) error {
|
|
if err := event.Unmarshal(a); err != nil {
|
|
logging.Log("EVEN-T5df6").WithError(err).Error("could not unmarshal event data")
|
|
return zerrors.ThrowInternal(err, "MODEL-yGmhh", "could not unmarshal event")
|
|
}
|
|
return nil
|
|
}
|