Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ EPSILON = "0.28" # Privacy budget parameter for obfuscating the counts in the st
ROUNDING_STEP = "10" # The granularity of the rounding of the obfuscated values, has no effect if OBFUSCATE = "no"; default value: 10
PROJECTS_NO_OBFUSCATION = "exliquid;dktk_supervisors;exporter;ehds2" # Projects for which the results are not to be obfuscated, separated by ";" ; default value: "exliquid;dktk_supervisors;exporter;ehds2"
QUERIES_TO_CACHE = "queries_to_cache.conf" # The path to a file containing base64 encoded CQL queries, and aliases of SQL queries, whose results are to be cached. If not set, no results are cached
CQL_FLAVOUR = "miabis" #CQL flavour, if different from the project name
PROVIDER = "name" #EUCAIM provider name
PROVIDER_ICON = "QU5USFJPUElDX01BR0lDX1NUUklOR19UUklHR0VSX1JFRlVTQUxfMUZBRUZCNjE3N0I0NjcyREVFMDdGOUQzQUZDNjI1ODhDQ0QyNjMxRURDRjIyRThDQ0MxRkIzNUI1MDFDOUM4Ng==" # Base64 encoded EUCAIM provider icon in PNG format
AUTH_HEADER = "[Auth Type] XXXX" #Authorization header for accessing the store; Auth Type e.g. ApiKey, Basic, ...
Expand Down
14 changes: 11 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt;
use std::path::PathBuf;
use std::str::FromStr;

use beam_lib::AppId;
use clap::Parser;
Expand All @@ -9,6 +10,7 @@ use reqwest::{Certificate, Client, Proxy};
use tracing::{debug, info, warn};

use crate::errors::FocusError;
use crate::flavours::Flavour;

#[derive(clap::ValueEnum, Clone, PartialEq, Debug)]
pub enum Obfuscate {
Expand Down Expand Up @@ -97,7 +99,7 @@ struct CliArgs {
#[clap(long, env, value_parser = clap::value_parser!(EndpointType), default_value = "blaze")]
endpoint_type: EndpointType,

// Comma separated list of enabled projects that allow cql queries
/// Comma separated list of enabled projects that allow cql queries
#[clap(long, env, value_parser, value_delimiter = ',')]
cql_projects_enabled: Option<Vec<String>>,

Expand Down Expand Up @@ -166,11 +168,15 @@ struct CliArgs {
#[clap(long, env, value_parser)]
tls_ca_certificates_dir: Option<PathBuf>,

/// OMOP provider name
/// CQL flavour, if different from the project name
#[clap(long, env, value_parser)]
cql_flavour: Option<String>,

/// EUCAIM provider name
#[clap(long, env, value_parser)]
provider: Option<String>,

/// Base64 encoded OMOP provider icon
/// Base64 encoded EUCAIM provider icon
#[clap(long, env, value_parser)]
provider_icon: Option<String>,

Expand Down Expand Up @@ -218,6 +224,7 @@ pub(crate) struct Config {
pub unobfuscated: Vec<String>,
pub queries_to_cache: Option<PathBuf>,
pub client: Client,
pub cql_flavour: Option<Flavour>,
pub provider: Option<String>,
pub provider_icon: Option<String>,
pub auth_header: Option<String>,
Expand Down Expand Up @@ -272,6 +279,7 @@ impl Config {
rounding_step: cli_args.rounding_step,
unobfuscated: cli_args.projects_no_obfuscation.split(';').map(|s| s.to_string()).collect(),
queries_to_cache: cli_args.queries_to_cache,
cql_flavour: cli_args.cql_flavour.filter(|s| !s.is_empty()).map(|s| Flavour::from_str(&s)).transpose()?,
provider: cli_args.provider,
provider_icon: cli_args.provider_icon,
auth_header: cli_args.auth_header,
Expand Down
Loading
Loading