Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting did:onion proxy URL #292

Merged
merged 1 commit into from
Apr 21, 2022
Merged
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
15 changes: 14 additions & 1 deletion lib/src/did_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ use std::env::VarError;

lazy_static! {
static ref DIDTZ: DIDTz = DIDTz::default();
static ref DIDONION: DIDOnion = DIDOnion::default();
static ref DIDONION: DIDOnion = {
let mut onion = DIDOnion::default();
if let Some(url) = match std::env::var("DID_ONION_PROXY_URL") {
Ok(url) => Some(url),
Err(VarError::NotPresent) => None,
Err(VarError::NotUnicode(err)) => {
eprintln!("Unable to parse DID_ONION_PROXY_URL: {:?}", err);
None
}
} {
onion.proxy_url = url;
}
onion
};
static ref ION: DIDION = DIDION::new(
match std::env::var("DID_ION_API_URL") {
Ok(string) => Some(string),
Expand Down