Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/modules/eventprocessing/connectors/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type PipelineRepository interface {
List(tenantId string) []domain.Pipeline
GetByRelPath(relPath string) *domain.Pipeline
Create(relPath string, content []byte, tenantId string) (*domain.Pipeline, error)
Update(relPath string, content []byte) (*domain.Pipeline, error)
Update(relPath string, content []byte, tenantId string) (*domain.Pipeline, error)
Delete(relPath string) error
SetEnabled(tenantId, relPath string, active bool) error
}
Expand Down
16 changes: 15 additions & 1 deletion backend/modules/eventprocessing/repository/pipeline_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,21 @@ func (s *PipelineStore) Create(relPath string, content []byte, tenantId string)
return &cp, nil
}

func (s *PipelineStore) Update(relPath string, content []byte) (*domain.Pipeline, error) {
func (s *PipelineStore) Update(relPath string, content []byte,tenantId string) (*domain.Pipeline, error) {
if tenantId != "" {
injected, err := withTenantID(content, tenantId)
if err != nil {
return nil, fmt.Errorf("invalid filter content: %w", err)
}
content = injected

base := filepath.Base(relPath)
ext := filepath.Ext(base)
name := strings.TrimSuffix(base, ext)
relPath = filepath.ToSlash(filepath.Join(tenantId, name+"-"+tenantId+ext))
}


s.mu.Lock()
defer s.mu.Unlock()
existing, ok := s.filters[relPath]
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/eventprocessing/usecase/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (u *pipelineUsecase) Update(ctx context.Context, req dto.UpdatePipelineRequ
if err != nil {
return nil, fmt.Errorf("%w: %v", domain.ErrPipelineInvalidContent, err)
}
entry, err := u.store.Update(req.RelPath, []byte(content))
entry, err := u.store.Update(req.RelPath, []byte(content),authz.TenantIDFromContext(ctx))
if err != nil {
return nil, err
}
Expand Down
Loading