X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a0398ebd1c50b1be2433c109af6bb0d263c54ea5..01ca27ba0a1ef84c53e223004249505435a788b6:/services/api/lib/config_loader.rb diff --git a/services/api/lib/config_loader.rb b/services/api/lib/config_loader.rb index f421fb5b2a..1d897b39bf 100644 --- a/services/api/lib/config_loader.rb +++ b/services/api/lib/config_loader.rb @@ -2,6 +2,16 @@ # # SPDX-License-Identifier: AGPL-3.0 +# When loading YAML, deserialize :foo as ":foo", rather than raising +# "Psych::DisallowedClass: Tried to load unspecified class: Symbol" +class Psych::ScalarScanner + alias :orig_tokenize :tokenize + def tokenize string + return string if string =~ /^:[a-zA-Z]/ + orig_tokenize(string) + end +end + module Psych module Visitors class YAMLTree < Psych::Visitors::Visitor @@ -226,7 +236,7 @@ class ConfigLoader if erb yaml = ERB.new(yaml).result(binding) end - YAML.load(yaml, deserialize_symbols: false) + YAML.safe_load(yaml) else {} end