Skip to content

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

Closed

Description

@loockass

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

  1. gpocentek commented on Feb 4, 2017

    @gpocentek
    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?

  2. gpocentek commented on Feb 4, 2017

    @gpocentek
    Contributor

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

  3. loockass commented on Feb 4, 2017

    @loockass
    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?

  4. gpocentek commented on Feb 4, 2017

    @gpocentek
    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>]
  5. 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