From 06290f6dffec33f4a9f47e4c3733f6779173f595 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 6 Sep 2012 11:04:44 -0700 Subject: [PATCH] rgw: configurable swift auth entry point Fixes: #1776 Swift auth entry point is not hard coded anymore. Signed-off-by: Yehuda Sadeh --- src/common/config_opts.h | 1 + src/rgw/rgw_rest.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 8e959f775ca06..f2a0089da725d 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 0bf9af0d53502..e5acb8d3ffbac 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -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) { -- 2.39.5