Skip to content

Commit

Permalink
deprecate internal_distributed_timeout_config
Browse files Browse the repository at this point in the history
It has been replaced by internal_distributed_query_state
  • Loading branch information
geobeau committed Nov 10, 2021
1 parent 95a9604 commit 28dd537
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions auth/rest_authenticator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace auth {
return _qp.execute_internal(
update_row_query(),
db::consistency_level::QUORUM,
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{passwords::hash(DEFAULT_USER_PASSWORD, rng_for_salt), DEFAULT_USER_NAME}).then([](auto &&) {
plogger.info("Created default superuser authentication record.");
});
Expand Down Expand Up @@ -237,13 +237,13 @@ namespace auth {
_qp.execute_internal(
query_roles,
consistency_for_user(username),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{username},
true),
_qp.execute_internal(
query_roles_valid,
consistency_for_user(username),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{username},
true)
);
Expand Down Expand Up @@ -343,12 +343,12 @@ namespace auth {
_qp.execute_internal(
create_row_query_roles(),
consistency_for_user(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{role_name, passwords::hash(*options.password, rng_for_salt)}),
_qp.execute_internal(
create_row_query_roles_valid(_authenticator_config.rest_authenticator_endpoint_ttl),
consistency_for_user(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{role_name})
).then([this, role_name, &roles](auto f) {
return modify_membership(role_name, roles);
Expand Down Expand Up @@ -377,12 +377,12 @@ namespace auth {
_qp.execute_internal(
query,
consistency_for_user(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{passwords::hash(*options.password, rng_for_salt), role_name}),
_qp.execute_internal(
create_row_query_roles_valid(_authenticator_config.rest_authenticator_endpoint_ttl),
consistency_for_user(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{role_name})
).then([this, role_name, &roles](auto f) {
return modify_membership(role_name, roles);
Expand All @@ -397,7 +397,7 @@ namespace auth {

return _qp.execute_internal(
query, consistency_for_user(name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{sstring(name)}).discard_result();
}

Expand All @@ -413,7 +413,7 @@ namespace auth {
return _qp.execute_internal(
query,
consistency_for_user(grantee_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{roles, grantee_name});
};

Expand Down
8 changes: 4 additions & 4 deletions auth/rest_role_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace auth {
return _qp.execute_internal(
query,
db::consistency_level::QUORUM,
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{meta::DEFAULT_SUPERUSER_NAME}).then([](auto&&) {
log.info("Created default superuser role '{}'.", meta::DEFAULT_SUPERUSER_NAME);
return make_ready_future<>();
Expand Down Expand Up @@ -140,7 +140,7 @@ namespace auth {
return qp.execute_internal(
query,
consistency_for_role(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{sstring(role_name)},
true).then([](::shared_ptr <cql3::untyped_result_set> results) {
if (results->empty()) {
Expand Down Expand Up @@ -226,7 +226,7 @@ namespace auth {
return _qp.execute_internal(
query,
consistency_for_role(role_name),
internal_distributed_timeout_config(),
internal_distributed_query_state(),
{sstring(role_name), c.is_superuser, c.can_login},
true).discard_result();
}
Expand Down Expand Up @@ -267,7 +267,7 @@ namespace auth {
return _qp.execute_internal(
query,
db::consistency_level::QUORUM,
internal_distributed_timeout_config()).then([](::shared_ptr <cql3::untyped_result_set> results) {
internal_distributed_query_state()).then([](::shared_ptr <cql3::untyped_result_set> results) {
role_set roles;

std::for_each(
Expand Down
8 changes: 4 additions & 4 deletions test/boost/rest_authenticator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static future <std::optional<record>> find_record(cql3::query_processor &qp, std
return qp.execute_internal(
query,
db::consistency_level::LOCAL_ONE,
auth::internal_distributed_timeout_config(),
auth::internal_distributed_query_state(),
{sstring(role_name)},
true).then([](::shared_ptr <cql3::untyped_result_set> results) {
if (results->empty()) {
Expand Down Expand Up @@ -196,7 +196,7 @@ static future<> delete_record_valid(cql3::query_processor &qp, std::string_view
return qp.execute_internal(
query,
db::consistency_level::LOCAL_ONE,
auth::internal_distributed_timeout_config(),
auth::internal_distributed_query_state(),
{sstring(role_name)},
true).discard_result();
};
Expand All @@ -208,7 +208,7 @@ static future <std::optional<sstring>> find_record_valid(cql3::query_processor &
return qp.execute_internal(
query,
db::consistency_level::LOCAL_ONE,
auth::internal_distributed_timeout_config(),
auth::internal_distributed_query_state(),
{sstring(role_name)},
true).then([](::shared_ptr <cql3::untyped_result_set> results) {
if (results->empty()) {
Expand Down Expand Up @@ -239,7 +239,7 @@ static future<> create_superuser_role(cql3::query_processor &qp) {
return qp.execute_internal(
query,
db::consistency_level::QUORUM,
auth::internal_distributed_timeout_config(),
auth::internal_distributed_query_state(),
{auth::meta::DEFAULT_SUPERUSER_NAME,
auth::passwords::hash(sstring(auth::meta::DEFAULT_SUPERUSER_NAME), rng_for_salt)}).discard_result();
}
Expand Down

0 comments on commit 28dd537

Please sign in to comment.