Skip to content

Commit 05215b5

Browse files
committed
mics secdist: prevent settings copy
1 parent f139635 commit 05215b5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/src/storages/secdist/default_provider.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ void UpdateFromEnv(formats::json::Value& doc,
123123

124124
} // namespace
125125

126-
DefaultProvider::DefaultProvider(Settings settings) : settings_{settings} {}
126+
DefaultProvider::DefaultProvider(Settings settings)
127+
: settings_{std::move(settings)} {}
127128

128129
formats::json::Value DefaultProvider::Get() const {
129130
auto doc =

core/src/storages/secdist/secdist_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ TEST(SecdistYamlConfig, Sample) {
9999
{std::make_unique<storages::secdist::DefaultProvider>(
100100
std::move(provider_settings))}};
101101

102-
/// [Secdist Usage Sample - SecdistConfig]
103102
const auto& user_passwords = secdist_config.Get<UserPasswords>();
104103

105104
const auto password = UserPasswords::Password{"drowssap"};
106105
const auto another_password = UserPasswords::Password{"drowssap rehtona"};
107106
EXPECT_TRUE(user_passwords.IsMatching("username", password));
108107
EXPECT_FALSE(user_passwords.IsMatching("username2", password));
109108
EXPECT_TRUE(user_passwords.IsMatching("another username", another_password));
110-
/// [Secdist Usage Sample - SecdistConfig]
111109
}
112110

113111
UTEST(SecdistConfig, EnvironmentVariable) {

0 commit comments

Comments
 (0)