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

Trait method to add conditions for SSH agent server when accepting requests for operations #166

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

gotlougit
Copy link
Contributor

Fix #165

The russh_keys::agent::server::Agent trait now has another async trait we can define if necessary which will check if we should be able to perform a given operation or not. External developers can implement this trait method with their own code, allowing the request to fail if necessary.

The operation types are represented in a newly created MessageType enum and passed into this new method. By default, the method returns true, so old code shouldn't be affected by this change.

@Eugeny
Copy link
Owner

Eugeny commented Jul 27, 2023

Thank you for the PR! Could you please check the .expect() usage? As russh doesn't allow panics, you need to return an Err in that case, otherwise LGTM ✌️

@Eugeny Eugeny merged commit 6563f8c into Eugeny:master Jul 28, 2023
3 checks passed
@Eugeny
Copy link
Owner

Eugeny commented Jul 28, 2023

Perfect! @all-contributors please add @gotlougit for code

@allcontributors
Copy link
Contributor

@Eugeny

I've put up a pull request to add @gotlougit! 🎉

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.

Allow creating custom conditions for SSH agent server accepting requests for certain keys
2 participants