mirror of
https://github.com/tlsnotary/tlsn-js.git
synced 2026-01-09 20:47:55 -05:00
fix: parse version from notary url (#45)
* fix: parse version from notary url * fix: rename variable * fix: bump version in demo * fix: change version in quickstart.md
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-loader-spinner": "^6.1.6",
|
||||
"tlsn-js": "0.1.0-alpha.4.1"
|
||||
"tlsn-js": "0.1.0-alpha.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.26",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tlsn-js",
|
||||
"version": "v0.1.0-alpha.5.1",
|
||||
"version": "v0.1.0-alpha.5.2",
|
||||
"description": "",
|
||||
"repository": "https://github.com/tlsnotary/tlsn-js",
|
||||
"main": "build/index.js",
|
||||
|
||||
@@ -23,7 +23,7 @@ For this demo, we also need to run a local notary server.
|
||||
|
||||
1. Clone the TLSNotary repository:
|
||||
```shell
|
||||
git clone https://github.com/tlsnotary/tlsn.git --branch "v0.1.0-alpha.4"
|
||||
git clone https://github.com/tlsnotary/tlsn.git --branch "v0.1.0-alpha.5"
|
||||
```
|
||||
2. Edit the notary server config file (`notary-server/config/config.yaml`) to turn off TLS so that the browser extension can connect to the local notary server without requiring extra steps to accept self-signed certificates in the browser.
|
||||
```yaml
|
||||
|
||||
@@ -111,6 +111,8 @@ pub async fn prover(
|
||||
.map_err(|e| JsValue::from_str(&format!("Could not parse notary_url: {:?}", e)))?;
|
||||
let notary_ssl = notary_url.scheme() == "https" || notary_url.scheme() == "wss";
|
||||
let notary_host = notary_url.authority();
|
||||
let notary_path = notary_url.path();
|
||||
let notary_path_str = if notary_path == "/" { "" } else { notary_path };
|
||||
|
||||
headers
|
||||
.append("Host", notary_host)
|
||||
@@ -134,9 +136,10 @@ pub async fn prover(
|
||||
|
||||
// url
|
||||
let url = format!(
|
||||
"{}://{}/v0.1.0-alpha.5/session",
|
||||
"{}://{}{}/session",
|
||||
if notary_ssl { "https" } else { "http" },
|
||||
notary_host
|
||||
notary_host,
|
||||
notary_path_str
|
||||
);
|
||||
debug!("Request: {}", url);
|
||||
let rust_string = fetch_as_json_string(&url, &opts)
|
||||
@@ -149,9 +152,10 @@ pub async fn prover(
|
||||
|
||||
info!("Notarization response: {:?}", notarization_response,);
|
||||
let notary_wss_url = format!(
|
||||
"{}://{}/v0.1.0-alpha.5/notarize?sessionId={}",
|
||||
"{}://{}{}/notarize?sessionId={}",
|
||||
if notary_ssl { "wss" } else { "ws" },
|
||||
notary_host,
|
||||
notary_path_str,
|
||||
notarization_response.session_id
|
||||
);
|
||||
let (_, notary_ws_stream) = WsMeta::connect(notary_wss_url, None)
|
||||
|
||||
Reference in New Issue
Block a user