]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #46550 from yuvalif/wip-yuval-lua-filter
authorYuval Lifshitz <ylifshit@redhat.com>
Mon, 15 Aug 2022 16:57:09 +0000 (19:57 +0300)
committerGitHub <noreply@github.com>
Mon, 15 Aug 2022 16:57:09 +0000 (19:57 +0300)
rgw/lua: allow access to object data

reviwed-by: cbodley, anthonyeleven

1  2 
src/rgw/CMakeLists.txt
src/rgw/rgw_admin.cc
src/rgw/rgw_lua.cc
src/rgw/rgw_lua.h
src/rgw/rgw_lua_background.cc
src/rgw/rgw_lua_background.h
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_process.cc
src/test/cli/radosgw-admin/help.t
src/test/rgw/test_rgw_lua.cc

Simple merge
index 637dab47e42efa9ce2ef5c1869bd3d4dbcfd2324,1ed453b500b108f78082c5268c93c2af5dad0b35..e4add62293728a1d478a812459c6463e89f5a8f1
      }
      const rgw::lua::context script_ctx = rgw::lua::to_context(*str_script_ctx);
      if (script_ctx == rgw::lua::context::none) {
-       cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: preRequest, postRequest, background" << std::endl;
+       cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: " << LUA_CONTEXT_LIST << std::endl;
        return EINVAL;
      }
 +    auto lua_manager = store->get_lua_manager();
      std::string script;
 -    const auto rc = rgw::lua::read_script(dpp(), store, tenant, null_yield, script_ctx, script);
 +    const auto rc = rgw::lua::read_script(dpp(), lua_manager.get(), tenant, null_yield, script_ctx, script);
      if (rc == -ENOENT) {
        std::cout << "no script exists for context: " << *str_script_ctx << 
          (tenant.empty() ? "" : (" in tenant: " + tenant)) << std::endl;
      }
      const rgw::lua::context script_ctx = rgw::lua::to_context(*str_script_ctx);
      if (script_ctx == rgw::lua::context::none) {
-       cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: preRequest, postRequest, background" << std::endl;
+       cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: " << LUA_CONTEXT_LIST << std::endl;
        return EINVAL;
      }
 -    const auto rc = rgw::lua::delete_script(dpp(), store, tenant, null_yield, script_ctx);
 +    auto lua_manager = store->get_lua_manager();
 +    const auto rc = rgw::lua::delete_script(dpp(), lua_manager.get(), tenant, null_yield, script_ctx);
      if (rc < 0) {
        cerr << "ERROR: failed to remove script. error: " << rc << std::endl;
        return -rc;
Simple merge
index 562a80c6c3d3330975635b9d645a0592141389a4,ecc583bd41ba7ab36acce386eb9c6cb8d8281401..405492809f29c7e311a53c84a38b72c41c86f665
@@@ -1,18 -1,14 +1,19 @@@
  #pragma once
  
  #include <string>
 +#include <set>
 +#include "rgw_lua_version.h"
  #include "common/async/yield_context.h"
 +#include "common/dout.h"
  #include "rgw_sal_fwd.h"
  
+ class DoutPrefixProvider;
  class lua_State;
  class rgw_user;
 +class DoutPrefixProvider;
  namespace rgw::sal {
    class RadosStore;
 +  class LuaManager;
  }
  
  namespace rgw::lua {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge