Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(webhook): add verification expression support #1392

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

igpetrov
Copy link
Contributor

@igpetrov igpetrov commented Nov 8, 2023

feat(webhook): add verification expression support

@igpetrov igpetrov self-assigned this Nov 8, 2023
@igpetrov igpetrov requested a review from a team as a code owner November 8, 2023 14:25
@igpetrov igpetrov force-pushed the webhook-verificztion-expression branch 3 times, most recently from 99ae90c to 2e9568b Compare November 8, 2023 14:30
@igpetrov igpetrov force-pushed the webhook-verificztion-expression branch 2 times, most recently from 8f969f8 to d8876a1 Compare November 8, 2023 15:24
@igpetrov
Copy link
Contributor Author

igpetrov commented Nov 8, 2023

@sbuettner do you consider to put it into 8.3.1? If so, I will go ahead, and create a QA ticket.

Copy link
Contributor

@sbuettner sbuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious by the way why we went for a dedicated interface public interface VerifiableWebhook and extend it automatically in the WebhookConnectorExecutable?

If it would be optional to the implementor we could remove the default implementation etc.

@igpetrov
Copy link
Contributor Author

igpetrov commented Nov 8, 2023

I am curious by the way why we went for a dedicated interface public interface VerifiableWebhook and extend it automatically in the WebhookConnectorExecutable?

If it would be optional to the implementor we could remove the default implementation etc.

I prefer to work with smaller interfaces with explicitly defined purpose. In that case, verification expression is covered by a dedicated interface.

@sbuettner
Copy link
Contributor

sbuettner commented Nov 8, 2023

explicitly defined purpose

Agreed, but why extend it in the default WebhookConnectorExecutable? You could get rid of the whole default behaviour if its optional for users to implement.

@igpetrov
Copy link
Contributor Author

igpetrov commented Nov 8, 2023

explicitly defined purpose

Agreed, but why extend it in the default WebhookConnectorExecutable? You could get rid of the whole default behaviour if its optional for users to implement.

Sorry, maybe I am not getting your concern right. WebhookConnectorExecutable is a core interface, which is used in many places, like InboundConnectorManager and InboundConnectorRestController. By extending WebhookConnectorExecutable with VerifiableWebhook I am implicitly defining relation WebhookConnectorExecutable-[is-a]-VerifiableWebhook which several instanceof calls. Or maybe I misunderstand your concern 🤔 .

@sbuettner
Copy link
Contributor

@igpetrov Usually one would extends the VerifiableWebhook with the WebhookConnectorExecutable. Meaning that its an extra capability that one can implement optionally. If you implement a VerifiableWebhook it verifies but its also executable. You implemented in a way that every WebhookConnectorExecutable is verifiable. I hope that makes it clearer.

@igpetrov
Copy link
Contributor Author

igpetrov commented Nov 9, 2023

@igpetrov Usually one would extends the VerifiableWebhook with the WebhookConnectorExecutable. Meaning that its an extra capability that one can implement optionally. If you implement a VerifiableWebhook it verifies but its also executable. You implemented in a way that every WebhookConnectorExecutable is verifiable. I hope that makes it clearer.

I guess, I understand what you mean and it makes sense. What I am trying to achieve with it are two things: (1) VerifiableWebhook is more like an extention to make code clearer, I think we agreed on that; (2) we currently heavily rely on WebhookConnectorExecutable interface in runtime. If I make VerifiableWebhook extending WebhookConnectorExecutable, then I may need to perform a bit of refactoring.

So extending WebhookConnectorExecutable with VerifiableWebhook is just more practical. In addition to that, VerifiableWebhook has just a verify method. Potentially, we could be able to extend with it other interfaces, such as HttpPollingConnector.
Maybe we should consider the following: (1) give it better naming (Verifiable, VerifiableInboundConnector?), and (2) rework it in such a way, that it fits not only webhooks? WDYT?

@sbuettner
Copy link
Contributor

sbuettner commented Nov 10, 2023

Not sure if there is a use-case for a VerifiableInboundConnector but having a simple interface could allow this. Although I would be careful as we return http related information (status) with the verification here which doesnt apply for other connectors like kafka for example.

we currently heavily rely on WebhookConnectorExecutable interface in runtime.

