awsumepy.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:awsume 作者: trek10inc 项目源码 文件源码
def is_valid_awsume_session(awsumeSession):
    """
    awsumeSession - the session to validate;
    return whether or not the session is valid;
    if credentials are expired, or don't exist, they're invalid;
    else they are valid
    """
    log.info('Checking if the session is valid')

    #check if the session has an expiration
    if awsumeSession.get('Expiration'):
        #check if the session is expired
        if awsumeSession.get('Expiration') > datetime.datetime.now().replace():
            return True
        log.debug('Session is expired')
        return False
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号