mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
feat: add action v2 execution on requests and responses (#7637)
* feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: split request and response logic to handle the different context information * feat: split request and response logic to handle the different context information * fix: integration test * fix: import alias * fix: refactor execution package * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * docs: basic documentation for executions and targets * fix: change order for interceptors * fix: merge back origin/main * fix: change target definition command and query side (#7735) * fix: change target definition command and query side * fix: correct refactoring name changes * fix: correct refactoring name changes * fix: changing execution defintion with target list and type * fix: changing execution definition with target list and type * fix: add back search queries for target and include * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * docs: add example to actions v2 * docs: add example to actions v2 * fix: correct integration tests on query for executions * fix: add separate event for execution v2 as content changed * fix: add separate event for execution v2 as content changed * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes --------- Co-authored-by: adlerhurst <silvan.reusser@gmail.com> * fix: added review comment changes * fix: added review comment changes * Update internal/api/grpc/server/middleware/execution_interceptor.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes --------- Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
@@ -478,31 +478,31 @@ func (q *SubSelect) comp() sq.Sqlizer {
|
||||
return selectQuery
|
||||
}
|
||||
|
||||
type ListQuery struct {
|
||||
type listQuery struct {
|
||||
Column Column
|
||||
Data interface{}
|
||||
Compare ListComparison
|
||||
}
|
||||
|
||||
func NewListQuery(column Column, value interface{}, compare ListComparison) (*ListQuery, error) {
|
||||
func NewListQuery(column Column, value interface{}, compare ListComparison) (*listQuery, error) {
|
||||
if compare < 0 || compare >= listCompareMax {
|
||||
return nil, ErrInvalidCompare
|
||||
}
|
||||
if column.isZero() {
|
||||
return nil, ErrMissingColumn
|
||||
}
|
||||
return &ListQuery{
|
||||
return &listQuery{
|
||||
Column: column,
|
||||
Data: value,
|
||||
Compare: compare,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (q *ListQuery) toQuery(query sq.SelectBuilder) sq.SelectBuilder {
|
||||
func (q *listQuery) toQuery(query sq.SelectBuilder) sq.SelectBuilder {
|
||||
return query.Where(q.comp())
|
||||
}
|
||||
|
||||
func (q *ListQuery) comp() sq.Sqlizer {
|
||||
func (q *listQuery) comp() sq.Sqlizer {
|
||||
if q.Compare != ListIn {
|
||||
return nil
|
||||
}
|
||||
@@ -517,7 +517,7 @@ func (q *ListQuery) comp() sq.Sqlizer {
|
||||
return sq.Eq{q.Column.identifier(): q.Data}
|
||||
}
|
||||
|
||||
func (q *ListQuery) Col() Column {
|
||||
func (q *listQuery) Col() Column {
|
||||
return q.Column
|
||||
}
|
||||
|
||||
@@ -720,6 +720,25 @@ type listContains struct {
|
||||
args interface{}
|
||||
}
|
||||
|
||||
func NewListContains(c Column, value interface{}) (*listContains, error) {
|
||||
return &listContains{
|
||||
col: c,
|
||||
args: value,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (q *listContains) Col() Column {
|
||||
return q.col
|
||||
}
|
||||
|
||||
func (q *listContains) toQuery(query sq.SelectBuilder) sq.SelectBuilder {
|
||||
return query.Where(q.comp())
|
||||
}
|
||||
|
||||
func (q *listContains) ToSql() (string, []interface{}, error) {
|
||||
return q.col.identifier() + " @> ? ", []interface{}{q.args}, nil
|
||||
}
|
||||
|
||||
func (q *listContains) comp() sq.Sqlizer {
|
||||
return q
|
||||
}
|
||||
|
Reference in New Issue
Block a user