Ejemplo n.º 1
0
 def login(self):
     """
     Returns:
         LoginToken
     """
     method = 'POST'
     path = self.path('login')
     token = yield from authenticate(self.req_handler, method, path)
     return token
Ejemplo n.º 2
0
    def login(self, *, github_token):
        """Log with github.

        Parameters:
            github_token (str): GitHub personal API token
        Returns:
            LoginToken
        """
        method = 'POST'
        path = self.path('login')
        data = {'token': github_token}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token
Ejemplo n.º 3
0
    def login(self, *, github_token):
        """Log with github.

        Parameters:
            github_token (str): GitHub personal API token
        Returns:
            LoginToken
        """
        method = 'POST'
        path = self.path('login')
        data = {'token': github_token}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token
Ejemplo n.º 4
0
    def login(self, *, username, password):
        """Log with ldap.

        Parameters:
            username (str): DN (distinguished name) to be used for login
            password (str): Password for this user
        Returns:
            LoginToken
        """
        method = 'POST'
        path = self.path('login', username)
        data = {'password': password}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token
Ejemplo n.º 5
0
    def login(self, *, username, password):
        """Returns information about the current client token.

        Parameters:
            username (str): The username
            password (str): The password
        Returns:
            LoginToken
        """
        method = 'POST'
        path = self.path('login', username)
        data = {'password': password}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token
Ejemplo n.º 6
0
    def login(self, *, app, user):
        """Returns information about the current client token.

        Parameters:
            app (str): The application ID
            user (str): The user name
        Returns:
            LoginToken: The client token
        """
        method = 'POST'
        path = self.path('login')
        app = extract_id(app)
        user = extract_name(user)
        data = {'app_id': app, 'user_id': user}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token
Ejemplo n.º 7
0
    def login(self, *, app, user):
        """Returns information about the current client token.

        Parameters:
            app (str): The application ID
            user (str): The user name
        Returns:
            LoginToken: The client token
        """
        method = 'POST'
        path = self.path('login')
        app = extract_id(app)
        user = extract_name(user)
        data = {'app_id': app,
                'user_id': user}

        token = yield from authenticate(self.req_handler,
                                        method,
                                        path,
                                        json=data)
        return token