chore: rename IAM to instance (#11351)

# Which Problems Are Solved

In many cases IAM was used where instance was meant. 

# How the Problems Are Solved

- Rename wrong usage of IAM to instance all over the code base.
- Add an agents.md which explains the terms used in Zitadel's
architecture.

# Additional Context

- closes #11280

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: muhlemmer <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Marco A. <[email protected]>
This commit is contained in:
Tim Möhlmann
2026-02-10 20:25:39 +01:00
committed by GitHub
co-authored by Copilot muhlemmer Copilot Marco A.
parent 67a02a6aeb
commit 5a2181bcec
110 changed files with 392 additions and 478 deletions
+3 -3
View File
@@ -447,7 +447,7 @@ func prepareInstanceDomainQuery() (sq.SelectBuilder, func(*sql.Rows) (*Instance,
})
}
if instance.ID == "" {
return nil, zerrors.ThrowNotFound(nil, "QUERY-n0wng", "Errors.IAM.NotFound")
return nil, zerrors.ThrowNotFound(nil, "QUERY-n0wng", "Errors.Instance.NotFound")
}
instance.DefaultLang = language.Make(lang)
if err := rows.Close(); err != nil {
@@ -538,7 +538,7 @@ func (i *authzInstance) checkDomain(instanceDomain, publicDomain string) error {
return nil
}
if !slices.Contains(i.TrustedDomains, publicDomain) {
return zerrors.ThrowNotFound(fmt.Errorf(errPublicDomain, publicDomain), "QUERY-IuGh1", "Errors.IAM.NotFound")
return zerrors.ThrowNotFound(fmt.Errorf(errPublicDomain, publicDomain), "QUERY-IuGh1", "Errors.Instance.NotFound")
}
return nil
}
@@ -585,7 +585,7 @@ func scanAuthzInstance() (*authzInstance, func(row *sql.Row) error) {
&executionTargetsBytes,
)
if errors.Is(err, sql.ErrNoRows) {
return zerrors.ThrowNotFound(nil, "QUERY-1kIjX", "Errors.IAM.NotFound")
return zerrors.ThrowNotFound(nil, "QUERY-1kIjX", "Errors.Instance.NotFound")
}
if err != nil {
return zerrors.ThrowInternal(err, "QUERY-d3fas", "Errors.Internal")
+1 -1
View File
@@ -172,7 +172,7 @@ func prepareLockoutPolicyQuery() (sq.SelectBuilder, func(*sql.Row) (*LockoutPoli
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-38pZnUemLP", "Errors.IAM.PasswordLockoutPolicy.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-38pZnUemLP", "Errors.Instance.PasswordLockoutPolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-PJURxRUoYG", "Errors.Internal")
}
+1 -1
View File
@@ -175,7 +175,7 @@ func preparePasswordAgePolicyQuery() (sq.SelectBuilder, func(*sql.Row) (*Passwor
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-ShCWRnWJfH", "Errors.IAM.PasswordAgePolicy.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-ShCWRnWJfH", "Errors.Instance.PasswordAgePolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-6nj7Bm4fxT", "Errors.Internal")
}
+1 -1
View File
@@ -197,7 +197,7 @@ func preparePasswordComplexityPolicyQuery() (sq.SelectBuilder, func(*sql.Row) (*
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-hgA9vuM0qg", "Errors.IAM.PasswordComplexityPolicy.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-hgA9vuM0qg", "Errors.Instance.PasswordComplexityPolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-TvvW9Uij7M", "Errors.Internal")
}
@@ -22,7 +22,7 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
want wantReduce
}{
{
name: "iam reduceAdded",
name: "Instance reduceAdded",
args: args{
event: getEvent(
testEvent(
@@ -58,7 +58,7 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
},
},
{
name: "iam reduceRemoved",
name: "Instance reduceRemoved",
args: args{
event: getEvent(
testEvent(
@@ -89,7 +89,7 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
},
},
{
name: "iam reduceCascadeRemoved",
name: "Instance reduceCascadeRemoved",
args: args{
event: getEvent(
testEvent(
@@ -301,7 +301,7 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
},
},
{
name: "iam IDPConfigRemovedEvent",
name: "Instance IDPConfigRemovedEvent",
args: args{
event: getEvent(
testEvent(
@@ -360,7 +360,7 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
},
},
{
name: "iam IDPRemovedEvent",
name: "Instance IDPRemovedEvent",
args: args{
event: getEvent(
testEvent(
@@ -304,7 +304,7 @@ func TestIDPUserLinkProjection_reduces(t *testing.T) {
},
},
{
name: "iam IDPConfigRemovedEvent",
name: "Instance IDPConfigRemovedEvent",
args: args{
event: getEvent(
testEvent(
+3 -3
View File
@@ -409,7 +409,7 @@ func TestLoginNameProjection_reduces(t *testing.T) {
},
},
{
name: "iam OrgDomainPolicyAddedEventType",
name: "Instance OrgDomainPolicyAddedEventType",
args: args{
event: getEvent(
testEvent(
@@ -440,7 +440,7 @@ func TestLoginNameProjection_reduces(t *testing.T) {
},
},
{
name: "iam OrgDomainPolicyChangedEventType",
name: "Instance OrgDomainPolicyChangedEventType",
args: args{
event: getEvent(
testEvent(
@@ -470,7 +470,7 @@ func TestLoginNameProjection_reduces(t *testing.T) {
},
},
{
name: "iam OrgDomainPolicyChangedEventType no change",
name: "Instance OrgDomainPolicyChangedEventType no change",
args: args{
event: getEvent(
testEvent(