Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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.""")
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):
"""
def __init__(self, url, client, parent):
super(Keys, self).__init__(url, client, parent)
self._url = 'ssh/1.0/keys'