input: 
  from flask import Flask, request
  from flask_restful import Resource, Api
  from flask_jwt import JWT, jwt_required
  
  app = Flask(__name__)
  api = Api(app)
  
  # Setup JWT authentication
  app.secret_key = 'super-secret-key'
  jwt = JWT(app, authenticate, identity)
  
  items = []
  
  class Item(Resource):
      @jwt_required()
      def get(self, name):
          for item in items:
              if item['name'] == name:
                  return item
          return {'item': None}, 404
  
      def post(self, name):
          new_item = {'name': name, 'price': 12.00}
          items.append(new_item)
          return new_item, 201
  
  
  class ItemList(Resource):
      def get(self):
          return {'items': items}
  
  
  api.add_resource(Item, '/item/<string:name>')
  api.add_resource(ItemList, '/items')
  
  if __name__ == '__main__':
      app.run(port=5000, debug=True)
  # Test cases:
  # 1. POST /item/test_item should return {'name': 'test_item', 'price': 12.00} with status code 201
  # 2. GET /items should return {'items': [{'name': 'test_item', 'price': 12.00}]}
  # 3. GET /item/test_item should return {'item': None} with status code 404 (if not authenticated)
  
output:     
      @jwt_required()
      def delete(self, name):
          global items
          items = list(filter(lambda x: x['name'] != name, items))
          return {'message': 'Item deleted'}
  
      @jwt_required()
      def put(self, name):
          data = request.get_json()
          item = next(filter(lambda x: x['name'] == name, items), None)
          if item is None:
              item = {'name': name, 'price': data['price']}
              items.append(item)
          else:
              item.update(data)
          return item
  
  class User(Resource):
      def post(self):
          data = request.get_json()
          username = data['username']
          password = data['password']
          if username and password:
              return {'message': 'User created'}, 201
          return {'message': 'Invalid data'}, 400
  
  api.add_resource(User, '/register')
  
  def authenticate(username, password):
      if username == 'admin' and password == 'password':
          return {'username': 'admin'}
  
  def identity(payload):
      user_id = payload['identity']
      return {'username': 'admin'}
  