Skip to content

Commit

Permalink
Merge branch 'feature/disable-local-bucket-check' into release/1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kellymclaughlin committed Aug 12, 2013
2 parents c5bd7b3 + e6b67e9 commit e2e98ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/riak_cs_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
auth_module/0,
cluster_id/1,
cs_version/0,
disable_local_bucket_check/0,
enforce_multipart_part_size/0,
get_env/3,
key_list_multiplier/0,
Expand Down Expand Up @@ -124,6 +125,10 @@ admin_auth_enabled() ->
auth_module() ->
get_env(riak_cs, auth_module, ?DEFAULT_AUTH_MODULE).

-spec disable_local_bucket_check() -> boolean().
disable_local_bucket_check() ->
get_env(riak_cs, disable_local_bucket_check, false).

-spec enforce_multipart_part_size() -> boolean().
enforce_multipart_part_size() ->
get_env(riak_cs, enforce_multipart_part_size, true).
Expand Down Expand Up @@ -228,7 +233,7 @@ proxy_get_active() ->
trust_x_forwarded_for() ->
case application:get_env(riak_cs, trust_x_forwarded_for) of
{ok, true} -> true;
{ok, false} -> false;
{ok, false} -> false;
{ok, _} ->
_ = lager:warning("trust_x_forwarded_for value in app.config is invalid"),
false;
Expand Down
3 changes: 2 additions & 1 deletion src/riak_cs_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ create_bucket(User, UserObj, Bucket, ACL, RiakPid) ->
CurrentBuckets = get_buckets(User),

%% Do not attempt to create bucket if the user already owns it
AttemptCreate = not bucket_exists(CurrentBuckets, binary_to_list(Bucket)),
AttemptCreate = riak_cs_config:disable_local_bucket_check() orelse
not bucket_exists(CurrentBuckets, binary_to_list(Bucket)),
case AttemptCreate of
true ->
case valid_bucket_name(Bucket) of
Expand Down

0 comments on commit e2e98ad

Please sign in to comment.