Exactly and its totally fine. The nice thing with having a simple Verifiable or VerifiableWebhook is that you can just check whether a webhook implements that interface and execute the verification if its the case. We could remove the whole default behaviour this way and keep the interfaces clean, simple and combinable.

@sbuettner
Copy link
Contributor

@igpetrov Please take a look at this proposal to make it more clear: https://github.com/camunda/connectors/tree/webhook-verification-expression-idea

@igpetrov
Copy link
Contributor Author

@igpetrov Please take a look at this proposal to make it more clear: https://github.com/camunda/connectors/tree/webhook-verification-expression-idea

That works for me. I thought it to be more cohesive but that works for me as well. Let me think about it a bit first.

@sbuettner
Copy link
Contributor

@igpetrov Of course, no need to rush here and I could live with both approaches.

Also chiming in @chillleader for a second pair of eyes.

@igpetrov
Copy link
Contributor Author

@igpetrov Of course, no need to rush here and I could live with both approaches.

Also chiming in @chillleader for a second pair of eyes.

So, after thinking about the proposal, it seems to me alright, my only concern now is that previously customer had to implement an interface WebhookConnectorExecutable which was essentially a single one they need to know about when talking about webhook implementation. Now they need to learn a new one VerifiableWebhook. This may theoretically cause some confusion.

But overall, I like the approach. Happy to discuss it with the team. WDYT @sbuettner @chillleader @markfarkas-camunda @Oleksiivanov?

@sbuettner
Copy link
Contributor

@igpetrov

it seems to me alright, my only concern now is that previously customer had to implement an interface WebhookConnectorExecutable which was essentially a single one

Valid point, lets continue as it is right now

sbuettner
sbuettner previously approved these changes Nov 16, 2023
@igpetrov igpetrov force-pushed the webhook-verificztion-expression branch from 30e884c to 025d632 Compare November 17, 2023 14:41
@igpetrov igpetrov added this pull request to the merge queue Nov 17, 2023
Merged via the queue into main with commit 90e122d Nov 17, 2023
2 checks passed
@igpetrov igpetrov deleted the webhook-verificztion-expression branch November 17, 2023 15:06
Oleksiivanov added a commit that referenced this pull request Dec 7, 2023
* fix(deps): update aws-java-sdk monorepo to v1.12.586 (#1402)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update version.spring-cloud-gcp-starter-logging to v4.8.4 (#1403)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.587 (#1404)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.microsoft.graph:microsoft-graph to v5.76.0 (#1405)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update system-stubs.version to v2.1.5 (#1408)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency uk.org.webcompere:system-stubs-jupiter to v2.1.5 (#1407)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(generator): add testing coverage for HTTP DSL (#1400)

* chore(generator): add testing coverage for HTTP DSL

* docs(generator): provide docs for congen

* remove redundant jackson annotations

* fix(deps): update dependency io.camunda:camunda-operate-client-java to v8.3.0.1 (#1409)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* build: fix tag not found on release (#1410)

* fix(deps): update version.slack to v1.35.1 (#1413)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.588 (#1412)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.589 (#1415)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update testcontainers-java monorepo to v1.19.2 (#1416)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(indempotency): added message ID to boundary and intermed conn-s (#1414)

* fix(deps): update aws-java-sdk monorepo to v1.12.590 (#1421)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.fasterxml.jackson.datatype:jackson-datatype-jsr310 to v2.16.0 (#1424)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.google.protobuf:protobuf-java to v3.25.1 (#1423)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update version.slack to v1.36.0 (#1425)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency io.camunda:zeebe-client-java to v8.3.3 (#1429)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update version.jackson-bom to v2.16.0 (#1422)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency org.codehaus.mojo:exec-maven-plugin to v3.1.1 (#1430)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.591 (#1431)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(e2e): add automation anywhere e2e tests (#1428)

* fix(deps): update dependency com.sendgrid:sendgrid-java to v4.10.1 (#1433)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(generator): multiple OpenAPI generator bugfixes (#1427)

* feat(webhook): add verification expression support (#1392)

* Made zeebe job timeout configurable via annotation and env (#1418)

* Made zeebe job timeout configurable via annotation and env

* timeout can be null

* remove timeout from annotation

* Load timeout from env when configuring connector from annotation

* fix(deps): update aws-java-sdk monorepo to v1.12.592 (#1435)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency org.camunda.feel:feel-engine to v1.17.2 (#1436)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency org.camunda.feel:feel-engine to v1.17.3 (#1438)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update version.slack to v1.36.1 (#1440)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.593 (#1439)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(http-json): add api key authentication (#1437)

* fix(deps): update dependency io.swagger.parser.v3:swagger-parser to v2.1.19 (#1441)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update testcontainers-java monorepo to v1.19.3 (#1443)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency org.apache.commons:commons-lang3 to v3.14.0 (#1447)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.594 (#1446)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.595 (#1449)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(inbound): re-introduce correlation result (#1426)

* feat(inbound): re-introduce correlation result

* wrap technical errors into CorrelationResult

* rework idempotency error handling

* rework sealed hierarchy

* chore(deps): update dependency com.diffplug.spotless:spotless-maven-plugin to v2.41.0 (#1452)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.596 (#1454)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.597 (#1457)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(e2e): Enhance error handling for mismatched property IDs in ElementTemplate (#1448)

* fix(deps): update aws-java-sdk monorepo to v1.12.598 (#1458)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(logs): Add service information to stackdriver logs (#1460)

* fix(deps): update aws-java-sdk monorepo to v1.12.599 (#1461)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* build: fix backport action trigger (#1463)

* fix(deps): update dependency com.microsoft.graph:microsoft-graph to v5.77.0 (#1434)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.600 (#1467)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.602 (#1468)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix typo in the runtime readme (#1465)

* feat(generator): add retry count property (#1469)

* chore(deps): update dependency maven to v3.9.6 (#1472)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency org.apache.maven:maven-plugin-api to v3.9.6 (#1473)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.603 (#1470)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update mockito monorepo to v5.8.0 (#1475)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.604 (#1476)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.azure:azure-identity to v1.11.1 (#1477)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.google.apis:google-api-services-drive to v3-rev20231120-2.0.0 (#1478)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency com.diffplug.spotless:spotless-maven-plugin to v2.41.1 (#1479)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* build: enable detect merge method for backport action (#1480)

* fix: GraphQL Connector bearer token does not work (#1483)

- Mapping for bearer token in element tempalte was incorrect
- Removed wrong prefix `graphql.`

* feat(generator)!: Template generation for multiple element types (#1453)

* feat(generator): multiple element templates support per generator run

* add tests, support multi template in CLI mode

* congen: return multiple templates as json array

* lint

* apply review suggestions

* resolve conflicts

* fix(deps): update aws-java-sdk monorepo to v1.12.605 (#1484)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(kafka): support JSON-syntax for message key (#1474)

* refactor: change dockerfile uid and gid (#1485)

* feat(msft,o365): added mail connector (#1486)

* Revert "refactor: change dockerfile uid and gid (#1485)" (#1490)

This reverts commit 9bcb5e5.

* refactor: change dockerfile uid and gid (#1492)

* fix(deps): update dependency org.apache.kafka:kafka-clients to v3.6.1 (#1493)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency io.camunda:zeebe-client-java to v8.3.4 (#1494)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.606 (#1495)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(rest): API key auth - do not set the key in headers when it is included in the query. (#1496)

* fix(msft,mail): fix schema (#1498)

* ci: configure renovate to update release branches too (#1510)

* ci: configure renovate to update release branches too

* Update renovate.json

* fix(deps): update dependency com.google.cloud:libraries-bom to v26.28.0 (#1541)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-java-sdk monorepo to v1.12.607 (#1540)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Kotelevsky <38818382+chillleader@users.noreply.github.com>
Co-authored-by: Igor Petrov <108870003+igpetrov@users.noreply.github.com>
Co-authored-by: Jonathan Lukas <jonathan.lukas@camunda.com>
Co-authored-by: Simon <sbuettner@users.noreply.github.com>
Co-authored-by: shaarmann <stephan.haarmann@camunda.com>
Co-authored-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com>
@chillleader
Copy link
Member

/backport

Copy link
Contributor

Successfully created backport PR for release/8.3:

github-actions bot pushed a commit that referenced this pull request Dec 18, 2023
chillleader pushed a commit that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants