feat: actions (#2377)

* feat(actions): begin api

* feat(actions): begin api

* api and projections

* fix: handle multiple statements for a single event in projections

* export func type

* fix test

* update to new reduce interface

* flows in login

* feat: jwt idp

* feat: command side

* feat: add tests

* actions and flows

* fill idp views with jwt idps and return apis

* add jwtEndpoint to jwt idp

* begin jwt request handling

* add feature

* merge

* merge

* handle jwt idp

* cleanup

* bug fixes

* autoregister

* get token from specific header name

* fix: proto

* fixes

* i18n

* begin tests

* fix and log http proxy

* remove docker cache

* fixes

* usergrants in actions api

* tests adn cleanup

* cleanup

* fix add user grant

* set login context

* i18n

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz
2021-09-27 13:43:49 +02:00
committed by GitHub
parent 5c32fc9c12
commit ed80a8bb1e
73 changed files with 5197 additions and 64 deletions

View File

@@ -0,0 +1,188 @@
---
title: zitadel/action.proto
---
> This document reflects the state from API 1.0 (available from 20.04.2021)
## Messages
### Action
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
| details | zitadel.v1.ObjectDetails | - | |
| state | ActionState | - | |
| name | string | - | |
| script | string | - | |
| timeout | google.protobuf.Duration | - | |
| allowed_to_fail | bool | - | |
### ActionIDQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.max_len: 200<br /> |
### ActionNameQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| name | string | - | string.max_len: 200<br /> |
| method | zitadel.v1.TextQueryMethod | - | enum.defined_only: true<br /> |
### ActionStateQuery
ActionStateQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| state | ActionState | - | enum.defined_only: true<br /> |
### Flow
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| type | FlowType | - | |
| details | zitadel.v1.ObjectDetails | - | |
| state | FlowState | - | |
| trigger_actions | repeated TriggerAction | - | |
### FlowStateQuery
FlowStateQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| state | FlowState | - | enum.defined_only: true<br /> |
### FlowTypeQuery
FlowTypeQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| state | FlowType | - | enum.defined_only: true<br /> |
### TriggerAction
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| trigger_type | TriggerType | - | |
| actions | repeated Action | - | |
## Enums
### ActionFieldName {#actionfieldname}
| Name | Number | Description |
| ---- | ------ | ----------- |
| ACTION_FIELD_NAME_UNSPECIFIED | 0 | - |
| ACTION_FIELD_NAME_NAME | 1 | - |
| ACTION_FIELD_NAME_ID | 2 | - |
| ACTION_FIELD_NAME_STATE | 3 | - |
### ActionState {#actionstate}
| Name | Number | Description |
| ---- | ------ | ----------- |
| ACTION_STATE_UNSPECIFIED | 0 | - |
| ACTION_STATE_INACTIVE | 1 | - |
| ACTION_STATE_ACTIVE | 2 | - |
### FlowFieldName {#flowfieldname}
| Name | Number | Description |
| ---- | ------ | ----------- |
| FLOW_FIELD_NAME_UNSPECIFIED | 0 | - |
| FLOW_FIELD_NAME_TYPE | 1 | - |
| FLOW_FIELD_NAME_STATE | 2 | - |
### FlowState {#flowstate}
| Name | Number | Description |
| ---- | ------ | ----------- |
| FLOW_STATE_UNSPECIFIED | 0 | - |
| FLOW_STATE_INACTIVE | 1 | - |
| FLOW_STATE_ACTIVE | 2 | - |
### FlowType {#flowtype}
| Name | Number | Description |
| ---- | ------ | ----------- |
| FLOW_TYPE_UNSPECIFIED | 0 | - |
| FLOW_TYPE_EXTERNAL_AUTHENTICATION | 1 | - |
### TriggerType {#triggertype}
| Name | Number | Description |
| ---- | ------ | ----------- |
| TRIGGER_TYPE_UNSPECIFIED | 0 | - |
| TRIGGER_TYPE_POST_AUTHENTICATION | 1 | - |
| TRIGGER_TYPE_PRE_CREATION | 2 | - |
| TRIGGER_TYPE_POST_CREATION | 3 | - |

View File

@@ -2563,6 +2563,7 @@ This is an empty request
| custom_text_message | bool | - | |
| custom_text_login | bool | - | |
| lockout_policy | bool | - | |
| actions | bool | - | |
@@ -2752,6 +2753,7 @@ This is an empty request
| custom_text_message | bool | - | |
| custom_text_login | bool | - | |
| lockout_policy | bool | - | |
| actions | bool | - | |

View File

@@ -2683,6 +2683,102 @@ Change JWT identity provider configuration of the organisation
PUT: /idps/{idp_id}/jwt_config
### ListActions
> **rpc** ListActions([ListActionsRequest](#listactionsrequest))
[ListActionsResponse](#listactionsresponse)
POST: /actions/_search
### GetAction
> **rpc** GetAction([GetActionRequest](#getactionrequest))
[GetActionResponse](#getactionresponse)
GET: /actions/{id}
### CreateAction
> **rpc** CreateAction([CreateActionRequest](#createactionrequest))
[CreateActionResponse](#createactionresponse)
POST: /actions
### UpdateAction
> **rpc** UpdateAction([UpdateActionRequest](#updateactionrequest))
[UpdateActionResponse](#updateactionresponse)
PUT: /actions/{id}
### DeleteAction
> **rpc** DeleteAction([DeleteActionRequest](#deleteactionrequest))
[DeleteActionResponse](#deleteactionresponse)
DELETE: /actions/{id}
### GetFlow
> **rpc** GetFlow([GetFlowRequest](#getflowrequest))
[GetFlowResponse](#getflowresponse)
GET: /flows/{type}
### ClearFlow
> **rpc** ClearFlow([ClearFlowRequest](#clearflowrequest))
[ClearFlowResponse](#clearflowresponse)
POST: /flows/{type}/_clear
### SetTriggerActions
> **rpc** SetTriggerActions([SetTriggerActionsRequest](#settriggeractionsrequest))
[SetTriggerActionsResponse](#settriggeractionsresponse)
POST: /flows/{flow_type}/trigger/{trigger_type}
@@ -2691,6 +2787,19 @@ Change JWT identity provider configuration of the organisation
## Messages
### ActionQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.action_id_query | zitadel.action.v1.ActionIDQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.action_name_query | zitadel.action.v1.ActionNameQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.action_state_query | zitadel.action.v1.ActionStateQuery | - | |
### ActivateCustomLabelPolicyRequest
This is an empty request
@@ -3532,6 +3641,76 @@ This is an empty request
### ClearFlowRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| type | zitadel.action.v1.FlowType | - | |
### ClearFlowResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### CreateActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| script | string | - | string.min_len: 1<br /> string.max_len: 2000<br /> |
| timeout | google.protobuf.Duration | - | duration.lte.seconds: 20<br /> duration.lte.nanos: 0<br /> duration.gte.seconds: 0<br /> duration.gte.nanos: 0<br /> |
| allowed_to_fail | bool | - | |
### CreateActionResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
| id | string | - | |
### DeactivateActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
### DeactivateActionResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### DeactivateAppRequest
@@ -3684,6 +3863,23 @@ This is an empty request
### DeleteActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
### DeleteActionResponse
### GenerateOrgDomainValidationRequest
@@ -3708,6 +3904,28 @@ This is an empty request
### GetActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
### GetActionResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| action | zitadel.action.v1.Action | - | |
### GetAppByIDRequest
@@ -4182,6 +4400,28 @@ This is an empty request
### GetFlowRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| type | zitadel.action.v1.FlowType | - | |
### GetFlowResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| flow | zitadel.action.v1.Flow | - | |
### GetGrantedProjectByIDRequest
@@ -4818,6 +5058,32 @@ This is an empty response
### ListActionsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| query | zitadel.v1.ListQuery | list limitations and ordering | |
| sorting_column | zitadel.action.v1.ActionFieldName | the field the result is sorted | |
| queries | repeated ActionQuery | criteria the client is looking for | |
### ListActionsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ListDetails | - | |
| sorting_column | zitadel.action.v1.ActionFieldName | - | |
| result | repeated zitadel.action.v1.Action | - | |
### ListAppChangesRequest
@@ -5545,6 +5811,28 @@ This is an empty request
### ReactivateActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | |
### ReactivateActionResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### ReactivateAppRequest
@@ -7013,6 +7301,30 @@ This is an empty request
### SetTriggerActionsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| flow_type | zitadel.action.v1.FlowType | - | |
| trigger_type | zitadel.action.v1.TriggerType | - | |
| action_ids | repeated string | - | |
### SetTriggerActionsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### SetUserMetadataRequest
@@ -7084,6 +7396,32 @@ This is an empty request
### UpdateActionRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| script | string | - | string.min_len: 1<br /> string.max_len: 2000<br /> |
| timeout | google.protobuf.Duration | - | duration.lte.seconds: 20<br /> duration.lte.nanos: 0<br /> duration.gte.seconds: 0<br /> duration.gte.nanos: 0<br /> |
| allowed_to_fail | bool | - | |
### UpdateActionResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### UpdateAppRequest