Skip to content

Commit

Permalink
chore: switch to locally runnning instance of uniresolver
Browse files Browse the repository at this point in the history
closes #26
  • Loading branch information
its-danny committed Sep 15, 2024
1 parent ee9c43f commit ccee947
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ POSTGRES_POOL_SIZE=
REDIS_URL=

# Universal Resolver URI.
RESOLVER_HOST=
RESOLVER_URL=

# --- Development ---

Expand Down
4 changes: 2 additions & 2 deletions authn/src/handlers/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub(crate) async fn handler(

let document = reqwest::get(format!(
"{resolver_host}/{did}",
resolver_host = &state.env.resolver_host
resolver_host = &state.env.resolver_url
))
.await?
.json::<ResolutionResult>()
Expand Down Expand Up @@ -122,7 +122,7 @@ pub(crate) async fn handler(
VerificationMethod::DIDURL(url) => {
let other_document = reqwest::get(format!(
"{resolver_host}/{url}",
resolver_host = &state.env.resolver_host
resolver_host = &state.env.resolver_url
))
.await?
.json::<ResolutionResult>()
Expand Down
10 changes: 5 additions & 5 deletions common/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub struct Environment {
pub postgres_pool_size: u32,
#[serde(default = "default_redis_url")]
pub redis_url: String,
#[serde(default = "default_resolver_host")]
pub resolver_host: String,
#[serde(default = "default_resolver_url")]
pub resolver_url: String,
#[serde(default)]
pub development: bool,
}
Expand All @@ -38,8 +38,8 @@ fn default_redis_url() -> String {
"redis://localhost".into()
}

fn default_resolver_host() -> String {
"http://localhost:9003/1.0/identifiers".into()
fn default_resolver_url() -> String {
"http://localhost:9050/1.0/identifiers".into()
}

impl Default for Environment {
Expand All @@ -50,7 +50,7 @@ impl Default for Environment {
postgres_url: Default::default(),
postgres_pool_size: Default::default(),
redis_url: Default::default(),
resolver_host: Default::default(),
resolver_url: Default::default(),
development: Default::default(),
}
}
Expand Down
3 changes: 3 additions & 0 deletions dev/devbox/process-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ processes:
postgresql:
condition: process_healthy

docker_compose:
command: docker-compose -f dev/docker-compose.yml up

mist:
command: RUST_LOG=tower_http=trace cargo watch -x run -p runner
depends_on:
Expand Down
10 changes: 10 additions & 0 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
uni-resolver-web:
image: universalresolver/uni-resolver-web:latest
ports:
- "9050:8080"

did-jwk-driver:
image: transmute/restricted-resolver:latest
ports:
- "9051:8080"
10 changes: 10 additions & 0 deletions local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ services:
volumes:
- redis_data:/data

uni-resolver-web:
image: universalresolver/uni-resolver-web:latest
ports:
- "9050:8080"

did-jwk-driver:
image: transmute/restricted-resolver:latest
ports:
- "9051:8080"

mist:
image: mist:latest
ports:
Expand Down

0 comments on commit ccee947

Please sign in to comment.