FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gl.keys.get(id) doesn't return key · Issue #212 · python-gitlab/python-gitlab · GitHub

Repository navigation

gl.keys.get(id) doesn't return key #212

Description

When I'm trying to get info about deploy key using key id of another user using root token result is empty.
gl.keys.list(all=True) returns keys only for root user.

Although
GET https://gitlab.domain/api/v3/keys/124?private_token=blabla in rest client works fine.

Activity

gpocentek commented on Feb 4, 2017

Contributor

I've tested locally and haven't been able to reproduce the problem.

Have you verified that the keys you're trying to list are really deploy keys, and not the user's own keys?

gpocentek commented on Feb 4, 2017

Contributor

BTW your GET example is not accessing a deploy key, the URL would be /v3/deploy_keys/....

loockass commented on Feb 4, 2017

Author

Yep, you're right. It was my fault.

But don't you think that 'keys' may be a little ambiguous name for this since we can list users own keys via api using keys in GET? And is there any possibility to do this with python-gitlab?

gpocentek commented on Feb 4, 2017

Contributor

Yes I agree, using gl.keys is probably not the best idea. I could probably add a deploykeys attribute.

The user own keys can be listed using the gl.user.keys manager:

>>> gl.auth()  # makes sure that gl.user is created
>>> gl.user.keys.list()
[<CurrentUserKey id:1>]
locked as resolved and limited conversation to collaborators on Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL