resources.py 文件源码

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

项目:ddots-api-server 作者: frol 项目源码 文件源码
def post(self, args):
        """
        Create a new OAuth2 Client.

        Essentially, OAuth2 Client is a ``client_id`` and ``client_secret``
        pair associated with a user.
        """
        with api.commit_or_abort(
                db.session,
                default_error_message="Failed to create a new OAuth2 client."
            ):
            # TODO: reconsider using gen_salt
            new_oauth2_client = OAuth2Client(
                user_id=current_user.id,
                client_id=security.gen_salt(40),
                client_secret=security.gen_salt(50),
                **args
            )
            db.session.add(new_oauth2_client)
        return new_oauth2_client
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号