feat(admin-api): list events (#4989)

* docs: update cockroachdb version to 22.2
* feat(adminAPI): ListEventTypes returns the list of event types ZITADEL implements
* feat(adminAPI): ListAggregateTypes returns the list of aggregate types ZITADEL implements
* feat(adminAPI): ListEvents allows `IAM_OWNERS` to search for events
This commit is contained in:
Silvan
2023-01-16 12:30:03 +01:00
committed by GitHub
parent 74c1c39207
commit 1bf1f335dc
30 changed files with 888 additions and 360 deletions

View File

@@ -1566,6 +1566,42 @@ Exports data from instance
POST: /export
### ListEventTypes
> **rpc** ListEventTypes([ListEventTypesRequest](#listeventtypesrequest))
[ListEventTypesResponse](#listeventtypesresponse)
POST: /events/types/_search
### ListEvents
> **rpc** ListEvents([ListEventsRequest](#listeventsrequest))
[ListEventsResponse](#listeventsresponse)
POST: /events/_search
### ListAggregateTypes
> **rpc** ListAggregateTypes([ListAggregateTypesRequest](#listaggregatetypesrequest))
[ListAggregateTypesResponse](#listaggregatetypesresponse)
POST: /aggregates/types/_search
@@ -3072,6 +3108,70 @@ at least one argument has to be provided
### ListAggregateTypesRequest
### ListAggregateTypesResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| aggregate_types | repeated string | - | |
### ListEventTypesRequest
### ListEventTypesResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| event_types | repeated string | - | |
### ListEventsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| sequence | uint64 | sequence represents the order of events. It's always upcounting if asc is false sequence is used as less than filter if asc is true sequence is used as greater than filter if sequence is 0 the field is ignored | |
| limit | uint32 | - | |
| asc | bool | - | |
| editor_user_id | string | - | |
| event_types | repeated string | the types are or filtered and must match the type exatly | |
| aggregate_id | string | - | |
| aggregate_type | string | - | |
| resource_owner | string | - | |
| creation_date | google.protobuf.Timestamp | if asc is false creation_date is used as less than filter if asc is true creation_date is used as greater than filter if creation_date is not set the field is ignored | |
### ListEventsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| events | repeated zitadel.event.v1.Event | - | |
### ListFailedEventsRequest
This is an empty request

View File

@@ -0,0 +1,55 @@
---
title: zitadel/event.proto
---
> This document reflects the state from API 1.0 (available from 20.04.2021)
## Messages
### Aggregate
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
| type | string | - | |
| resource_owner | string | - | |
### Editor
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| user_id | string | - | |
| display_name | string | - | |
| service | string | - | |
### Event
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| editor | Editor | - | |
| aggregate | Aggregate | - | |
| sequence | uint64 | - | |
| creation_date | google.protobuf.Timestamp | The timestamp the event occurred | |
| payload | google.protobuf.Struct | - | |
| type | string | - | |

View File

@@ -26,7 +26,7 @@ services:
restart: 'always'
networks:
- 'zitadel'
image: 'cockroachdb/cockroach:v22.1.3'
image: 'cockroachdb/cockroach:v22.2.2'
command: 'start-single-node --insecure'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]

View File

@@ -20,7 +20,7 @@ services:
restart: 'always'
networks:
- 'zitadel'
image: 'cockroachdb/cockroach:v22.1.3'
image: 'cockroachdb/cockroach:v22.2.2'
command: 'start-single-node --insecure'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]

View File

@@ -8,8 +8,8 @@ import Next from './_next.mdx'
## Install CockroachDB
Download a `cockroach` binary as described [in the CockroachDB docs](https://www.cockroachlabs.com/docs/v22.1/install-cockroachdb).
ZITADEL is tested against CockroachDB v22.1.0 and Ubuntu 20.04.
Download a `cockroach` binary as described [in the CockroachDB docs](https://www.cockroachlabs.com/docs/stable/install-cockroachdb).
ZITADEL is tested against CockroachDB v22.2.2 and Ubuntu 20.04.
## Run CockroachDB

View File

@@ -28,7 +28,7 @@ services:
- 'zitadel-certs:/crdb-certs:ro'
certs:
image: 'cockroachdb/cockroach:v22.1.0'
image: 'cockroachdb/cockroach:v22.2.2'
entrypoint: [ '/bin/bash', '-c' ]
command: [ 'cp /certs/* /zitadel-certs/ && cockroach cert create-client --overwrite --certs-dir /zitadel-certs/ --ca-key /zitadel-certs/ca.key zitadel_user && chown 1000:1000 /zitadel-certs/*' ]
volumes:
@@ -42,7 +42,7 @@ services:
restart: 'always'
networks:
- 'zitadel'
image: 'cockroachdb/cockroach:v22.1.0'
image: 'cockroachdb/cockroach:v22.2.2'
command: 'start-single-node --advertise-addr my-cockroach-db'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]

View File

@@ -8,8 +8,8 @@ import Next from './_next.mdx'
## Install CockroachDB
Download a `cockroach` binary as described [in the CockroachDB docs](https://www.cockroachlabs.com/docs/v22.1/install-cockroachdb).
ZITADEL is tested against CockroachDB v22.1.0.
Download a `cockroach` binary as described [in the CockroachDB docs](https://www.cockroachlabs.com/docs/stable/install-cockroachdb).
ZITADEL is tested against CockroachDB v22.2.2.
## Run CockroachDB

View File

@@ -19,7 +19,7 @@ services:
- "zitadel-certs:/crdb-certs:ro"
certs:
image: "cockroachdb/cockroach:v22.1.0"
image: "cockroachdb/cockroach:v22.2.2"
entrypoint: ["/bin/bash", "-c"]
command:
[
@@ -36,7 +36,7 @@ services:
restart: "always"
networks:
- "zitadel"
image: "cockroachdb/cockroach:v22.1.0"
image: "cockroachdb/cockroach:v22.2.2"
command: "start-single-node --advertise-addr my-cockroach-db"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]