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

[release-1.12] Add OIDC support #994

Conversation

creydr
Copy link
Member

@creydr creydr commented Feb 21, 2024

Backport of the OIDC bits from EKB upstream main.

  • update of encryption/auth tests to run OIDC tests too (21053d4)

Copy link

openshift-ci bot commented Feb 21, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@creydr
Copy link
Member Author

creydr commented Feb 21, 2024

/test all

@creydr creydr force-pushed the backport-oidc-to-midstream-1.13 branch from 241794f to 21053d4 Compare February 21, 2024 11:30
@creydr
Copy link
Member Author

creydr commented Feb 21, 2024

Tests are failing (at least) because we deploy eventing-core 1.11, which does not support OIDC yet (e.g. missing audience field in broker CRD)...

@creydr creydr changed the title [release-1.13] OIDC support [WIP] [release-1.13] OIDC support Feb 21, 2024
@creydr creydr marked this pull request as ready for review February 21, 2024 19:06
@creydr
Copy link
Member Author

creydr commented Feb 21, 2024

/hold
as WIP

@openshift-ci openshift-ci bot requested review from aliok and pierDipi February 21, 2024 19:06
@creydr creydr force-pushed the backport-oidc-to-midstream-1.13 branch 3 times, most recently from 6af9ba8 to c630c0e Compare February 22, 2024 11:22
@creydr creydr force-pushed the backport-oidc-to-midstream-1.13 branch from 6c0b991 to 01409a2 Compare March 18, 2024 07:49
@creydr
Copy link
Member Author

creydr commented Mar 18, 2024

/test 412-images

@creydr
Copy link
Member Author

creydr commented Mar 18, 2024

/retest

@creydr
Copy link
Member Author

creydr commented Mar 19, 2024

/test 414-test-reconciler-keda-aws-414

creydr and others added 10 commits April 2, 2024 10:56
…3632)

* Update contract to include OIDC information

* Run hack/update-codegen.sh

* Move OIDC SA to egress
…s#3622)

* Provision .status.address.audience and .status.addresses[*].audience in KafkaChannel

* Add kafka Channel e2e test to check if audience is provisioned

* Run goimport

