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

Cannot create repo with rsyncKeys #3

Open
Ramblurr opened this issue Aug 3, 2020 · 7 comments
Open

Cannot create repo with rsyncKeys #3

Ramblurr opened this issue Aug 3, 2020 · 7 comments

Comments

@Ramblurr
Copy link
Contributor

Ramblurr commented Aug 3, 2020

The REPO_ADD mutation wrapper does not allow a user to set rsyncKeys when creating a repo.

Would love for this to be possible.

This issue prevents usecases where repos need to be created with rsync access keys, and one wants to use the "create only" token role.

@Ramblurr
Copy link
Contributor Author

Ramblurr commented Aug 3, 2020

Passing in my own query that adds the rsync key params works fine:

REPO_ADD = """
    mutation repoAdd(
      $name: String
      $quota: Int
      $quotaEnabled: Boolean
      $appendOnlyKeys: [String]
      $fullAccessKeys: [String]
      $rsyncKeys: [String]
      $alertDays: Int
      $region: String
      $borgVersion: String
      ) {
        repoAdd(
          name: $name
          quota: $quota
          quotaEnabled: $quotaEnabled
          appendOnlyKeys: $appendOnlyKeys
          fullAccessKeys: $fullAccessKeys
          rsyncKeys: $rsyncKeys
          alertDays: $alertDays
          region: $region
          borgVersion: $borgVersion
        ) {
          repoAdded {
            id
            name
            region
            repoPath
          }
        }
    }
"""

@m3nu
Copy link
Contributor

m3nu commented Aug 3, 2020

The rsyncKeys feature was added after the wrapper code. So it's not in there yet. If you like, you can open a PR or send me the patch here and I'll update it. Or can I just use your last snippet?

@Ramblurr
Copy link
Contributor Author

Ramblurr commented Aug 3, 2020

Or can I just use your last snippet?

Yup! That's totally fine.

@Ramblurr
Copy link
Contributor Author

Ramblurr commented Feb 2, 2021

@m3nu Any plans to use my snippet there or should I send a PR? Also, any plans to release the package to pypi?

@m3nu
Copy link
Contributor

m3nu commented Feb 2, 2021

I can add your last snippet.

For PyPi, the project is probably too small. And it doesn't have setup.py etc yet, IIRC.

@Ramblurr
Copy link
Contributor Author

Ramblurr commented Feb 3, 2021

I can add your last snippet.

I didn't submit a PR 'cause I'm not sure if my snippet should replace the existing REPO_ADD or be a new mutation. What happens when a dev wants to create a repo without rsync keys? Not familiar enough with graphql to know how that would work,

For PyPi, the project is probably too small. And it doesn't have setup.py etc yet, IIRC.

Hah, funny you mention this :) --> #5

@m3nu
Copy link
Contributor

m3nu commented Feb 3, 2021

Perfect. Merged the PR adding setup.py.

You can add REPO_ADD using a new name, so it won't interfere with anything. AFAIK it's being used in the Ansible role, so we shouldn't change it.

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

No branches or pull requests

2 participants