-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: Issue #9364 JSON config validation #10679
Merged
guillaumemichel
merged 32 commits into
ipfs:master
from
gsergey418alt:fix/9364-validation
Feb 4, 2025
Merged
Changes from 16 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c5649c2
Fix JSON config validation
gsergey418alt b69676b
Add changelog entry.
gsergey418alt 42692c6
Fix test
gsergey418alt f589555
Fix more tests, 53 still failing
gsergey418alt c35ee66
Remove JSON test due to fragilty, fix some more tests, Lib tests left.
gsergey418alt dd9627e
Remove lib tests as they don't seem to be relevant anymore.
gsergey418alt f7b44d0
Move changelog into v0.34
gsergey418alt 11f7f06
Fix config validation.
gsergey418alt ef3ff89
Delete test file
gsergey418alt 7b88c81
Use reflection to ignore encoding/json tags.
gsergey418alt 2765ec0
Add exceptions for fields that were already maps in the config, fix o…
gsergey418alt 354256a
Fix last (hopefully) test
gsergey418alt 12a0185
test: fix the socat tests after the ubuntu 24.04 upgrade
galargh c546382
Merge branch 'socat-ubuntu-noble' of https://github.com/ipfs/kubo int…
gsergey418alt a091fbe
Merge branch 'master' into fix/9364-validation
guillaumemichel ab2657e
Merge branch 'master' into fix/9364-validation
guillaumemichel af0c5c6
docker sharness
guillaumemichel 7a3732f
updated ReflectToMap
guillaumemichel 9086971
Fix nested maps and write a test for it.
gsergey418alt 564d9dd
Add tests for other data types
gsergey418alt c34c068
Revert "Fix nested maps and write a test for it."
gsergey418alt 44fbd88
Validate structs nested in maps.
gsergey418alt 8a669cd
Add comments.
gsergey418alt 0a25331
Remove debug
gsergey418alt eae4382
Add test for PublicGateways
gsergey418alt 7e8d3ca
Add test for sturct in map
gsergey418alt db3cd49
Merge branch 'master' into fix/9364-validation
guillaumemichel bed120f
comment typo
guillaumemichel 69235e2
slight refactor
guillaumemichel 8e72a65
Add CheckKey tests.
gsergey418alt 87e42d8
Add handling for interface{} in the config
gsergey418alt 7d7633e
"any" -> nil
gsergey418alt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
# Kubo changelog v0.34 | ||
|
||
- [v0.34.0](#v0310) | ||
- [v0.34.0](#v0340) | ||
|
||
## v0.34.0 | ||
|
||
- [Overview](#overview) | ||
- [🔦 Highlights](#-highlights) | ||
- [JSON config validation](#json-config-validation) | ||
- [📝 Changelog](#-changelog) | ||
- [👨👩👧👦 Contributors](#-contributors) | ||
|
||
### Overview | ||
|
||
### 🔦 Highlights | ||
|
||
#### JSON config validation | ||
|
||
`ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)). | ||
|
||
### 📝 Changelog | ||
|
||
### 👨👩👧👦 Contributors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what is the reason to define a new function, and not use
ToMap
defined above?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.
There's no way to get
encoding/json
package (which is used in the ToMap function) to ignore the struct tags likejson:",omitempty"
that hide the map fields. That means that the user wouldn't be able to set these fields, since this map is used to validate user's input fromipfs config
. Had to use thereflect
package to make that happen.