summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-21Merge pull request #495 from Shopify/safe-dumpHEADmasterAaron Patterson
Implement YAML.safe_dump to make safe_load more usable.
2021-05-21Merge pull request #493 from mame/load_file-should-use-load-instead-of-safe_loadAaron Patterson
Make YAML.load_file use YAML.load instead of safe_load
2021-05-19Implement YAML.safe_dump to make safe_load more usable.Jean Boussier
In case where Psych is used as a two way serializers, e.g. to serialize some cache or config, it is preferable to have the same restrictions on both load and dump. Otherwise you might dump and persist some objects payloads that you later won't be able to read.
2021-05-17Make YAML.load_file use YAML.load instead of safe_loadYusuke Endoh
YAML.load and YAML.safe_load are different a little; the former allows Symbol by default but the latter doesn't. So YAML.load_file and YAML.safe_load_file should reflect the difference. Fixes #490
2021-05-17Merge pull request #491 from mame/work-with-older-libyamlHiroshi SHIBATA
Some tests fail with libyaml 0.1.7
2021-05-17Make the test pass with the old libyamlYusuke Endoh
I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway.
2021-05-17assert_equal accepts an expected value as the first argumentYusuke Endoh
2021-05-13Merge pull request #487 from ruby/default-unsafeAaron Patterson
Use Psych.safe_load by default
2021-05-13remove deprecated interfaceAaron Patterson
2021-05-13Bump versionAaron Patterson
2021-05-13Use Psych.safe_load by defaultAaron Patterson
Psych.load is not safe for use with untrusted data. Too many applications make the mistake of using `Psych.load` with untrusted data and that ends up with some kind of security vulnerability. This commit changes the default `Psych.load` to use `safe_load`. Users that want to parse trusted data can use Psych.unsafe_load.
2021-05-13Merge pull request #488 from ruby/add-unsafeAaron Patterson
Introduce `Psych.unsafe_load`
2021-05-13Introduce `Psych.unsafe_load`Aaron Patterson
In future versions of Psych, the `load` method will be mostly the same as the `safe_load` method. In other words, the `load` method won't allow arbitrary object deserialization (which can be used to escalate to an RCE). People that need to load *trusted* documents can use the `unsafe_load` method. This commit introduces the `unsafe_load` method so that people can incrementally upgrade. For example, if they try to upgrade to 4.0.0 and something breaks, they can downgrade, audit callsites, change to `safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0 smoothly.
2021-05-10Merge pull request #475 from whitehat101/feature/dynamic-scalar-seq-styleAaron Patterson
feat: allow scalars and sequences to be styled when dumped
2021-05-10Merge pull request #480 from Shopify/symbolize-name-non-string-keysHiroshi SHIBATA
Fix symbolize_name with non-string keys
2021-05-10Text files should end with a newlineNobuyoshi Nakada
2021-05-10Fix -Wundef warnings for patterns `#if HAVE`Benoit Daloze
* See [Feature #17752] * Using this to detect them: git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
2021-05-10Use assert_raise instead of assert_raisesHiroshi SHIBATA
2021-05-10Merge pull request #486 from ruby/avoid-yaml-float-conversionHiroshi SHIBATA
CI - YAML: Avoid 3.0 -> "3" conversion
2021-05-10CI - YAML: Avoid 3.0 -> "3" conversionOlle Jonsson
2021-05-10Merge pull request #485 from ruby/test-unitHiroshi SHIBATA
Use test-unit instead of minitest
2021-05-10Removed needless platform detectionHiroshi SHIBATA
2021-05-10Import test assertions from ruby/rubyHiroshi SHIBATA
2021-05-10Added 3.0 to GitHub ACtionsHiroshi SHIBATA
2021-05-10Use pend instead of skipHiroshi SHIBATA
2021-05-10Fixed test-case for NaNHiroshi SHIBATA
2021-05-10Use Ractor constant for ignoreing conditionHiroshi SHIBATA
2021-05-10Use test-unit instead of minitestHiroshi SHIBATA
2021-04-26Merge pull request #484 from kamipo/fix_typosHiroshi SHIBATA
Fix some typos [ci skip]
2021-04-26Fix some typos [ci skip]Ryuta Kamizono
2021-02-25Fix symabolize_name with non-string keysJean Boussier
2021-02-24bump versionAaron Patterson
2021-02-24Merge pull request #476 from Shopify/symbolize-name-ruby-objectAaron Patterson
Fix custom marshalization with symbolize_names: true
2021-02-23Update to latest SnakeYAMLCharles Oliver Nutter
Fixes jruby/jruby#6365
2021-02-15Fix custom marshalization with symbolize_names: trueJean Boussier
2021-02-07feat: allow scalars and sequences to be styled when dumpedJeremy Ebler
2021-02-06Merge pull request #470 from timgates42/bugfix_typo_expressedHiroshi SHIBATA
docs: fix simple typo, expessed -> expressed
2021-01-30Merge pull request #474 from Shopify/cache-load-types-in-to-rubyMarc-André Lafortune
Avoid repeated access to Ractor.current
2021-01-30Cache dispatch cache in an instance variableJean Boussier
2021-01-30Cache access to Psych.load_tags in Visitor::ToRubyJean Boussier
2020-12-23Bump version to 3.3.0Hiroshi SHIBATA
2020-12-23Merge pull request #471 from ruby/ractorHiroshi SHIBATA
Ractor support
2020-12-23Skip test_ractor.rb with ruby/psych repoHiroshi SHIBATA
Because ruby/psych still uses minitest. minitest didn't support assert_ractor provided by test suite of ruby/ruby repo.
2020-12-23[ruby/psych] Optimize cache with `compare_by_identity`Marc-Andre Lafortune
Using `compare_by_identity` gives a 4x performance boost on cache hits. Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
2020-12-23[ruby/psych] Make Ractor-ready.Marc-Andre Lafortune
Config is Ractor-local. Benchmarking reveals that using `Ractor.local_storage` for storing cache is similar to accessing a constant (~15% slower).
2020-12-23[ruby/psych] Don't use instance variables directly for configMarc-Andre Lafortune
2020-12-23[ruby/psych] Avoid methods depending on bindingsMarc-Andre Lafortune
Improves Ractor-readiness.
2020-12-23[ruby/psych] Freeze constants.Marc-Andre Lafortune
Improves Ractor-readiness.
2020-12-21Strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-12-18docs: fix simple typo, expessed -> expressedTim Gates
There is a small typo in ext/psych/yaml/yaml.h. Should read `expressed` rather than `expessed`.