* Update deps
…s status (knative-extensions#3604)

* Support auto generation of Triggers identity service account and expose in AuthStatus

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* make ServiceAccountLister public

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* add oidc unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* integrate oidc unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* add some logic to reconcile triggers, if the features config map gets updated

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* revert vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/controller.go

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix unit test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix Verify Deps and Codegen test

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

* fix unit test and reconcile triggers, in case of the features configmap changes

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>

---------

Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>
…ative-extensions#3660)

* Create KafkaSources OIDC service account and expose in its status

* Run goimport
* Provision contract with OIDC information

* Add DLS audience in KafkaChannel CRD

* Update KafkaSource to expose its sinks audience in status

* Update Trigger test to include OIDC SA in contract

* Propagate KafkaSources OIDC serviceAccountName to consumer and consumergroup

* Propagate triggerv2s serviceAccountName to consumergroup

* Fix unit test
…tive-extensions#3663)

* Add the caching to tokenprovider

* Add the boiler

* Running the codegen

* Running the codegen

* Revert "Running the codegen"

This reverts commit 0ccf69c.

* Use constant, set buffer before token expire, remove unnecessary change

* Codegen changes

* Codegen changes

* Update data-plane/core/src/main/java/dev/knative/eventing/kafka/broker/core/oidc/TokenProvider.java

Co-authored-by: Christoph Stäbler <cstabler@redhat.com>

* Fix the review comments

* Run codegen

* Codegen changes

* Code gen again

---------

Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
* Receiver: reject request for wrong audience

* Switch to AuthenticationHandler

* Fix "Request has already been read" issue

* Change TokenVerifier to an interface

* Initialize TokenVerifier in main

* Add test for AuthenticationHandler

* Only initialize OIDC discovery config in main and create a TokenVerifier per verticle instance.

* Rerun hack/update-codegen.sh

* Move TokenVerifier setup into setup() to prevent null pointer exception when vertx is null

* Update KafkaChannel OIDC e2e tests, to run OIDC conformance tests so the receiver is tested too.

* Run OIDC e2e tests as part of the reconciler suite

* Fix KafkaChannelOIDC e2e test

* Fix lint issue

* Address review comments
* Change TokenProvider to return future to get a token

* Dispatcher add OIDC to token, when target has an audience set

* Add e2e test
* Support exposing the Audience of a Broker

* fix formatting

* fix formatting

* test fixes

* Populate broker.status.addresses[*].audience field too

* Run goimports and gofmt

* Fix unit test

---------

Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
* Add broker OIDC e2e tests

* Fix broker template to allow TLS & OIDC configuration on dead letter sink
creydr and others added 9 commits April 2, 2024 10:56
* Check status code of OIDC discovery endpoint

* Run update-codegen.sh

* Only allow 200 status code on OIDC discovery endpoint
…#3728)

* TokenVerifier: execute blocking calls in parallel

* Revert "TokenVerifier: execute blocking calls in parallel"

This reverts commit f3dbde9.

* Revert: removed changes in contract.pb.go
…on.oidc is enabled (knative-extensions#3761)

* Cancel pod start on invalid OIDC config only if authentication.oidc is enabled

* Update namespaced broker to copy features configmap too.
* Add unit test for FeaturesConfig class

* Update data-plane/core/src/test/java/dev/knative/eventing/kafka/broker/core/features/FeaturesConfigTest.java

Co-authored-by: Calum Murray <cmurray@redhat.com>

---------

Co-authored-by: Calum Murray <cmurray@redhat.com>
@creydr creydr force-pushed the backport-oidc-to-midstream-1.13 branch from 01409a2 to 8f07cd3 Compare April 2, 2024 09:35
@creydr creydr changed the title [WIP] [release-1.13] OIDC support [WIP] [release-1.12] OIDC support Apr 2, 2024
@creydr
Copy link
Member Author

creydr commented Apr 2, 2024

/test 415-test-reconciler-aws-415

@creydr
Copy link
Member Author

creydr commented Apr 2, 2024

**** ERROR: Failed to start up a Kafka cluster ****
/test 415-test-reconciler-aws-415

@pierDipi
Copy link
Member

pierDipi commented Apr 2, 2024

/test ?

Copy link

openshift-ci bot commented Apr 2, 2024

@pierDipi: The following commands are available to trigger required jobs:

  • /test 412-images
  • /test 412-test-conformance-aws-412
  • /test 412-test-e2e-aws-412
  • /test 412-test-reconciler-aws-412
  • /test 412-test-reconciler-encryption-auth-aws-412
  • /test 412-test-reconciler-keda-aws-412
  • /test 415-images
  • /test 415-test-conformance-aws-415
  • /test 415-test-e2e-aws-415
  • /test 415-test-reconciler-aws-415
  • /test 415-test-reconciler-encryption-auth-aws-415
  • /test 415-test-reconciler-keda-aws-415
  • /test 416-images
  • /test 416-test-conformance-aws-416
  • /test 416-test-e2e-aws-416
  • /test 416-test-reconciler-aws-416
  • /test 416-test-reconciler-encryption-auth-aws-416
  • /test 416-test-reconciler-keda-aws-416

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-412-images
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-images
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-test-conformance-aws-415
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-test-e2e-aws-415
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-test-reconciler-aws-415
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-test-reconciler-encryption-auth-aws-415
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-415-test-reconciler-keda-aws-415
  • pull-ci-openshift-knative-eventing-kafka-broker-release-v1.12-416-images

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pierDipi
Copy link
Member

pierDipi commented Apr 2, 2024

/test 412-test-reconciler-aws-412

@creydr
Copy link
Member Author

creydr commented Apr 2, 2024

/retest-required

@creydr creydr changed the title [WIP] [release-1.12] OIDC support [release-1.12] Add OIDC support Apr 3, 2024
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link

openshift-ci bot commented Apr 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pierDipi
Copy link
Member

pierDipi commented Apr 3, 2024

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit 07c386b into openshift-knative:release-v1.12 Apr 3, 2024
10 checks passed
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.

6 participants