mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:07:31 +00:00
fix: change to repository event types and removed unused code (#3386)
* fix: change to repository event types and removed unused code * some fixes * remove unused code
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/caos/zitadel/internal/api/grpc/object"
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
key_model "github.com/caos/zitadel/internal/key/model"
|
||||
"github.com/caos/zitadel/internal/query"
|
||||
"github.com/caos/zitadel/pkg/grpc/authn"
|
||||
)
|
||||
@@ -34,7 +33,7 @@ func KeyToPb(key *query.AuthNKey) *authn.Key {
|
||||
|
||||
func KeyTypeToPb(typ domain.AuthNKeyType) authn.KeyType {
|
||||
switch typ {
|
||||
case key_model.AuthNKeyTypeJSON:
|
||||
case domain.AuthNKeyTypeJSON:
|
||||
return authn.KeyType_KEY_TYPE_JSON
|
||||
default:
|
||||
return authn.KeyType_KEY_TYPE_UNSPECIFIED
|
||||
|
@@ -6,7 +6,6 @@ import (
|
||||
object_grpc "github.com/caos/zitadel/internal/api/grpc/object"
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
proj_model "github.com/caos/zitadel/internal/project/model"
|
||||
"github.com/caos/zitadel/internal/query"
|
||||
app_pb "github.com/caos/zitadel/pkg/grpc/app"
|
||||
message_pb "github.com/caos/zitadel/pkg/grpc/message"
|
||||
@@ -292,11 +291,3 @@ func AppQueryToModel(appQuery *app_pb.AppQuery) (query.SearchQuery, error) {
|
||||
return nil, errors.ThrowInvalidArgument(nil, "APP-Add46", "List.Query.Invalid")
|
||||
}
|
||||
}
|
||||
|
||||
func AppQueryNameToModel(query *app_pb.AppNameQuery) *proj_model.ApplicationSearchQuery {
|
||||
return &proj_model.ApplicationSearchQuery{
|
||||
Key: proj_model.AppSearchKeyName,
|
||||
Method: object_grpc.TextMethodToModel(query.Method),
|
||||
Value: query.Name,
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@ import (
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/caos/zitadel/internal/query"
|
||||
usr_grant_model "github.com/caos/zitadel/internal/usergrant/model"
|
||||
user_pb "github.com/caos/zitadel/pkg/grpc/user"
|
||||
)
|
||||
|
||||
@@ -148,17 +147,6 @@ func UserStateToPb(state domain.UserState) user_pb.UserState {
|
||||
}
|
||||
}
|
||||
|
||||
func ModelUserGrantStateToPb(state usr_grant_model.UserGrantState) user_pb.UserGrantState {
|
||||
switch state {
|
||||
case usr_grant_model.UserGrantStateActive:
|
||||
return user_pb.UserGrantState_USER_GRANT_STATE_ACTIVE
|
||||
case usr_grant_model.UserGrantStateInactive:
|
||||
return user_pb.UserGrantState_USER_GRANT_STATE_INACTIVE
|
||||
default:
|
||||
return user_pb.UserGrantState_USER_GRANT_STATE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func GenderToPb(gender domain.Gender) user_pb.Gender {
|
||||
switch gender {
|
||||
case domain.GenderDiverse:
|
||||
|
@@ -2,7 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/api/grpc/object"
|
||||
auth_req_model "github.com/caos/zitadel/internal/auth_request/model"
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
user_model "github.com/caos/zitadel/internal/user/model"
|
||||
"github.com/caos/zitadel/pkg/grpc/user"
|
||||
)
|
||||
@@ -34,11 +34,11 @@ func UserSessionToPb(session *user_model.UserSessionView) *user.Session {
|
||||
}
|
||||
}
|
||||
|
||||
func SessionStateToPb(state auth_req_model.UserSessionState) user.SessionState {
|
||||
func SessionStateToPb(state domain.UserSessionState) user.SessionState {
|
||||
switch state {
|
||||
case auth_req_model.UserSessionStateActive:
|
||||
case domain.UserSessionStateActive:
|
||||
return user.SessionState_SESSION_STATE_ACTIVE
|
||||
case auth_req_model.UserSessionStateTerminated:
|
||||
case domain.UserSessionStateTerminated:
|
||||
return user.SessionState_SESSION_STATE_TERMINATED
|
||||
default:
|
||||
return user.SessionState_SESSION_STATE_UNSPECIFIED
|
||||
|
Reference in New Issue
Block a user