Support multiple secret columns in SQL directories
This commit is contained in:
@@ -32,9 +32,9 @@ impl SqlDirectory {
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
column_secret: config
|
||||
.value((&prefix, "columns.secret"))
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
.values((&prefix, "columns.secret"))
|
||||
.map(|(_, v)| v.to_string())
|
||||
.collect(),
|
||||
column_quota: config
|
||||
.value((&prefix, "columns.quota"))
|
||||
.unwrap_or_default()
|
||||
|
||||
@@ -209,7 +209,11 @@ impl SqlMappings {
|
||||
|
||||
if let Some(row) = rows.rows.into_iter().next() {
|
||||
for (name, value) in rows.names.into_iter().zip(row.values) {
|
||||
if name.eq_ignore_ascii_case(&self.column_secret) {
|
||||
if self
|
||||
.column_secret
|
||||
.iter()
|
||||
.any(|c| name.eq_ignore_ascii_case(c))
|
||||
{
|
||||
if let Value::Text(secret) = value {
|
||||
principal.secrets.push(secret.into_owned());
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ pub(crate) struct SqlMappings {
|
||||
query_verify: String,
|
||||
query_expand: String,
|
||||
column_description: String,
|
||||
column_secret: String,
|
||||
column_secret: Vec<String>,
|
||||
column_quota: String,
|
||||
column_type: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user