@app.route('<STR_LIT>')<EOL>def digest_auth(request, qop=None, user='<STR_LIT:user>', passwd='<STR_LIT>'):
if qop not in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>qop = None<EOL><DEDENT>if '<STR_LIT>' not in request.headers ornot check_digest_auth(user, passwd) or'<STR_LIT>' not in request.headers:<EOL><INDENT>response = app.make_response('<STR_LIT>')<EOL>response.status_code = <NUM_LIT><EOL>nonce = H(b'<STR_LIT>'.join([<EOL>getattr(request, '<STR_LIT>', u'<STR_LIT>').encode('<STR_LIT:ascii>'),<EOL>b'<STR_LIT::>',<EOL>str(time.time()).encode('<STR_LIT:ascii>'),<EOL>b'<STR_LIT::>',<EOL>os.urandom(<NUM_LIT:10>)<EOL>]))<EOL>opaque = H(os.urandom(<NUM_LIT:10>))<EOL>auth = WWWAuthenticate('<STR_LIT>')<EOL>auth.set_digest('<STR_LIT>', nonce, opaque=opaque,<EOL>qop=('<STR_LIT>', '<STR_LIT>') if qop is None else (qop, ))<EOL>response.headers['<STR_LIT>'] = auth.to_header()<EOL>response.headers['<STR_LIT>'] = '<STR_LIT>'<EOL>return response<EOL><DEDENT>return jsonify(authenticated=True, user=user)<EOL>
Prompts the user for authorization using HTTP Digest auth