From 09c8815755ec41843543c3c8855a5e38ad54af1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Thu, 9 Jan 2025 13:34:53 +0100 Subject: [PATCH] update go-ucan, with the now spec defined container https://github.com/ucan-wg/go-ucan/blob/main/pkg/container/SPEC.md --- toolkit/client/client_test.go | 4 ++-- toolkit/server/exectx/ucanctx_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolkit/client/client_test.go b/toolkit/client/client_test.go index 0e0d25f..5a310f5 100644 --- a/toolkit/client/client_test.go +++ b/toolkit/client/client_test.go @@ -36,10 +36,10 @@ func ExampleNewClient() { handleError(err) // this container holds the invocation and all the delegation proofs - b64, err := cont.ToCborBase64() + b64, err := cont.ToBase64StdPadding() handleError(err) - fmt.Println(string(b64)) + fmt.Println(b64) } func handleError(err error) { diff --git a/toolkit/server/exectx/ucanctx_test.go b/toolkit/server/exectx/ucanctx_test.go index 54b8dff..d891fdd 100644 --- a/toolkit/server/exectx/ucanctx_test.go +++ b/toolkit/server/exectx/ucanctx_test.go @@ -64,7 +64,7 @@ func ExampleContext() { cont := container.NewWriter() cont.AddSealed(dlgCid, dlgBytes) cont.AddSealed(invCid, invBytes) - contBytes, _ := cont.ToCborBase64() + contBytes, _ := cont.ToBase64StdPadding() // MAKING A REQUEST: we pass the container in the Bearer HTTP header @@ -84,7 +84,7 @@ func ExampleContext() { // Note: we obviously want something more robust, this is an example // Note: if an error occur, we'll want to return an HTTP 401 Unauthorized data := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") - cont, _ := container.FromCborBase64(data) + cont, _ := container.FromString(data) ucanCtx, _ := exectx.FromContainer(cont) // insert into the go context