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

Apply garm credentials via api #127

Closed
rafalgalaw opened this issue May 27, 2024 · 0 comments · Fixed by #158
Closed

Apply garm credentials via api #127

rafalgalaw opened this issue May 27, 2024 · 0 comments · Fixed by #158
Assignees
Labels
enhancement New feature or request

Comments

@rafalgalaw
Copy link
Collaborator

What is the feature you would like to have?

With the upcoming garm release, the github credential section is being removed from the config / migrated to the garm database. Github credentials and endpoints are then only managed via the garm-api. Therefore, the garm-operator needs to expose this as well. See PR #243

Key takeaways whilst interacting with garm-cli of current main branch:

  • [github] section in config.toml will be migrated if db table for credentials does not exist on first startup of garm
  • There can be multiple endpoints with the same URL => distinguisged by endpoint_name
  • For each endpoint, there can be multiple github credential entries

So the operator needs to be able to do the following operations:

  1. Create Endpoint:
garm-cli github endpoint create \
    --name mb-github \
    --description "Just an example ghes endpoint" \
    --base-url https://ghes.example.com \
    --upload-url https://upload.ghes.example.com \
    --api-base-url https://api.ghes.example.com \
    --ca-cert-path $HOME/ca-cert.pem
  1. Create Credentials for Endpoint as either PAT or GitHub App:
garm-cli github credentials add \
  --name github-creds \
  --description "GitHub PAT for Enterprise" \
  --auth-type pat \
  --pat-oauth-token gh_theRestOfThePAT \
  --endpoint mb-github
garm-cli github credentials add \
  --name github-creds-app \
  --description "Github App with access to repos" \
  --endpoint mb-github \
  --auth-type app \
  --app-id 1 \
  --app-installation-id 99 \
  --private-key-path $HOME/yourAppName.2024-03-01.private-key.pem
  1. List and delete endpoints & credentials
garm-cli github endpoint list
garm-cli github credentials list

garm-cli github endpoint delete <NAME>
garm-cli github credentials delete <NAME>

Anything else you would like to add?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants