Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<img width="680" alt="Screenshot 2023-11-25 at 22 09 32" src="https://github.com/web3-storage/w3cli/assets/58871/133cab28-f994-4391-8ad9-8bb44f54bd57"> - `w3 proof ls` now shows lots more info with ucan flavour properties so it matches what you'd see in the spec or at https://ucan.xyz/validator/ - and with a relative date help for `exp` e.g `# expires in one year`. - and in valid yaml you can pate into a dingus (tho... what isn't valid yaml). - and in colour! (optional) - `--no-color` works automagically with chalk, so no additional plumbing is needed to disable it - audience is removed as it is always the did of the current agent, so is redundent. - `w3 proof ls --json` now returns **all** the info about the proofs. I need this for debugging, and it's neat to be able to dig into them with `jq` - this is a breaking change as it changes the json output format to use the default ucan/ipld flavour property names rather than custom ones. - e.g. `att` instead of `capabilities`. `/` for the root cid, rather than `cid` **w3 proof ls --json** ```shell # all issuers $ w3 proof ls --json | jq '.iss' "did:mailto:protocol.ai:oli" "did:web:web3.storage" "did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp" "did:key:z6MkhfzTwZJ28aRobCp76uXRqzsjH6GNu18WFwMumkAF5ojW" "did:key:z6Mku56ywWspVnzkcVQbeSkw6egVRSNKVSYgS38HhKcUJRiN" "did:key:z6Mktg5HxV1fifagzK8tnXXgCDsw1o4ekQHQpp9DKbLkh9hU" "did:web:web3.storage" # all space names $ ❯ w3 proof ls --json | jq '.fct[].space.name | select(.)' "clean" "toots" "fruits" "veg" # all ucan cids $ w3 proof ls --json | jq '.["/"]' "bafyreiaxpxm7oqdesq3nbjzcku3qqsb5onx25ab2tp23fl3edmjwllemgm" "bafyreifwqxlcwwwb4xll3deyq6zlvui26k5bq2oq4rcaam4pmg5rfmtqnu" "bafyreid2kvymk6nearlhg262zigjxitcl77ncsavcin2twdmhqmrlhxwui" "bafyreibpxq7zqbmphfprnn7qotfaowryr63nh5sg6kk75zmm3hsx6vhdfy" "bafyreietbar6chzhwp6bbxor6qydxkyhela7xpo2zmdmjbycoabgzxuexi" "bafyreigu6g2psglmekpfo73zapgebs5sbydcctibgq6obwilbvepap3l3a" "bafyreifwqxlcwwwb4xll3deyq6zlvui26k5bq2oq4rcaam4pmg5rfmtqnu" ``` **w3 proof ls** ```yaml # bafyreiaxpxm7oqdesq3nbjzcku3qqsb5onx25ab2tp23fl3edmjwllemgm iss: did:mailto:protocol.ai:oli att: - can: * with: ucan:* fct: - {"access/confirm":{"/":"bafyreidaljxvbccdts7dwoogds57a37y5fxy4b6wiq5h7oaz5npihtsgcq"},"access/request":{"/":"bafyreiabnffvury7onrouhhbsj6pi3de7oejxazkuoxbrjkl4vxuvdxjmm"}} # bafyreifwqxlcwwwb4xll3deyq6zlvui26k5bq2oq4rcaam4pmg5rfmtqnu iss: did:web:web3.storage att: - can: ucan/attest with: did:web:web3.storage nb: {"proof":{"/":"bafyreiaxpxm7oqdesq3nbjzcku3qqsb5onx25ab2tp23fl3edmjwllemgm"}} fct: - {"access/confirm":{"/":"bafyreidaljxvbccdts7dwoogds57a37y5fxy4b6wiq5h7oaz5npihtsgcq"},"access/request":{"/":"bafyreiabnffvury7onrouhhbsj6pi3de7oejxazkuoxbrjkl4vxuvdxjmm"}} # bafyreid2kvymk6nearlhg262zigjxitcl77ncsavcin2twdmhqmrlhxwui iss: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp exp: 1731519367 # expires in a year att: - can: space/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp - can: store/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp - can: upload/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp - can: access/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp - can: filecoin/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp - can: usage/* with: did:key:z6MknD58DihJ7j3XdPZLuJPVPt8LC8BtdTULatbWmoqr8Awp fct: - {"space":{"name":"clean"}} ``` License: MIT --------- Signed-off-by: Oli Evans <[email protected]>
- Loading branch information