mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: instance requests implementation for resource API (#9830)
<!-- Please inform yourself about the contribution guidelines on submitting a PR here: https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr. Take note of how PR/commit titles should be written and replace the template texts in the sections below. Don't remove any of the sections. It is important that the commit history clearly shows what is changed and why. Important: By submitting a contribution you agree to the terms from our Licensing Policy as described here: https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions. --> # Which Problems Are Solved These changes introduce resource-based API endpoints for managing instances and custom domains. There are 4 types of changes: - Endpoint implementation: consisting of the protobuf interface and the implementation of the endpoint. E.g:606439a172
- (Integration) Tests: testing the implemented endpoint. E.g:cdfe1f0372
- Fixes: Bugs found during development that are being fixed. E.g:acbbeedd32
- Miscellaneous: code needed to put everything together or that doesn't fit any of the above categories. E.g:529df92abc
or6802cb5468
# How the Problems Are Solved _Ticked checkboxes indicate that the functionality is complete_ - [x] Instance - [x] Create endpoint - [x] Create endpoint tests - [x] Update endpoint - [x] Update endpoint tests - [x] Get endpoint - [x] Get endpoint tests - [x] Delete endpoint - [x] Delete endpoint tests - [x] Custom Domains - [x] Add custom domain - [x] Add custom domain tests - [x] Remove custom domain - [x] Remove custom domain tests - [x] List custom domains - [x] List custom domains tests - [x] Trusted Domains - [x] Add trusted domain - [x] Add trusted domain tests - [x] Remove trusted domain - [x] Remove trusted domain tests - [x] List trusted domains - [x] List trusted domains tests # Additional Changes When looking for instances (through the `ListInstances` endpoint) matching a given query, if you ask for the results to be order by a specific column, the query will fail due to a syntax error. This is fixed inacbbeedd32
. Further explanation can be found in the commit message # Additional Context - Relates to #9452 - CreateInstance has been excluded: https://github.com/zitadel/zitadel/issues/9930 - Permission checks / instance retrieval (middleware) needs to be changed to allow context based permission checks (https://github.com/zitadel/zitadel/issues/9929), required for ListInstances --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -70,7 +70,7 @@ func Test_InstancePrepares(t *testing.T) {
|
||||
{
|
||||
name: "prepareInstancesQuery no result",
|
||||
prepare: func() (sq.SelectBuilder, func(*sql.Rows) (*Instances, error)) {
|
||||
filter, query, scan := prepareInstancesQuery()
|
||||
filter, query, scan := prepareInstancesQuery(Column{}, true)
|
||||
return query(filter), scan
|
||||
},
|
||||
want: want{
|
||||
@@ -85,7 +85,7 @@ func Test_InstancePrepares(t *testing.T) {
|
||||
{
|
||||
name: "prepareInstancesQuery one result",
|
||||
prepare: func() (sq.SelectBuilder, func(*sql.Rows) (*Instances, error)) {
|
||||
filter, query, scan := prepareInstancesQuery()
|
||||
filter, query, scan := prepareInstancesQuery(Column{}, true)
|
||||
return query(filter), scan
|
||||
},
|
||||
want: want{
|
||||
@@ -149,7 +149,7 @@ func Test_InstancePrepares(t *testing.T) {
|
||||
{
|
||||
name: "prepareInstancesQuery multiple results",
|
||||
prepare: func() (sq.SelectBuilder, func(*sql.Rows) (*Instances, error)) {
|
||||
filter, query, scan := prepareInstancesQuery()
|
||||
filter, query, scan := prepareInstancesQuery(Column{}, true)
|
||||
return query(filter), scan
|
||||
},
|
||||
want: want{
|
||||
@@ -253,7 +253,8 @@ func Test_InstancePrepares(t *testing.T) {
|
||||
IsPrimary: true,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
},
|
||||
{
|
||||
ID: "id2",
|
||||
CreationDate: testNow,
|
||||
ChangeDate: testNow,
|
||||
@@ -282,7 +283,7 @@ func Test_InstancePrepares(t *testing.T) {
|
||||
{
|
||||
name: "prepareInstancesQuery sql err",
|
||||
prepare: func() (sq.SelectBuilder, func(*sql.Rows) (*Instances, error)) {
|
||||
filter, query, scan := prepareInstancesQuery()
|
||||
filter, query, scan := prepareInstancesQuery(Column{}, true)
|
||||
return query(filter), scan
|
||||
},
|
||||
want: want{
|
||||
|
Reference in New Issue
Block a user