Skip to content

Commit

Permalink
cc-kbc: fix kbs url in resource request
Browse files Browse the repository at this point in the history
Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
  • Loading branch information
Xynnn007 authored and fitzthum committed Jul 17, 2023
1 parent f48fb31 commit 88dcc14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions attestation-agent/kbc/src/cc_kbc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Kbc {
}

fn kbs_uri(&self) -> &str {
self.kbs_uri.as_str()
self.kbs_uri.as_str().trim_end_matches('/')
}

fn kbs_protocol_wrapper(&mut self) -> &mut KbsProtocolWrapper {
Expand All @@ -93,7 +93,7 @@ impl Kbc {
);
}

let kbs_addr = &self.kbs_uri();
let kbs_addr = self.kbs_uri();
let repo = &resource.repository;
let r#type = &resource.r#type;
let tag = &resource.tag;
Expand Down
4 changes: 2 additions & 2 deletions attestation-agent/kbs_protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl KbsProtocolWrapper {
async fn attestation(&mut self, kbs_root_url: String) -> Result<String> {
let challenge = self
.http_client()
.post(format!("{kbs_root_url}/{KBS_PREFIX}/auth"))
.post(format!("{kbs_root_url}{KBS_PREFIX}/auth"))
.header("Content-Type", "application/json")
.json(&Request::new(self.tee().to_string()))
.send()
Expand All @@ -107,7 +107,7 @@ impl KbsProtocolWrapper {

let attest_response = self
.http_client()
.post(format!("{kbs_root_url}/{KBS_PREFIX}/attest"))
.post(format!("{kbs_root_url}{KBS_PREFIX}/attest"))
.header("Content-Type", "application/json")
.json(&self.generate_evidence()?)
.send()
Expand Down

0 comments on commit 88dcc14

Please sign in to comment.