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

Support group unique ssh keys for githubrepo hook #2480

Merged
merged 10 commits into from May 21, 2022

Conversation

mjbnz
Copy link
Contributor

@mjbnz mjbnz commented Feb 17, 2022

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests added or adapted (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

This patch adds support for group unique ssh keys for the githubrepo hook.

Keys are specified by private key only (public keys for Rugged are assumed to be the same filename + .pub), in the remote_repo configuration option. The patch supports existing functionality of:

remote_repo:
  group1: <remote_url1>
  group2: <remote_url>

and expands to support:

remote_repo:
  group1:
    url: <remote_url1>
    privatekey: <priviate_key1>
  group2:
    url: <remote_url>
    privatekey: <priviate_key2>

@mjbnz
Copy link
Contributor Author

mjbnz commented Feb 17, 2022

This branch is on top of my 'rubocop-fixes' branch, hence the extra commits.

@mjbnz mjbnz force-pushed the support-group-sshkeys-githubrepo branch from 7d072e6 to 6c4047c Compare February 19, 2022 05:19
@mortzu
Copy link
Collaborator

mortzu commented Mar 8, 2022

Can you reflect the change in the documentation please?

Allows optional usage of 'pubkey', derives from private key path (adds .pub)

Signed-off-by: Mike Beattie <mike@ethernal.org>
Signed-off-by: Mike Beattie <mike@ethernal.org>
pre-requisite for having group unique ssh keys, change repo url to a 'url'
dictionary key

Signed-off-by: Mike Beattie <mike@ethernal.org>
Signed-off-by: Mike Beattie <mike@ethernal.org>
Signed-off-by: Mike Beattie <mike@ethernal.org>
Signed-off-by: Mike Beattie <mike@ethernal.org>
This also allows for only some repos to be pushed, if configured

Signed-off-by: Mike Beattie <mike@ethernal.org>
@mjbnz mjbnz force-pushed the support-group-sshkeys-githubrepo branch from 6c4047c to 0c99e3d Compare March 8, 2022 21:43
Asetus doesn't support dig(), and private only vs public/private can be simplfied to a single check

Signed-off-by: Mike Beattie <mike@ethernal.org>
@mjbnz
Copy link
Contributor Author

mjbnz commented Mar 9, 2022

Can you reflect the change in the documentation please?

Done, and fixed a bug I'd introduced (Asetus doesn't support .dig())

Signed-off-by: Mike Beattie <mike@ethernal.org>
@mjbnz mjbnz force-pushed the support-group-sshkeys-githubrepo branch from 346b62e to cc2d3a0 Compare March 9, 2022 00:56
@mortzu
Copy link
Collaborator

mortzu commented May 13, 2022

Please fix the merge conflict

@mortzu mortzu merged commit e891f51 into ytti:master May 21, 2022
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.

None yet

2 participants