feat: instance domain APIs with relational tables (#11051)

# Which Problems Are Solved

This PR implements the endpoints listed in
https://github.com/zitadel/zitadel/issues/10444 .

# How the Problems Are Solved

The implementation follows the same pattern as the Instance one. The
`Add` and `Remove` are implementing the `Commander` interface, while
`List` Domains endpoints are implementing the `Querier` interace.

The PR adds also some forgotten calls to the relational logic for the
Instance API. The commits are identifiable by the label `instance:`
prepended to them. This is the complete list: bafce01b0 , 6fe7257ab ,
e27bc9c34 , 8133ede73 , fde667953 , a3e1135ed , ee1a6f9c1

# Additional Context

- Closes #10444

---------

Co-authored-by: Elio Bischof <[email protected]>
Co-authored-by: Lebogang Phoshoko <[email protected]>
Co-authored-by: Wim Van Laer <[email protected]>
Co-authored-by: Max Peintner <[email protected]>
Co-authored-by: Gayathri Vijayan <[email protected]>
This commit is contained in:
Marco A.
2025-12-17 12:01:09 +01:00
committed by GitHub
co-authored by Elio Bischof Lebogang Phoshoko Wim Van Laer Max Peintner Gayathri Vijayan
parent d79bfe6eba
commit b339a3e696
49 changed files with 5670 additions and 1466 deletions
+23 -6
View File
@@ -313,8 +313,9 @@ func TestCommandSide_RemoveInstanceDomain(t *testing.T) {
eventstore *eventstore.Eventstore
}
type args struct {
ctx context.Context
domain string
ctx context.Context
domain string
errorIfNotFound bool
}
type res struct {
want *domain.ObjectDetails
@@ -342,7 +343,7 @@ func TestCommandSide_RemoveInstanceDomain(t *testing.T) {
},
},
{
name: "domain not exists, precondition error",
name: "domain not exists and errorIfNotFound set to TRUE should return not found error",
fields: fields{
eventstore: eventstoreExpect(
t,
@@ -350,13 +351,29 @@ func TestCommandSide_RemoveInstanceDomain(t *testing.T) {
),
},
args: args{
ctx: context.Background(),
domain: "domain.ch",
ctx: context.Background(),
domain: "domain.ch",
errorIfNotFound: true,
},
res: res{
err: zerrors.IsNotFound,
},
},
{
name: "domain not exists and errorIfNotFound set to FALSE should return no error",
fields: fields{
eventstore: eventstoreExpect(
t,
expectFilter(),
),
},
args: args{
ctx: context.Background(),
domain: "domain.ch",
errorIfNotFound: false,
},
res: res{},
},
{
name: "remove domain, ok",
fields: fields{
@@ -420,7 +437,7 @@ func TestCommandSide_RemoveInstanceDomain(t *testing.T) {
r := &Commands{
eventstore: tt.fields.eventstore,
}
got, err := r.RemoveInstanceDomain(tt.args.ctx, tt.args.domain)
got, err := r.RemoveInstanceDomain(tt.args.ctx, tt.args.domain, tt.args.errorIfNotFound)
if tt.res.err == nil {
assert.NoError(t, err)
}