Skip to content
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

Merge Release v0.10.0 #8475

Merged
merged 36 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2d39130
Release v0.10.0-rc1
aschmahmann Aug 20, 2021
0884f2d
fix(mkreleaselog): specify the parent commit when diffing
Stebalien Aug 23, 2021
63dd43b
ci: preload peerlog plugin, disable by default
guseggert Aug 24, 2021
8f62313
test: add unit tests for peerlog config parsing
guseggert Aug 24, 2021
810a174
chore: add comments to peerlog plugin about being unsupported
guseggert Aug 25, 2021
630e5e5
ci: publish Docker images for bifrost-* branches
guseggert Aug 26, 2021
8516395
fix: fix bifrost typo in comment
guseggert Aug 26, 2021
60fdf22
perf: use performance-enhancing FUSE mount options
max-privatevoid Aug 26, 2021
f00f7d2
Cosmetic fixups in examples (#8325)
petar Aug 27, 2021
3906e6f
`go mod tidy` ipfs library example
jbouwman Aug 30, 2021
63213c3
add more buttons; remove some sections covered in the docs; general c…
RubenKelevra Jul 18, 2021
7f3600c
chore: update IPFS Desktop testing steps (#8393)
guseggert Sep 3, 2021
a49ff32
ci: use dynamic config for CircleCI
guseggert Sep 10, 2021
ce64237
ci: drop unit tests make jobs back to 1
guseggert Sep 10, 2021
bb49492
fix(sharness): add extra check in flush=false in files write
schomatis Sep 13, 2021
6288f0b
feature: 'ipfs swarm peering' command (#8147)
TakashiMatsuda Sep 15, 2021
e3dfc93
fix: take the lock while listing peers
Stebalien Sep 15, 2021
ef5dd4a
feat: multibase transcode command (#8403)
andey-robins Sep 21, 2021
94bd298
feat(cli): add daemon option --agent-version-suffix (#8419)
schomatis Sep 21, 2021
f7fd3e5
feat: ipfs-webui v2.13.0 (#8430)
lidel Sep 21, 2021
b3c3b2b
feat: dag import --stats (#8237)
rvagg Sep 23, 2021
c1419b5
make json, cbor, and git codecs error on empty input
mvdan Sep 8, 2021
534bd84
chore: update go-libp2p to v0.15.0
marten-seemann Sep 9, 2021
2e8b0bf
change names of ipfs dag put flags to make changes clearer
aschmahmann Sep 15, 2021
9685afc
remove dag put option shortcuts
aschmahmann Sep 27, 2021
9fe1ea6
test: check behavior of loading UnixFS sharded directories with missi…
aschmahmann Sep 23, 2021
0b85d4f
chore: update go-path
aschmahmann Sep 15, 2021
cc58307
change ipfs dag get flag name from format to output-codec
aschmahmann Sep 15, 2021
0de095b
test: add dag get --ouput-codec test
aschmahmann Sep 27, 2021
dba3047
enable the legacy mDNS implementation
marten-seemann Sep 18, 2021
680c80a
fuse: load unixfs adls as their dagpb substrates
aschmahmann Sep 27, 2021
2f94dd0
Release v0.10.0-rc2
aschmahmann Sep 27, 2021
4822023
ci: move Docker image build to Actions (#8467)
lidel Sep 28, 2021
163975b
chore: update changelog for v0.10.0
aschmahmann Sep 30, 2021
72982d4
Release v0.10.0
aschmahmann Sep 30, 2021
64b532f
Merge pull request #8474 from ipfs/release-v0.10.0
aschmahmann Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: multibase transcode command (#8403)
* Add a transcoder command to multibase

In order to more easily facilitate the conversion
between multibase formats, include a transcode command
to avoid `multibase decode | multibase encode`

* Example code needed go mod tidy

Co-authored-by: gammazero <gammazero@users.noreply.github.com>
(cherry picked from commit c891109)
  • Loading branch information
andey-robins authored and aschmahmann committed Sep 27, 2021
commit ef5dd4a186a8d54193ab1fbb8ed4274ac623082b
1 change: 1 addition & 0 deletions core/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func TestCommands(t *testing.T) {
"/multibase",
"/multibase/decode",
"/multibase/encode",
"/multibase/transcode",
"/multibase/list",
"/name",
"/name/publish",
Expand Down
59 changes: 56 additions & 3 deletions core/commands/multibase.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ var MbaseCmd = &cmds.Command{
Tagline: "Encode and decode files or stdin with multibase format",
},
Subcommands: map[string]*cmds.Command{
"encode": mbaseEncodeCmd,
"decode": mbaseDecodeCmd,
"list": basesCmd,
"encode": mbaseEncodeCmd,
"decode": mbaseDecodeCmd,
"transcode": mbaseTranscodeCmd,
"list": basesCmd,
},
Extra: CreateCmdExtras(SetDoesNotUseRepo(true)),
}
Expand Down Expand Up @@ -116,3 +117,55 @@ This command expects multibase inside of a file or via stdin:
return resp.Emit(reader)
},
}

var mbaseTranscodeCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Transcode multibase string between bases",
LongDescription: `
This command expects multibase inside of a file or via stdin.

By default it will use URL-safe base64url encoding,
but one can customize used base with -b:

> echo -n hello | ipfs multibase encode > file
> cat file
uaGVsbG8

> ipfs multibase transcode file -b base16 > transcoded_file
> cat transcoded_file
f68656c6c6f
`,
},
Arguments: []cmds.Argument{
cmds.FileArg("encoded_file", true, false, "encoded data to decode").EnableStdin(),
},
Options: []cmds.Option{
cmds.StringOption(mbaseOptionName, "multibase encoding").WithDefault("base64url"),
},
Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error {
if err := req.ParseBodyArgs(); err != nil {
return err
}
encoderName, _ := req.Options[mbaseOptionName].(string)
encoder, err := mbase.EncoderByName(encoderName)
if err != nil {
return err
}
files := req.Files.Entries()
file, err := cmdenv.GetFileArg(files)
if err != nil {
return fmt.Errorf("failed to access file: %w", err)
}
encoded_data, err := ioutil.ReadAll(file)
if err != nil {
return fmt.Errorf("failed to read file contents: %w", err)
}
_, data, err := mbase.Decode(string(encoded_data))
if err != nil {
return fmt.Errorf("failed to decode multibase: %w", err)
}
encoded := encoder.Encode(data)
reader := strings.NewReader(encoded)
return resp.Emit(reader)
},
}
13 changes: 13 additions & 0 deletions test/sharness/t0295-multibase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ test_expect_success "multibase encode+decode roundtrip" '
test_cmp actual expected
'

test_expect_success "mutlibase transcode works (stdin)" '
echo -n f68656c6c6f > expected &&
echo -n uaGVsbG8 | ipfs multibase transcode -b base16 > actual &&
test_cmp actual expected
'

test_expect_success "multibase transcode works (file)" '
echo -n uaGVsbG8 > file &&
echo -n f68656c6c6f > expected &&
ipfs multibase transcode ./file -b base16> actual &&
test_cmp actual expected
'

test_expect_success "multibase error on unknown multibase prefix" '
echo "Error: failed to decode multibase: selected encoding not supported" > expected &&
echo -n ę-that-should-do-the-trick | ipfs multibase decode 2> actual ;
Expand Down