Skip to content

Commit 55dd046

Browse files
Lorenzo ManganiLorenzo Mangani
authored andcommitted
fix serializer
1 parent ec73e9c commit 55dd046

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/redis_secret.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void RedactCommonKeys(KeyValueSecret &result) {
2424
result.redact_keys.insert("password");
2525
}
2626

27-
static unique_ptr<KeyValueSecret> CreateRedisSecretFromConfig(ClientContext &context, CreateSecretInput &input) {
27+
static unique_ptr<BaseSecret> CreateRedisSecretFromConfig(ClientContext &context, CreateSecretInput &input) {
2828
auto scope = input.scope;
2929
auto result = make_uniq<KeyValueSecret>(scope, input.type, input.provider, input.name);
3030

@@ -39,13 +39,19 @@ static unique_ptr<KeyValueSecret> CreateRedisSecretFromConfig(ClientContext &con
3939
return std::move(result);
4040
}
4141

42+
static unique_ptr<BaseSecret> RedisSecretDeserialize(Deserializer &deserializer, BaseSecret base_secret) {
43+
auto result = KeyValueSecret::Deserialize<KeyValueSecret>(deserializer, std::move(base_secret));
44+
RedactCommonKeys(*result);
45+
return std::move(result);
46+
}
47+
4248
void CreateRedisSecretFunctions::Register(DatabaseInstance &instance) {
4349
string type = "redis";
4450

4551
// Register the new type
4652
SecretType secret_type;
4753
secret_type.name = type;
48-
secret_type.deserializer = KeyValueSecret::Deserialize;
54+
secret_type.deserializer = RedisSecretDeserialize;
4955
secret_type.default_provider = "config";
5056
ExtensionUtil::RegisterSecretType(instance, secret_type);
5157

0 commit comments

Comments
 (0)