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

source-sftp: ssh key authentication #1202

Merged
merged 3 commits into from
Jan 24, 2024
Merged

source-sftp: ssh key authentication #1202

merged 3 commits into from
Jan 24, 2024

Conversation

mdibaiee
Copy link
Member

@mdibaiee mdibaiee commented Jan 23, 2024

Description:

  • Support SSH key authentication
  • Tested by creating a server, enabling SSH key authentication for the server and using the private key in the config of this connector to capture data

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)


This change is Reviewable

Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

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

LGTM % updating the spec test snapshot so the connector can build

Password string `json:"password" jsonschema:"title=Password" jsonschema_extras:"secret=true,order=2"`
Directory string `json:"directory" jsonschema:"title=Directory" jsonschema_extras:"order=3"`
MatchFiles string `json:"matchFiles,omitempty" jsonschema:"title=Match Files Regex" jsonschema_extras:"order=4"`
Password string `json:"password,omitempty" jsonschema:"title=Password" jsonschema_extras:"secret=true,order=2"`
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to have password and SSH key as a "one of" option in the config, to make it clear that you don't need to provide both of them. This would probably require writing out the spec by hand since IIRC there's not a way to represent that in the struct tags, and also some kind of backward compatibility with existing specs that have "password" in the top-level. I wish I would have anticipated needing to add another authentication method and originally made this a "one of" to begin with.

It's probably fine having them both as top-level options until/if we need more than 2 authentication options, so I'll leave it up to you as to wether its worth the effort or not to make it a "one of" right now. If nothing else, we should update the descriptions to say "may be left blank if using the other thing".

Copy link
Member Author

@mdibaiee mdibaiee Jan 24, 2024

Choose a reason for hiding this comment

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

@williamhbaker yeah I thought about oneOf, but I think there is a lot of effort necessary for that. At the moment I don't see this connector wanting another authentication method so we can keep it this way for now for simplicity's sake. Added to the description of SSHKey and Password about this

@mdibaiee mdibaiee merged commit fdab882 into main Jan 24, 2024
44 checks passed
@mdibaiee mdibaiee deleted the mahdi/sftp-ssh-key branch January 24, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants