-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: w3 delegation create --base64
& w3 space add <base64>
#158
Conversation
…ed proof>` **export** a delegation as base64 encoded identity CID with `w3 delegation create --stringify` ```shell $ w3 delegation create did:key:z6MkviAsUfBwegmB57byQ7SZTFtX4jNjo31delegation create did:key:z6MkviAsUfBwegmB57byQ7SZTFtX4jNjo315EvgurjWYoTRX --can 'store/add' --can 'upload/add' --stringify mAYIEAO0OEaJlcm9vdHOAZ3ZlcnNpb24BvQUBcRIgL7w/mAWPOV8Wt/B0ygdaOI+20/ZG8pX+5YzZ5X9U4y6oYXNYRO2hA0CbPDJlxyrorHHdNAUnRUDA4xU7KHgHHstkM8tBxq+6KaQP5xLCknOh9TjkR0S0yuK/fiFxKwRDUHfECFEWQn4DYXZlMC45LjFjYXR0hqJjY2FuZ3NwYWNlLypkd2l0aHg4ZGlkOmtleTp6Nk1raGZ6VHdaSjI4YVJvYkNwNzZ1WFJxenNqSDZHTnUxOFdGd011bWtBRjVvaleiY2NhbmdzdG9yZS8qZHdpdGh4OGRpZDprZXk6ejZNa2hmelR3WkoyOGFSb2JDcDc2dVhScXpzakg2R051MThXRndNdW1rQUY1b2pXomNjYW5odXBsb2FkLypkd2l0aHg4ZGlkOmtleTp6Nk1raGZ6VHdaSjI4YVJvYkNwNzZ1WFJxenNqSDZHTnUxOFdGd011bWtBRjVvaleiY2NhbmhhY2Nlc3MvKmR3aXRoeDhkaWQ6a2V5Ono2TWtoZnpUd1pKMjhhUm9iQ3A3NnVYUnF6c2pINkdOdTE4V0Z3TXVta0FGNW9qV6JjY2FuamZpbGVjb2luLypkd2l0aHg4ZGlkOmtleTp6Nk1raGZ6VHdaSjI4YVJvYkNwNzZ1WFJxenNqSDZHTnUxOFdGd011bWtBRjVvaleiY2Nhbmd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Nkx1HG/pjZXhwGmc3LRpjZmN0gaFlc3BhY2WhZG5hbWVldG9vdHNjaXNzWCLtAS/V/qeFMs9Oc0h9KJfE2D16cFPRJYzUaNTtfLmG1pb5Y3ByZoDbAwFxEiB9iHpD1ttdKEQCvBZ8jJBD7Wqw1abOtYwNCKAKYALXMqhhc1hE7aEDQJ7U8I+a4Au/eb10r9T89weG/Nl2jccEUXHs8wq+i2tU0Iaik8KaKvovDqqE57JU8ZoY0JAzOBW7cMLGcV6/UwthdmUwLjkuMWNhdHSComNjYW5pc3RvcmUvYWRkZHdpdGh4OGRpZDprZXk6ejZNa2hmelR3WkoyOGFSb2JDcDc2dVhScXpzakg2R051MThXRndNdW1rQUY1b2pXomNjYW5qdXBsb2FkL2FkZGR3aXRoeDhkaWQ6a2V5Ono2TWtoZnpUd1pKMjhhUm9iQ3A3NnVYUnF6c2pINkdOdTE4V0Z3TXVta0FGNW9qV2NhdWRYIu0B8YzaLs8NDe7oZt6rlpsW6iMh8XsoXZLvkHPqtftYRXZjZXhw9mNmY3SBoWVzcGFjZaFkbmFtZWV0b290c2Npc3NYIu0B6G/tfSQzFAbPrtXuuOrzdjC6L0FFwO8SXhbNkx1HG/pjcHJmgtgqWCUAAXESIC+8P5gFjzlfFrfwdMoHWjiPttP2RvKV/uWM2eV/VOMu2CpYJQABcRIgL7w/mAWPOV8Wt/B0ygdaOI+20/ZG8pX+5YzZ5X9U4y4 ``` ...yes, what if we put the CAR _in_ the CID! That way we can detect when the input has been truncted, and the screed is self describing... you can paste it into cid.ipfs.tech and it'll tell you it's CAR flavour identity hashed bytes! **import** a space from a stringified proof ```shell $ w3 space $PROOF did:key:z6MkhfzTwZJ28aRobCp76uXRqzsjH6GNu18WFwMumkAF5ojW ``` see: #154 (comment) License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
w3 delegation create --stringify
and `w3 space add <stringifi…w3 delegation create --stringify
and w3 space add <stringified proof>
$ w3 delegation create did:key:z6MkviAsUfBwegmB57byQ7SZTFtX4jNjo315EvgurjWYoTRX --can 'store/add' --can 'upload/add' --stringify
🚀🪐🎂🌌🚀🥀🌏☀🧡✋🥺😓😓😈🌈😕😝💦✋🥺🌈🌟😓😻🪐🌱🌑🪐✅💻😅👌💟🙌🤫🌑😛✌🥳😂✈💡😈😷🌓😞💞😛🤬🤧🤮💓👐🤙📣🙇👑🍒🙇☝💋👆☺✊🤤🌈💥💛🥀🌿🛰😋🙆😱😔✋😨😆🌴😶✅🤯😇🌑💙🙂😋🥴👆💿🤷😢😣🌓😘🕺😳😎🕺💗⬇💰🤓🤔⚡🌎❄💻➡🌼🌈🌿🤐💞🎤🤩💛🚨😷💆👶😠👏✅🙄🌌😏😒✔💎🌔🤭😂💚😠🛰🤤💦✋🤗☺✌☺💜💃🤤😈😈💝🧡💃💃🤤😻😝🌈⭐🤤💃✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😝🌈😈😓🥺✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😴🤘⭐🍀😓🤤😳👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😴🤤💃💃✋🌈🌈👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😬😚🌟🍀✋💃😓🌟😻👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😝🤘🌈🤤😝✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑💃🤤🤘😳💥😁🥀🪐🌴😓🥀💘🥰😎💾🌒😵🚶🔵🤢🎀🐸📸💦🤗🤓👌💗🙂🥴👅💻👊😂🙅😫😭🤩🙏🍎💃✋😣⭐😊😝🎉😉😊💃😚💃😈🌺🌿✋🌈⭐🤤💃✋🌿😳😻🤤🌷✋✋😈😓😓😈🌈💃🌟🌈🌈💥😁🥀🪐👌🔵📣❌🖕😔😵👇🌈😄💘😢🏆💎🐾😌💐⭐😜🤲💔👑📌😴📌🥀🎊🍺💝💅☕🚩💃⭐🥺😚😕🌱🌑🪐✅💻😅👌💟🙌🤫🌑😛✌🥳😂✈💡😈😷🌓😞💞😛🤬🤧🤮💓👐🤙📣🙇👑🍒🙇☝💋👆☺✊🤤🌈💥💛🥀🌿🛰😋🙆😱😔✋😨😆🌴😶✅🤯😇🌑💙🙂😋🥴👆💿🤷😢😣🌓😘🕺😳😎🕺💗⬇💰🤓🤔⚡🌎❄💻➡🌼🌈🌿🤐💞🎤🤩💛🚨😷💆👶😠👏✅🙄🌌😏😒✔💎🌔🤭😂💚😠🛰🤤💦✋🤗☺✌☺💜💃🤤😈😈💝🧡💃💃🤤😻😝🌈⭐🤤💃✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😝🌈😈😓🥺✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😴🤘⭐🍀😓🤤😳👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😴🤤💃💃✋🌈🌈👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😬😚🌟🍀✋💃😓🌟😻👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😝🤘🌈🤤😝✋👌😆😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑💃🤤🤘😳💥😁🥀🪐🌴😓🥀💘🥰😎💾🌒😵🚶🔵🤢🎀🐸📸💦🤗🤓👌💗🙂🥴👅💻👊😂🙅😫😭🤩🙏🍎💃✋😣⭐😊😝🎉😉😊💃😚💃😈🌺🌿✋🌈⭐🤤💃✋🌿😳😻🤤🌷✋✋😈😓😓😈🌈💃🌟🌈🌈💥😁🥀🪐👌🔵📣❌🖕😔😵👇🌈😄💘😢🏆💎🐾😌💐⭐😜🤲💔👑📌😴📌🥀🎊🍺💝💅☕🚩💃⭐🥺😚😕🤑🛰🪐✅💻😅💘😹💐😏💅🤑🤪😢💛☄💟😂🎊👑🔴😏🥀😬🍓🔵🎈😟💨👑🌍🌔😲🌖😥☄🧐😔✊🤤🌈💥💛🥀🌿🛰😋🐶📌💡😛😮💧🌗👶🏃🌱😈💰📌👼🎼🌓💝👼🍒💦🎵😨🌌🤭✅📍📸🌖😖💀🙃💋👎💝🧡😫➡😮😆🍎👌🌏😰😐❄🤟💋💩😮😍👎🔴😎💞💿😙⭐➡⬇✅👊👶😜🌗🤤💦✋🤗☺✌☺💜💃🤤😈😈🎂🧡💃💃🤤😻🌟🌈😈😓🥺✋👌🤤😳😳😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑🧡💃💃🤤😻😬🤘⭐🍀😓🤤😳👌🤤😳😳😳✔🌟😈😴😣💞😳🌟😳✨🙃✋🏃✨💐🤦🙈🙃😴😚💐💋✔😞🖤😔💞🤤❣😓👉😏⭐🎉🤦🤘💥❣✅💐🌈😬😄🤦🤩👇🤘💜💞😑💓✔🙈🤘🌷🙃💗💓🌹😓😬😑💃🤤🤘😳💥😁🥀🪐💩👑😗☺😵🌍🌍🤢🌴😚🐷🤨☕🙆😂🐸🔥👏💩☹😢🤪🌼👅🔴🌈🐸💨🍊💥🙂💦💃✋😣⭐🤮💃😚💃😈🌺🌿✋🌈⭐🤤💃✋🌿😳😻🤤🌷✋✋😈😓😓😈🌈💃🌟🌈🌈💥😁🥀🪐🌴😓🥀💘🥰😎💾🌒😵🚶🔵🤢🎀🐸📸💦🤗🤓👌💗🙂🥴👅💻👊😂🙅😫😭🤩🙏🍎💃⭐🥺😚🎂🐾😆💥💔🚀🪐✅💻😅👌💟🙌🤫🌑😛✌🥳😂✈💡😈😷🌓😞💞😛🤬🤧🤮💓👐🤙📣🙇👑🍒🙇☝💋👆☺🐾😆💥💔🚀🪐✅💻😅👌💟🙌🤫🌑😛✌🥳😂✈💡😈😷🌓😞💞😛🤬🤧🤮💓👐🤙📣🙇👑🍒🙇☝💋👆☺⏎ |
Just base64 mutlibase encoding was considered, but the identity cid wrapping lets use specify that it's a CAR via the cid codec for self describing goodness... ...and as it gets length prefixed we can detect truncation, which for long text screeds seems like a win. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I'm not 100% sold on "stringify" as the option that causes it to encode it to string...but failing to think of something better --string
? --output-encoding=base64
? 🤷♂️
w3 delegation create --stringify
and w3 space add <stringified proof>
w3 delegation create --base64
and w3 space add <base64 proof>
w3 delegation create --base64
and w3 space add <base64 proof>
w3 delegation create --base64
& w3 space add <base64>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
🤖 I have created a release *beep* *boop* --- ## [7.2.0](v7.1.0...v7.2.0) (2024-01-17) ### Features * `w3 delegation create --base64` & `w3 space add <base64>` ([#158](#158)) ([98284ef](98284ef)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Rewrite of the add-to-web3 github action to work with the new w3up web3.storage api. [`w3cli`](https://github.com/web3-storage/w3cli) does everything we need to upload files to web3.storage, so this action now provides a very thin wrapper around that cli in the form of a composite action. ## Breaking changes Auth is based on [UCAN](https://web3.storage/docs/concepts/ucans-and-web3storage/)s now. Use w3cli to create a signing key for this action to use, and create a ucan that delegates upload abilities to that key. - input: `web3_token` has been removed, as token based auth as been removed. - set `secret_key` to a base64 encoded siging key you create via `w3 key create`. - set `proof` to the a base64 CAR encoded UCAN delegating capabilities to the secret_key's DID. - input: `wrap_with_directory` has been removed. w3cli does not wrap directories in directories by default now. Only single files get wrapped to preserve their filename. - set `wrap: false` to disable the wrapping of single files. - input: `web3_api` has been removed. Targeting other services is not currently supported. Open an issue if you need that. - input: `include_hidden` has been renamed to `hidden` to match the w3cli flag name Fixes #87 Needs storacha/w3cli#158 License: MIT --------- Signed-off-by: Oli Evans <oli@protocol.ai> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
export a delegation as base64 encoded identity CID with
w3 delegation create --base64
...yes, what if we put the CAR in the CID! That way we can detect when the input has been truncted, and the screed is self describing... you can paste it into cid.ipfs.tech and it'll tell you it's CAR flavour identity hashed bytes!
import a space from a stringified proof
$ w3 space add $PROOF did:key:z6MkhfzTwZJ28aRobCp76uXRqzsjH6GNu18WFwMumkAF5ojW
see: #154 (comment)
Usage
on your machine
@web3-storage/w3cli
installed.in CI
@web3-storage/w3cli
. No need to login, we pass it the proof to use.(jq -r .key ci.json)
as a secret in your ci workflow. KEEP IT SECRET!License: MIT