コード例 #1
0
ファイル: client.py プロジェクト: bugrevelio/lastuser
 def refresh(self):
     """
     Create a new token while retaining the refresh token.
     """
     if self.refresh_token is not None:
         self.token = buid()
         self.secret = newsecret()
コード例 #2
0
ファイル: client.py プロジェクト: supreethsubbaraya/lastuser
 def refresh(self):
     """
     Create a new token while retaining the refresh token.
     """
     if self.refresh_token is not None:
         self.token = buid()
         self.secret = newsecret()
コード例 #3
0
ファイル: oauth.py プロジェクト: sindhus/lastuser
def oauth_make_auth_code(client, scope, redirect_uri):
    """
    Make an auth code for a given client. Caller must commit
    the database session for this to work.
    """
    authcode = AuthCode(user=g.user, session=g.usersession, client=client, scope=scope, redirect_uri=redirect_uri[:1024])
    authcode.code = newsecret()
    db.session.add(authcode)
    return authcode.code
コード例 #4
0
def oauth_make_auth_code(client, scope, redirect_uri):
    """
    Make an auth code for a given client. Caller must commit
    the database session for this to work.
    """
    authcode = AuthCode(user=g.user, session=g.usersession, client=client, scope=scope, redirect_uri=redirect_uri[:1024])
    authcode.code = newsecret()
    db.session.add(authcode)
    return authcode.code
コード例 #5
0
ファイル: client.py プロジェクト: bugrevelio/lastuser
    def new(cls, client):
        """
        Create a new client credential and return (cred, secret). The secret is not
        saved in plaintext, so this is the last time it will be available.

        :param client: The client for which a name/secret pair is being generated
        """
        cred = cls(client=client, name=buid())
        db.session.add(cred)
        secret = newsecret()
        cred.secret_hash = 'sha256$' + sha256(secret).hexdigest()
        return cred, secret
コード例 #6
0
ファイル: client.py プロジェクト: supreethsubbaraya/lastuser
    def new(cls, client):
        """
        Create a new client credential and return (cred, secret). The secret is not
        saved in plaintext, so this is the last time it will be available.

        :param client: The client for which a name/secret pair is being generated
        """
        cred = cls(client=client, name=buid())
        db.session.add(cred)
        secret = newsecret()
        cred.secret_hash = 'sha256$' + sha256(secret).hexdigest()
        return cred, secret
コード例 #7
0
ファイル: auth_client.py プロジェクト: vishwatejharer/funnel
    def new(cls, auth_client):
        """
        Create a new client credential and return (cred, secret). The secret is not
        saved in plaintext, so this is the last time it will be available.

        :param auth_client: The client for which a name/secret pair is being generated
        """
        cred = cls(auth_client=auth_client, name=buid())
        db.session.add(cred)
        secret = newsecret()
        cred.secret_hash = (
            'blake2b$32$' +
            blake2b(secret.encode(), digest_size=32).hexdigest())
        return cred, secret
コード例 #8
0
ファイル: client.py プロジェクト: bugrevelio/lastuser
 def __init__(self, **kwargs):
     super(AuthToken, self).__init__(**kwargs)
     self.token = buid()
     if self._user:
         self.refresh_token = buid()
     self.secret = newsecret()
コード例 #9
0
 def __init__(self, email, **kwargs):
     super(UserEmailClaim, self).__init__(**kwargs)
     self.verification_code = newsecret()
     self._email = email.lower()
     self.md5sum = md5(self._email).hexdigest()
     self.domain = email.split('@')[-1]
コード例 #10
0
 def __init__(self, **kwargs):
     super(PasswordResetRequest, self).__init__(**kwargs)
     self.reset_code = newsecret()
コード例 #11
0
ファイル: user.py プロジェクト: hasgeek/lastuser
 def __init__(self, **kwargs):
     super(PasswordResetRequest, self).__init__(**kwargs)
     self.reset_code = newsecret()
コード例 #12
0
ファイル: user.py プロジェクト: hasgeek/lastuser
 def __init__(self, email, **kwargs):
     super(UserEmailClaim, self).__init__(**kwargs)
     self.verification_code = newsecret()
     self._email = email.lower()
     self.md5sum = md5(self._email).hexdigest()
     self.domain = email.split('@')[-1]
コード例 #13
0
ファイル: client.py プロジェクト: supreethsubbaraya/lastuser
 def __init__(self, **kwargs):
     super(AuthToken, self).__init__(**kwargs)
     self.token = buid()
     if self._user:
         self.refresh_token = buid()
     self.secret = newsecret()