コード例 #1
0
def grantsetter(client_id, code, req, *args, **kwargs):
    expires = utcnow() + timedelta(seconds=100)
    Grant.create(
        client_id=client_id,
        code=code['code'],
        redirect_uri=req.context.get('redirect_uri'),
        scope=' '.join(req.context.get('scopes')),
        user_id=req.context['user'].id,
        expires=expires,
    )
コード例 #2
0
ファイル: base.py プロジェクト: yohanboniface/falcon-oauth
def grantsetter(client_id, code, req, *args, **kwargs):
    expires = utcnow() + timedelta(seconds=100)
    Grant.create(
        client_id=client_id,
        code=code['code'],
        redirect_uri=req.context.get('redirect_uri'),
        scope=' '.join(req.context.get('scopes')),
        user_id=req.context['user'].id,
        expires=expires,
    )
コード例 #3
0
 def is_expired(self):
     """
     Check token expiration with timezone awareness
     """
     return utcnow() >= self.expires
コード例 #4
0
 def __init__(self, **kwargs):
     expires_in = kwargs.pop('expires_in', 60 * 60)
     kwargs['expires'] = utcnow() + timedelta(seconds=expires_in)
     super().__init__(**kwargs)
コード例 #5
0
ファイル: base.py プロジェクト: yohanboniface/falcon-oauth
 def is_expired(self):
     """
     Check token expiration with timezone awareness
     """
     return utcnow() >= self.expires
コード例 #6
0
ファイル: base.py プロジェクト: yohanboniface/falcon-oauth
 def __init__(self, **kwargs):
     expires_in = kwargs.pop('expires_in', 60 * 60)
     kwargs['expires'] = utcnow() + timedelta(seconds=expires_in)
     super().__init__(**kwargs)