-
Notifications
You must be signed in to change notification settings - Fork 630
Authenticate requests from PingSources #7525
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
Merged
Merged
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
17c775a
#7320 WIP
Zazzscoot acdba24
added missing address attributes to unit tests
Zazzscoot 36c0f81
added serviceaccoutns/token to pingsource role
Zazzscoot 1518b67
added rule for service accounts (token)
Zazzscoot 709f368
wrote e2e tests for pingsource OIDC
Zazzscoot 16e5faa
removed dynamic role adding
Zazzscoot 4f3c536
removed unnecessary packages
Zazzscoot c28078e
Merge branch 'knative:main' into main
Zazzscoot cdbb2b5
Merge branch 'knative:main' into main
Zazzscoot 6531a80
defined tokenprovider, set audience/OIDCServiceAcc
Zazzscoot 6b1c2f8
Merge branch 'main' into main
Zazzscoot 0a5396b
added check for source.Status.Auth
Zazzscoot 3e3cf30
Merge branch 'knative:main' into main
Zazzscoot 7bef2bc
testing for pr
yijie-04 396bf6c
Merge branch 'knative:main' into main
Zazzscoot f1d4428
reran runner.go
Zazzscoot 23e898c
added oidc
yijie-04 f9185dd
removed testing
yijie-04 00c2a92
added oidc in pingsource test
yijie-04 c5e26e7
Merge pull request #1 from yijie-04/pingsource_auth_request
Zazzscoot 292ecb6
Merge branch 'knative:main' into main
Zazzscoot de55635
added audience nil check and specified destination in auth test
Zazzscoot 5e92caa
added duckv1 to imports for test file
Zazzscoot c687fd6
ran goimports
Zazzscoot 4ac3395
removed dupe ceode from mtping/runner.go
Zazzscoot 1eb1883
ran goimportrs on test/auth/oidc_test.go
Zazzscoot aa3569e
fixing boilerplate for test/auth/features/oidc/pingsource.go
Zazzscoot 99ed180
removed format.sh
Zazzscoot 5bfe16f
Merge branch 'knative:main' into main
Zazzscoot 9352fa8
removed unnecessary comments
Zazzscoot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| Copyright 2021 The Knative Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package oidc | ||
|
|
||
| import ( | ||
| "github.com/cloudevents/sdk-go/v2/test" | ||
| "knative.dev/eventing/test/rekt/resources/pingsource" | ||
| duckv1 "knative.dev/pkg/apis/duck/v1" | ||
| "knative.dev/reconciler-test/pkg/eventshub" | ||
| "knative.dev/reconciler-test/pkg/eventshub/assert" | ||
| "knative.dev/reconciler-test/pkg/feature" | ||
| "knative.dev/reconciler-test/pkg/resources/service" | ||
| ) | ||
|
|
||
| func PingSourceSendEventWithSinkRefOIDC() *feature.Feature { | ||
| source := feature.MakeRandomK8sName("pingsource") | ||
| sink := feature.MakeRandomK8sName("sink") | ||
| sinkAudience := "audience" | ||
| f := feature.NewFeature() | ||
|
|
||
| f.Setup("install sink", eventshub.Install(sink, | ||
| eventshub.OIDCReceiverAudience(sinkAudience), | ||
| eventshub.StartReceiver)) | ||
|
|
||
| f.Requirement("install pingsource", | ||
| pingsource.Install(source, pingsource.WithSink(&duckv1.Destination{ | ||
| Ref: service.AsKReference(sink), | ||
| Audience: &sinkAudience, | ||
| }))) | ||
| f.Requirement("pingsource goes ready", pingsource.IsReady(source)) | ||
|
|
||
| f.Stable("pingsource as event source"). | ||
| Must("delivers events", | ||
| assert.OnStore(sink).MatchEvent(test.HasType("dev.knative.sources.ping")).AtLeast(1)) | ||
|
|
||
| return f | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.