def get(self,name):
   session_id = get_session_id(session, request)
   dao = SecurityPatternDAO(session_id)
   sp = dao.get_security_pattern(name)
   dao.close()
   resp = make_response(json_serialize(sp, session_id=session_id), OK)
   resp.contenttype = 'application/json'
   return resp
 def get(self, name):
     session_id = get_session_id(session, request)
     dao = SecurityPatternDAO(session_id)
     sp = dao.get_security_pattern(name)
     dao.close()
     resp = make_response(json_serialize(sp, session_id=session_id), OK)
     resp.contenttype = 'application/json'
     return resp
 def post(self,security_pattern_name,environment_name):
   session_id = get_session_id(session, request)
   dao = SecurityPatternDAO(session_id)
   dao.situate_security_pattern(security_pattern_name,environment_name)
   dao.close()
   resp_dict = {'message': 'Security Pattern successfully situated'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
  def delete(self,name):
    session_id = get_session_id(session, request)
    dao = SecurityPatternDAO(session_id)
    dao.delete_security_pattern(name)
    dao.close()

    resp_dict = {'message': 'Security Pattern successfully deleted'}
    resp = make_response(json_serialize(resp_dict), OK)
    resp.headers['Content-type'] = 'application/json'
    return resp
 def put(self, name):
     session_id = get_session_id(session, request)
     dao = SecurityPatternDAO(session_id)
     upd_sp = dao.from_json(request)
     dao.update_security_pattern(upd_sp, name)
     dao.close()
     resp_dict = {'message': 'Security Pattern successfully updated'}
     resp = make_response(json_serialize(resp_dict), OK)
     resp.contenttype = 'application/json'
     return resp
 def post(self):
     session_id = get_session_id(session, request)
     dao = SecurityPatternDAO(session_id)
     new_sp = dao.from_json(request)
     dao.add_security_pattern(new_sp)
     dao.close()
     resp_dict = {'message': 'Security Pattern successfully added'}
     resp = make_response(json_serialize(resp_dict), OK)
     resp.contenttype = 'application/json'
     return resp
 def post(self, security_pattern_name, environment_name):
     session_id = get_session_id(session, request)
     dao = SecurityPatternDAO(session_id)
     dao.situate_security_pattern(security_pattern_name, environment_name)
     dao.close()
     resp_dict = {'message': 'Security Pattern successfully situated'}
     resp = make_response(json_serialize(resp_dict), OK)
     resp.contenttype = 'application/json'
     return resp
    def delete(self, name):
        session_id = get_session_id(session, request)
        dao = SecurityPatternDAO(session_id)
        dao.delete_security_pattern(name)
        dao.close()

        resp_dict = {'message': 'Security Pattern successfully deleted'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.headers['Content-type'] = 'application/json'
        return resp
 def put(self,name):
   session_id = get_session_id(session, request)
   dao = SecurityPatternDAO(session_id)
   upd_sp = dao.from_json(request)
   dao.update_security_pattern(upd_sp,name)
   dao.close()
   resp_dict = {'message': 'Security Pattern successfully updated'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
示例#10
0
 def post(self):
   session_id = get_session_id(session, request)
   dao = SecurityPatternDAO(session_id)
   new_sp = dao.from_json(request)
   dao.add_security_pattern(new_sp)
   dao.close()
   resp_dict = {'message': 'Security Pattern successfully added'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp