Skip to content

Commit

Permalink
Use authorized key parsing instead of reading binary certificates (#3113
Browse files Browse the repository at this point in the history
)

Signed-off-by: florian-feicht <florian.feicht@adesso-afida.com>
  • Loading branch information
florian-feicht authored May 20, 2024
1 parent 0cc54eb commit 70ae784
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
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.
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

0 comments on commit 70ae784

Please sign in to comment.