`name put` rejected republishing the exact same record because the
sequence check used `>=` which blocked the common use case of fetching
a third-party record and putting it back to refresh DHT availability.
allow putting identical records (same bytes) while still rejecting
different records with the same or lower sequence number. also add
a success message on put (suppressible with `--quiet`), and clarify
the error message to say "IPNS record" and reference `ipfs name put --force`.
Closes#11197
* feat: update to Go 1.26
replace deprecated httputil.NewSingleHostReverseProxy (Director)
with ReverseProxy.Rewrite, switch math/rand to math/rand/v2 in
production code, update Dockerfile base image.
* fix test to accept response with HTTP status of 307 and 308 where 302 and 301 are expected
---------
Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
* fix http header when compress enabled for get command
Closes#2376
* fix(rpc): set Content-Type for ipfs get based on output format
- set application/x-tar when outputting tar (default and --archive)
- set application/gzip when compression is enabled (--compress)
- update go-ipfs-cmds with Tar encoding type and RFC 6713 compliant
MIME types (application/gzip instead of application/x-gzip)
* test(rpc): add Content-Type header tests for ipfs get
* feat(rpc): add Content-Type headers for binary responses
set proper Content-Type headers for RPC endpoints that return binary data:
- `dag export`: application/vnd.ipld.car
- `block get`: application/vnd.ipld.raw
- `diag profile`: application/zip
- `get`: application/x-tar or application/gzip (already worked, migrated to new API)
uses the new OctetStream encoding type and SetContentType() method
from go-ipfs-cmds to specify custom MIME types for binary responses.
refs: https://github.com/ipfs/kubo/issues/2376
* feat(rpc): add `ipfs name get` command for IPNS record retrieval
add dedicated command to retrieve raw signed IPNS records from the
routing system. returns protobuf-encoded IPNS record with Content-Type
`application/vnd.ipfs.ipns-record`.
this provides a more convenient alternative to `ipfs routing get /ipns/<name>`
which returns JSON with base64-encoded data. the raw output can be piped
directly to `ipfs name inspect`:
ipfs name get <name> | ipfs name inspect
spec: https://specs.ipfs.tech/ipns/ipns-record/
* feat(rpc): add `ipfs name put` command for IPNS record storage
adds `ipfs name put` to complement `ipfs name get`, allowing users to
store IPNS records obtained from external sources without needing the
private key. useful for backup, restore, and debugging workflows.
the command validates records by default (signature, sequence number).
use `--force` to bypass validation for testing how routing handles
malformed or outdated records.
also reorganizes test/cli files:
- rename http_rpc_* -> rpc_* to match existing convention
- merge name_get_put_test.go into name_test.go
- add file header comments documenting test purposes
* chore(deps): update go-ipfs-cmds to latest master
includes SetContentType() for dynamic Content-Type headers
---------
Co-authored-by: Marcin Rataj <lidel@lidel.org>
* Updates go-ipfs-cmds to try to get the tests to pass on travis.
* While we're at it, fix duplicate gx deps.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
excerpt of commit messages:
- update postrun functions in core/commands
- sharness: allow setting -i with TEST_IMMEDIATE=1
- cmds Run func returns error now
- gx update cmdkit to 1.1.2 and cmds to 2.0.0-beta1
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>