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

Use authorized key parsing instead of reading binary certificates #3113

Merged
merged 4 commits into from
May 20, 2024
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 api/event-source.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion api/event-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,7 @@
},
"sshKeySecret": {
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "SSHKeySecret refers to the secret that contains SSH key"
"description": "SSHKeySecret refers to the secret that contains SSH key. Key needs to contain private key and public key."
},
"username": {
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
Expand Down
2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion eventsources/sources/sftp/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt
if err != nil {
return fmt.Errorf("failed to parse private ssh key. err: %+v", err)
}
publicKey, err := ssh.ParsePublicKey(sshKey)
publicKey, _, _, _, err := ssh.ParseAuthorizedKey(sshKey)
if err != nil {
return fmt.Errorf("failed to parse public ssh key. err: %+v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/eventsource/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/eventsource/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/eventsource/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ type SFTPEventSource struct {
Username *corev1.SecretKeySelector `json:"username,omitempty" protobuf:"bytes,3,opt,name=username"`
// Password required for authentication if any.
Password *corev1.SecretKeySelector `json:"password,omitempty" protobuf:"bytes,4,opt,name=password"`
// SSHKeySecret refers to the secret that contains SSH key
// SSHKeySecret refers to the secret that contains SSH key. Key needs to contain private key and public key.
Copy link
Member

Choose a reason for hiding this comment

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

It changes to require both private and public keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the implementation required private and public key already. Only adjusted the comment to make it clear.

Copy link
Member

Choose a reason for hiding this comment

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

Okay.

SSHKeySecret *corev1.SecretKeySelector `json:"sshKeySecret,omitempty" protobuf:"bytes,5,opt,name=sshKeySecret"`
// Address sftp address.
Address *corev1.SecretKeySelector `json:"address,omitempty" protobuf:"bytes,6,opt,name=address"`
Expand Down
Loading