]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: configurable swift auth entry point
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 6 Sep 2012 18:04:44 +0000 (11:04 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 7 Sep 2012 23:22:48 +0000 (16:22 -0700)
Fixes: #1776
Swift auth entry point is not hard coded anymore.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/common/config_opts.h
src/rgw/rgw_rest.cc

index 8e959f775ca061fb8a1fb20cf5bc8db81ca346c6..f2a0089da725dc1d16ab57b51a51db1860fd8a67 100644 (file)
@@ -403,6 +403,7 @@ OPTION(rgw_socket_path, OPT_STR, "")   // path to unix domain socket, if not spe
 OPTION(rgw_dns_name, OPT_STR, "")
 OPTION(rgw_swift_url, OPT_STR, "")              // 
 OPTION(rgw_swift_url_prefix, OPT_STR, "swift")  // 
+OPTION(rgw_swift_auth_entry, OPT_STR, "auth")  // entry point for which a url is considered a swift auth url
 OPTION(rgw_enforce_swift_acls, OPT_BOOL, true)
 OPTION(rgw_print_continue, OPT_BOOL, true)  // enable if 100-Continue works
 OPTION(rgw_remote_addr_param, OPT_STR, "REMOTE_ADDR")  // e.g. X-Forwarded-For, if you have a reverse proxy
index 0bf9af0d5350284e237bae78e031f6298e689dd7..e5acb8d3ffbac94951b836b0efcb190d8266d0aa 100644 (file)
@@ -592,7 +592,8 @@ static int init_entities_from_header(struct req_state *s)
     goto done;
   }
 
-  if (strcmp(s->bucket_name, "auth") == 0)
+  if (g_conf->rgw_swift_auth_entry.size() &&
+      g_conf->rgw_swift_auth_entry.compare(s->bucket_name) == 0)
     s->prot_flags |= RGW_REST_SWIFT_AUTH;
 
   if (pos >= 0) {