mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-19 22:14:25 +00:00
# Which Problems Are Solved As part of #11035 , this PR implements the password check logic for session validation # How the Problems Are Solved - Add system config to default configuration of `domain` package for easy initialization. Intialize the system settings when Zitadel starts up - Add password hasher verify logic to the default configuration of `domain` package. Initialize it when Zitadel starts up. - Add settings repositories with their mocks - Implement the logic for doing a password check # Additional Context This is a cherry-picked PR + minor changes, coming from https://github.com/zitadel/zitadel/pull/11164 - Relates to #11035 - Depends on https://github.com/zitadel/zitadel/pull/11777
26 lines
778 B
Go
26 lines
778 B
Go
package convert
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/backend/v3/domain"
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
|
session_grpc "github.com/zitadel/zitadel/pkg/grpc/session/v2"
|
|
)
|
|
|
|
func CheckUserGRPCToDomain(checkUser *session_grpc.CheckUser) (*domain.CheckUserType, error) {
|
|
var toReturn *domain.CheckUserType
|
|
if checkUser == nil {
|
|
return toReturn, nil
|
|
}
|
|
|
|
switch searchType := checkUser.GetSearch().(type) {
|
|
case *session_grpc.CheckUser_UserId:
|
|
toReturn = &domain.CheckUserType{UserID: searchType.UserId}
|
|
case *session_grpc.CheckUser_LoginName:
|
|
toReturn = &domain.CheckUserType{LoginName: searchType.LoginName}
|
|
default:
|
|
return nil, zerrors.ThrowInvalidArgumentf(nil, "CONV-7B2m0b", "user search %T not implemented", searchType)
|
|
}
|
|
|
|
return toReturn, nil
|
|
}
|