mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-12 19:13:52 +00:00
fix: race condition in auth request unmarshalling (#1993)
This commit is contained in:
parent
c950d6d272
commit
f93337e99b
@ -111,11 +111,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewAuthRequestFromType(requestType AuthRequestType) (*AuthRequest, error) {
|
func NewAuthRequestFromType(requestType AuthRequestType) (*AuthRequest, error) {
|
||||||
request, ok := authRequestTypeMapping[requestType]
|
switch requestType {
|
||||||
if !ok {
|
case AuthRequestTypeOIDC:
|
||||||
return nil, errors.ThrowInvalidArgument(nil, "DOMAIN-ds2kl", "invalid request type")
|
return &AuthRequest{Request: &AuthRequestOIDC{}}, nil
|
||||||
}
|
}
|
||||||
return &AuthRequest{Request: request}, nil
|
return nil, errors.ThrowInvalidArgument(nil, "DOMAIN-ds2kl", "invalid request type")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuthRequest) WithCurrentInfo(info *BrowserInfo) *AuthRequest {
|
func (a *AuthRequest) WithCurrentInfo(info *BrowserInfo) *AuthRequest {
|
||||||
|
@ -15,12 +15,6 @@ type Request interface {
|
|||||||
|
|
||||||
type AuthRequestType int32
|
type AuthRequestType int32
|
||||||
|
|
||||||
var (
|
|
||||||
authRequestTypeMapping = map[AuthRequestType]Request{
|
|
||||||
AuthRequestTypeOIDC: &AuthRequestOIDC{},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AuthRequestTypeOIDC AuthRequestType = iota
|
AuthRequestTypeOIDC AuthRequestType = iota
|
||||||
AuthRequestTypeSAML
|
AuthRequestTypeSAML
|
||||||
|
Loading…
x
Reference in New Issue
Block a user