Question 32
Answer the given subquestions.
Consider the following endpoints created with a working set up of flask-security and flask-sqlalchemy.
@app.route('/api/public')def public_endpoint(): return jsonify({'message': 'Public access', 'status': 'success'})
@app.route('/api/protected')@auth_required('token')def protected_endpoint(): return jsonify({'message': 'Protected access', 'status': 'authenticated'})
@app.route('/api/admin')@auth_required('token')@roles_required('admin')def admin_endpoint(): return jsonify({'message': 'Admin access', 'status': 'authorized'})Three requests are made to this application:
GET /api/public(no authentication headers)GET /api/protected(no authentication headers)GET /api/adminwith valid authentication token but user has role (not 'admin')
What will be the response status codes for these requests, respectively?
200, 200, 200
200, 401, 403
200, 401, 401
401, 401, 403