update go-ucan, with the now spec defined container

https://github.com/ucan-wg/go-ucan/blob/main/pkg/container/SPEC.md
This commit is contained in:
Michael Muré
2025-01-09 13:34:53 +01:00
committed by Michael Muré
parent f18ae547ab
commit 09c8815755
2 changed files with 4 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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