noyainrain / meetling

Web app for collaboratively preparing meetings.
https://meetling.org/
GNU General Public License v3.0
15 stars 2 forks source link

Authentication #2

Closed noyainrain closed 9 years ago

noyainrain commented 9 years ago

Implement user authentication and login.

noyainrain commented 9 years ago

Draft:

class Meetling:
    """
    .. attribute:: user

       Active :class:`User`. ``None`` means anonymous access.

    .. attribute:: users

       Map of all :class:`User` s.
    """

    def authenticate(self, secret):
        """Authenticate an user (device) with *secret*.

        If authentication is successful, the identified :class:`User` is returned, ``None``
        otherwise."""

    def login(self):
        """
        .. http:post:: /api/login

           Login a new user (device).

           An :ref:`User` is created and returned. The user's *auth_secret* attribute can be used for future authentication.
        """

class User(Object):
    """
    Meetling user.

    .. describe:: auth_secret

       Secret used for authentication. Visible only to the user oneself.

    .. describe:: create_time

       Time the user was created / registered.

    .. http:get:: /api/users/(id)

       Get the user given by *id*.
    """
noyainrain commented 9 years ago

Implemented in ff1511e795d432a0504f105874bff5425215a5e6 .