mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 04:48:46 +00:00
chore(docs): User (Human) naming consistency (#11512)
# Which Problems Are Solved Naming inconsistencies - User (Human) # How the Problems Are Solved Most of the occurrences have not been changed. `User (Human)` was mostly changed when talking about code objects and where I felt it was necessary to distinguish them from machine users. When both human and machine user occurrences were found, the machine user has been changed to service account (see https://github.com/zitadel/zitadel/issues/11285) # Additional Context - Closes #11284 --------- Co-authored-by: Wim Van Laer <[email protected]>
This commit is contained in:
@@ -157,7 +157,7 @@ func AddInstancePbToSetupInstance(req *system_pb.AddInstanceRequest, defaultInst
|
||||
}
|
||||
|
||||
if defaultInstance.Org.Human != nil {
|
||||
// used to not overwrite the default human later
|
||||
// used to not overwrite the default User (human) later
|
||||
humanCopy := *defaultInstance.Org.Human
|
||||
instance.Org.Human = &humanCopy
|
||||
} else {
|
||||
|
||||
@@ -446,7 +446,7 @@ func TestServer_ListUsers(t *testing.T) {
|
||||
},
|
||||
}
|
||||
}(),
|
||||
want: &user.ListUsersResponse{ // human user should return itself when calling ListUsers() even if it has no permissions
|
||||
want: &user.ListUsersResponse{ // User (Human) should return itself when calling ListUsers() even if it has no permissions
|
||||
Details: &object.ListDetails{
|
||||
TotalResult: 1,
|
||||
Timestamp: timestamppb.Now(),
|
||||
|
||||
@@ -441,7 +441,7 @@ func TestServer_ListUsers(t *testing.T) {
|
||||
},
|
||||
}
|
||||
}(),
|
||||
want: &user_v2beta.ListUsersResponse{ // human user should return itself when calling ListUsers() even if it has no permissions
|
||||
want: &user_v2beta.ListUsersResponse{ // User (Human) should return itself when calling ListUsers() even if it has no permissions
|
||||
Details: &object_v2beta.ListDetails{
|
||||
TotalResult: 1,
|
||||
Timestamp: timestamppb.Now(),
|
||||
|
||||
@@ -185,7 +185,7 @@ func userInfoToOIDC(user *query.OIDCUserInfo, userInfoAssertion bool, scope []st
|
||||
if !userInfoAssertion {
|
||||
continue
|
||||
}
|
||||
// TODO: handle address for human users as soon as implemented
|
||||
// TODO: handle address for Users (Humans) as soon as implemented
|
||||
case ScopeUserMetaData:
|
||||
setUserInfoMetadata(user.Metadata, out)
|
||||
case ScopeResourceOwner:
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
"name": "Zitadel authentication token",
|
||||
"description": "Authentication scheme using the OAuth Bearer Token Standard",
|
||||
"specUri": "https://www.rfc-editor.org/info/rfc6750",
|
||||
"documentationUri": "https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users",
|
||||
"documentationUri": "https://zitadel.com/docs/guides/integrate/service-accounts/authenticate-service-accounts",
|
||||
"type": "oauthbearertoken",
|
||||
"primary": false
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func (h *UsersHandler) buildListQuery(ctx context.Context, request *ListRequest)
|
||||
SearchRequest: searchRequest,
|
||||
}
|
||||
|
||||
// the zitadel scim implementation only supports humans for now
|
||||
// the zitadel scim implementation only supports User (Humans) for now
|
||||
userTypeQuery, err := query.NewUserTypeSearchQuery(domain.UserTypeHuman)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -362,7 +362,7 @@ func (repo *AuthRequestRepo) SelectUser(ctx context.Context, authReqID, userID,
|
||||
}
|
||||
|
||||
func (repo *AuthRequestRepo) selectUser(ctx context.Context, request *domain.AuthRequest, userID string) error {
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, repo.LockoutPolicyViewProvider, userID, false)
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, userID, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -669,7 +669,7 @@ func (repo *AuthRequestRepo) getAuthRequestEnsureUser(ctx context.Context, authR
|
||||
if request.UserID != userID {
|
||||
return nil, zerrors.ThrowPreconditionFailed(nil, "EVENT-GBH32", "Errors.User.NotMatchingUserID")
|
||||
}
|
||||
_, err = activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, repo.LockoutPolicyViewProvider, request.UserID, false)
|
||||
_, err = activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, request.UserID, false)
|
||||
if err != nil {
|
||||
return request, err
|
||||
}
|
||||
@@ -820,7 +820,7 @@ func (repo *AuthRequestRepo) checkLoginName(ctx context.Context, request *domain
|
||||
if err != nil && !zerrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
// if there's an active (human) user, let's use it
|
||||
// if there's an active User (Human), let's use it
|
||||
if user != nil && !user.HumanView.IsZero() && domain.UserState(user.State).IsEnabled() {
|
||||
request.SetUserInfo(user.ID, loginNameInput, preferredLoginName, "", "", user.ResourceOwner)
|
||||
return nil
|
||||
@@ -1054,7 +1054,7 @@ func (repo *AuthRequestRepo) checkExternalUserLogin(ctx context.Context, request
|
||||
if len(links.Links) != 1 {
|
||||
return zerrors.ThrowNotFound(nil, "AUTH-Sf8sd", "Errors.ExternalIDP.NotFound")
|
||||
}
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, repo.LockoutPolicyViewProvider, links.Links[0].UserID, false)
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, links.Links[0].UserID, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ func (repo *AuthRequestRepo) nextSteps(ctx context.Context, request *domain.Auth
|
||||
return steps, err
|
||||
}
|
||||
}
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, repo.LockoutPolicyViewProvider, request.UserID, request.LoginPolicy.IgnoreUnknownUsernames)
|
||||
user, err := activeUserByID(ctx, repo.UserViewProvider, repo.UserEventProvider, repo.OrgViewProvider, request.UserID, request.LoginPolicy.IgnoreUnknownUsernames)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1166,7 +1166,7 @@ func (repo *AuthRequestRepo) nextSteps(ctx context.Context, request *domain.Auth
|
||||
return steps, nil
|
||||
}
|
||||
|
||||
if request.LinkingUsers != nil && len(request.LinkingUsers) != 0 {
|
||||
if len(request.LinkingUsers) != 0 {
|
||||
return append(steps, &domain.LinkUsersStep{}), nil
|
||||
}
|
||||
//PLANNED: consent step
|
||||
@@ -1223,7 +1223,7 @@ func (repo *AuthRequestRepo) nextStepsUser(ctx context.Context, request *domain.
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
steps := make([]domain.NextStep, 0)
|
||||
if request.LinkingUsers != nil && len(request.LinkingUsers) > 0 {
|
||||
if len(request.LinkingUsers) > 0 {
|
||||
steps = append(steps, new(domain.ExternalNotFoundOptionStep))
|
||||
return steps, nil
|
||||
}
|
||||
@@ -1739,8 +1739,7 @@ func userSessionByIDs(ctx context.Context, provider userSessionViewProvider, eve
|
||||
return user_view_model.UserSessionToModel(&sessionCopy), nil
|
||||
}
|
||||
|
||||
func activeUserByID(ctx context.Context, userViewProvider userViewProvider, userEventProvider userEventProvider, queries orgViewProvider, lockoutPolicyProvider lockoutPolicyViewProvider, userID string, ignoreUnknownUsernames bool) (user *user_model.UserView, err error) {
|
||||
// PLANNED: Check LockoutPolicy
|
||||
func activeUserByID(ctx context.Context, userViewProvider userViewProvider, userEventProvider userEventProvider, queries orgViewProvider, userID string, ignoreUnknownUsernames bool) (user *user_model.UserView, err error) {
|
||||
user, err = userByID(ctx, userViewProvider, userEventProvider, userID)
|
||||
if err != nil {
|
||||
if ignoreUnknownUsernames && zerrors.IsNotFound(err) {
|
||||
|
||||
@@ -1611,7 +1611,7 @@ func TestCommandSide_SetUpOrg(t *testing.T) {
|
||||
name: "human added with initial mail",
|
||||
fields: fields{
|
||||
eventstore: expectEventstore(
|
||||
expectFilter(), // add human exists check
|
||||
expectFilter(), // add User (Human) exists check
|
||||
expectFilter(),
|
||||
expectFilter(
|
||||
eventFromEventPusher(
|
||||
|
||||
@@ -409,7 +409,7 @@ func (wm *UserV2WriteModel) SetPasswordCodeSent(e *user.HumanPasswordCodeSentEve
|
||||
|
||||
func (wm *UserV2WriteModel) Query() *eventstore.SearchQueryBuilder {
|
||||
// remove events are always processed
|
||||
// and username is based for machine and human
|
||||
// and username is based for service account and user (human)
|
||||
eventTypes := []eventstore.EventType{
|
||||
user.UserRemovedType,
|
||||
user.UserUserNameChangedType,
|
||||
|
||||
@@ -17,7 +17,7 @@ var _ eventstore.Event = (*Event)(nil)
|
||||
|
||||
// Event represents all information about a manipulation of an aggregate
|
||||
type Event struct {
|
||||
//ID is a generated uuid for this event
|
||||
// ID is a generated uuid for this event
|
||||
ID string
|
||||
|
||||
// Seq is the sequence of the event
|
||||
@@ -25,7 +25,7 @@ type Event struct {
|
||||
// Pos is the global sequence of the event multiple events can have the same sequence
|
||||
Pos decimal.Decimal
|
||||
|
||||
//CreationDate is the time the event is created
|
||||
// CreationDate is the time the event is created
|
||||
// it's used for human readability.
|
||||
// Don't use it for event ordering,
|
||||
// time drifts in different services could cause integrity problems
|
||||
@@ -35,29 +35,29 @@ type Event struct {
|
||||
// it should always be in past-form
|
||||
Typ eventstore.EventType
|
||||
|
||||
//Data describe the changed fields (e.g. userName = "hodor")
|
||||
// Data describe the changed fields (e.g. userName = "hodor")
|
||||
// data must always a pointer to a struct, a struct or a byte array containing json bytes
|
||||
Data []byte
|
||||
|
||||
//EditorUser should be a unique identifier for the user which created the event
|
||||
// EditorUser should be a unique identifier for the user which created the event
|
||||
// it's meant for maintainability.
|
||||
// It's recommend to use the aggregate id of the user
|
||||
EditorUser string
|
||||
|
||||
//Version describes the definition of the aggregate at a certain point in time
|
||||
// Version describes the definition of the aggregate at a certain point in time
|
||||
// it's used in read models to reduce the events in the correct definition
|
||||
Version eventstore.Version
|
||||
//AggregateID id is the unique identifier of the aggregate
|
||||
// AggregateID id is the unique identifier of the aggregate
|
||||
// the client must generate it by it's own
|
||||
AggregateID string
|
||||
//AggregateType describes the meaning of the aggregate for this event
|
||||
// AggregateType describes the meaning of the aggregate for this event
|
||||
// it could an object like user
|
||||
AggregateType eventstore.AggregateType
|
||||
//ResourceOwner is the organisation which owns this aggregate
|
||||
// ResourceOwner is the organisation which owns this aggregate
|
||||
// an aggregate can only be managed by one organisation
|
||||
// use the ID of the org
|
||||
ResourceOwner sql.NullString
|
||||
//InstanceID is the instance where this event belongs to
|
||||
// InstanceID is the instance where this event belongs to
|
||||
// use the ID of the instance
|
||||
InstanceID string
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ type Instance struct {
|
||||
Instance *instance.InstanceDetail
|
||||
DefaultOrg *org.Org
|
||||
Users UserMap
|
||||
AdminUserID string // First human user for password login
|
||||
AdminUserID string // First User (Human) for password login
|
||||
|
||||
Client *Client
|
||||
WebAuthN *webauthn.Client
|
||||
|
||||
+14
-14
@@ -225,7 +225,7 @@ var (
|
||||
"username",
|
||||
"login_names",
|
||||
"preferred_login_name",
|
||||
// human
|
||||
// User (human)
|
||||
"user_id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -234,7 +234,7 @@ var (
|
||||
"preferred_language",
|
||||
"gender",
|
||||
"avatar_key",
|
||||
// machine
|
||||
// service account
|
||||
"user_id",
|
||||
"last_email",
|
||||
"verified_email",
|
||||
@@ -293,7 +293,7 @@ var (
|
||||
"username",
|
||||
"login_names",
|
||||
"preferred_login_name",
|
||||
// human
|
||||
// User (human)
|
||||
"user_id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -309,7 +309,7 @@ var (
|
||||
"password_change_required",
|
||||
"password_changed",
|
||||
"mfa_init_skipped",
|
||||
// machine
|
||||
// service account
|
||||
"user_id",
|
||||
"name",
|
||||
"description",
|
||||
@@ -717,7 +717,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
"id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -780,7 +780,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
"id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -867,7 +867,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
"id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -883,7 +883,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
true,
|
||||
testNow,
|
||||
testNow,
|
||||
// machine
|
||||
// service account
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
@@ -952,7 +952,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
"id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -968,7 +968,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
true,
|
||||
testNow,
|
||||
testNow,
|
||||
// machine
|
||||
// service account
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
@@ -1042,7 +1042,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
"id",
|
||||
"first_name",
|
||||
"last_name",
|
||||
@@ -1058,7 +1058,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
true,
|
||||
testNow,
|
||||
testNow,
|
||||
// machine
|
||||
// service account
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
@@ -1077,7 +1077,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
"username",
|
||||
database.TextArray[string]{"login_name1", "login_name2"},
|
||||
"login_name1",
|
||||
// human
|
||||
// User (human)
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
@@ -1093,7 +1093,7 @@ func Test_UserPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// machine
|
||||
// service account
|
||||
"id",
|
||||
"name",
|
||||
"description",
|
||||
|
||||
Reference in New Issue
Block a user