How to use the stashy.ssh.Keys function in stashy

To help you get started, we’ve selected a few stashy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cosmin / stashy / stashy / ssh.py View on Github external
params = dict(user=user)
        return self._client.post(self.url(""), data=data, params=params)

    @response_or_error
    def get(self, user):
        """
        Retrieve the keys matching the supplied user.
        """
        params = dict(user=user)
        return self._client.get(self.url(""), params=params)

    def __getitem__(self, item):
        return Key(item, self.url(item), self._client, self)


update_doc(Keys.all, """Retrieve keys.""")
github cosmin / stashy / stashy / client.py View on Github external
from .admin import Admin
from .projects import Projects
from .ssh import Keys
from .compat import basestring
from .allrepos import Repos
from .builds import Build

class Stash(object):
    _url = "/"

    def __init__(self, base_url, username=None, password=None, oauth=None, verify=True, token=None, session=None):
        self._client = StashClient(base_url, username, password, oauth, verify, token, session=session)

    admin = Nested(Admin)
    projects = Nested(Projects)
    ssh = Nested(Keys)
    repos = Nested(Repos)

    def groups(self, filter=None):
        """
        Consider using stash.admin.groups instead.
        """
        return self.admin.groups.get(filter)

    def users(self, filter=None):
        """
        Consider using stash.admin.users instead.
        """
        return self.admin.users.get(filter)

    def build(self, git_hash):
        """
github cosmin / stashy / stashy / ssh.py View on Github external
def __init__(self, url, client, parent):
        super(Keys, self).__init__(url, client, parent)
        self._url = 'ssh/1.0/keys'