diff --git a/services/identity/src/config.rs b/services/identity/src/config.rs --- a/services/identity/src/config.rs +++ b/services/identity/src/config.rs @@ -57,7 +57,8 @@ /// Allowed origins #[arg(long, global = true)] #[arg(env = ALLOW_ORIGIN_LIST)] - allow_origin_list: Option, + #[arg(value_delimiter = ',')] + allow_origin_list: Option>, } #[derive(Subcommand)] @@ -107,7 +108,7 @@ let allow_origin = cli .allow_origin_list .clone() - .map(|s| slice_to_allow_origin(&s)) + .map(|s| vec_to_allow_origin(&s)) .transpose()?; Ok(Self { @@ -188,9 +189,9 @@ .map_err(Error::Opaque) } -fn slice_to_allow_origin(origins: &str) -> Result { +fn vec_to_allow_origin(origins: &Vec) -> Result { let allow_origin_result: Result, Error> = origins - .split(',') + .into_iter() .map(|s| { validate_origin(s)?; HeaderValue::from_str(s.trim()).map_err(Error::InvalidHeaderValue)