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

Create onepassword_ssh_key plugin #9580

Merged

Conversation

mohammedbabelly20
Copy link
Contributor

@mohammedbabelly20 mohammedbabelly20 commented Jan 17, 2025

SUMMARY

FIxes: #7417

ISSUE TYPE
  • New Module/Plugin Pull Request
COMPONENT NAME

Added a new plugin onepassword_ssh_key to fetch private keys stored in onepassword in both SSH format and PKCS#8 format.

@mohammedbabelly20
Copy link
Contributor Author

CC @samdoran

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI docs_fragments docs_fragments plugin (shared docs) lookup lookup plugin needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Jan 17, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

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

hi @mohammedbabelly20 thanks for contributing!

I have some comments on your plugin. Please notice that all new plugins are required to include tests - integration tests are preferred, but unit tests are accepted.

plugins/doc_fragments/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-10 Automatically create a backport for the stable-10 branch labels Jan 18, 2025
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

plugins/doc_fragments/onepassword_ssh_key.py Outdated Show resolved Hide resolved
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added new_plugin New plugin tests tests unit tests/unit labels Jan 20, 2025
@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed ci_verified Push fixes to PR branch to re-run CI labels Jan 20, 2025
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Jan 21, 2025
@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Jan 21, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

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

Hi there, couple of comments here

plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Show resolved Hide resolved
plugins/lookup/onepassword_ssh_key.py Outdated Show resolved Hide resolved
@felixfontein
Copy link
Collaborator

You still need to add the new plugin to BOTMETA, see https://github.com/ansible-collections/community.general/blob/main/CONTRIBUTING.md#creating-new-modules-or-plugins. That will make the last failing test go away.

@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jan 25, 2025
@ansibullbot
Copy link
Collaborator

@mohammedbabelly20 this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Jan 25, 2025
@felixfontein felixfontein merged commit 25a262b into ansible-collections:main Jan 26, 2025
138 checks passed
Copy link

patchback bot commented Jan 26, 2025

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/25a262bdcf76775c8156627e5ab026d73e745b02/pr-9580

Backported as #9632

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 26, 2025
patchback bot pushed a commit that referenced this pull request Jan 26, 2025
* add 1password_ssh_key lookup

* refactor

* Delete onepassword_ssh_key.py

* Revert "Delete onepassword_ssh_key.py"

This reverts commit e17ff7e.

* Delete onepassword_ssh_key.py

* add tests

* add test license

* cleanup

* refactor

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* fix indentation

* fix RETURN indentation

* use get_option to get ssh_format

* linting

* update project year in copyright

* add plugin to BOTMETA.yml

* use OnePassCLIv2's get_raw and use OnePass's token

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 25a262b)
@felixfontein
Copy link
Collaborator

@mohammedbabelly20 thanks for your contribution!
@russoz thanks for reviewing!

felixfontein pushed a commit that referenced this pull request Jan 26, 2025
…plugin (#9632)

Create `onepassword_ssh_key` plugin (#9580)

* add 1password_ssh_key lookup

* refactor

* Delete onepassword_ssh_key.py

* Revert "Delete onepassword_ssh_key.py"

This reverts commit e17ff7e.

* Delete onepassword_ssh_key.py

* add tests

* add test license

* cleanup

* refactor

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* fix indentation

* fix RETURN indentation

* use get_option to get ssh_format

* linting

* update project year in copyright

* add plugin to BOTMETA.yml

* use OnePassCLIv2's get_raw and use OnePass's token

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 25a262b)

Co-authored-by: Mohammed Babelly <[email protected]>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
* add 1password_ssh_key lookup

* refactor

* Delete onepassword_ssh_key.py

* Revert "Delete onepassword_ssh_key.py"

This reverts commit e17ff7e.

* Delete onepassword_ssh_key.py

* add tests

* add test license

* cleanup

* refactor

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* fix indentation

* fix RETURN indentation

* use get_option to get ssh_format

* linting

* update project year in copyright

* add plugin to BOTMETA.yml

* use OnePassCLIv2's get_raw and use OnePass's token

---------

Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-10 Automatically create a backport for the stable-10 branch docs_fragments docs_fragments plugin (shared docs) lookup lookup plugin merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html new_contributor Help guide this first time contributor new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1password lookup for Private Keys has incorrect key format
4 participants