├── settings.gradle.kts ├── src ├── test │ ├── JSONTestSuite │ │ ├── masked │ │ │ ├── n_number_0e.json │ │ │ ├── n_number_Inf.json │ │ │ ├── n_number_NaN.json │ │ │ ├── n_single_space.json │ │ │ ├── y_array_empty.json │ │ │ ├── y_array_null.json │ │ │ ├── y_number.json │ │ │ ├── y_object_empty.json │ │ │ ├── y_string_pi.json │ │ │ ├── n_array_just_comma.json │ │ │ ├── n_array_star_inside.json │ │ │ ├── n_array_unclosed.json │ │ │ ├── n_incomplete_null.json │ │ │ ├── n_incomplete_true.json │ │ │ ├── n_number_++.json │ │ │ ├── n_number_+1.json │ │ │ ├── n_number_+Inf.json │ │ │ ├── n_number_-01.json │ │ │ ├── n_number_-1.0..json │ │ │ ├── n_number_-2..json │ │ │ ├── n_number_-NaN.json │ │ │ ├── n_number_.-1.json │ │ │ ├── n_number_.2e-3.json │ │ │ ├── n_number_0.1.2.json │ │ │ ├── n_number_0.3e+.json │ │ │ ├── n_number_0.3e.json │ │ │ ├── n_number_0.e1.json │ │ │ ├── n_number_0e+.json │ │ │ ├── n_number_1.0e+.json │ │ │ ├── n_number_1.0e-.json │ │ │ ├── n_number_1.0e.json │ │ │ ├── n_number_1eE2.json │ │ │ ├── n_number_2.e+3.json │ │ │ ├── n_number_2.e-3.json │ │ │ ├── n_number_2.e3.json │ │ │ ├── n_number_9.e+.json │ │ │ ├── n_object_emoji.json │ │ │ ├── n_object_no-colon.json │ │ │ ├── n_structure_end_array.json │ │ │ ├── n_structure_no_data.json │ │ │ ├── y_array_false.json │ │ │ ├── y_number_0e+1.json │ │ │ ├── y_number_0e1.json │ │ │ ├── y_object_simple.json │ │ │ ├── y_string_space.json │ │ │ ├── y_string_uEscape.json │ │ │ ├── y_string_unicode.json │ │ │ ├── y_string_utf8.json │ │ │ ├── i_number_huge_exp.json │ │ │ ├── i_string_iso_latin_1.json │ │ │ ├── n_array_extra_close.json │ │ │ ├── n_array_extra_comma.json │ │ │ ├── n_array_incomplete.json │ │ │ ├── n_array_just_minus.json │ │ │ ├── n_incomplete_false.json │ │ │ ├── n_number_0_capital_E+.json │ │ │ ├── n_number_0_capital_E.json │ │ │ ├── n_number_1_000.json │ │ │ ├── n_number_expression.json │ │ │ ├── n_number_invalid+-.json │ │ │ ├── n_object_missing_value.json │ │ │ ├── n_object_non_string_key.json │ │ │ ├── n_object_single_quote.json │ │ │ ├── n_string_backslash_00.json │ │ │ ├── n_string_escape_x.json │ │ │ ├── n_structure_UTF8_BOM_no_data.json │ │ │ ├── n_structure_double_array.json │ │ │ ├── n_structure_open_object.json │ │ │ ├── n_structure_single_star.json │ │ │ ├── y_array_empty-string.json │ │ │ ├── y_number_after_space.json │ │ │ ├── y_number_int_with_exp.json │ │ │ ├── y_number_minus_zero.json │ │ │ ├── y_number_negative_int.json │ │ │ ├── y_number_negative_one.json │ │ │ ├── y_number_real_neg_exp.json │ │ │ ├── y_number_simple_int.json │ │ │ ├── y_number_simple_real.json │ │ │ ├── y_object_basic.json │ │ │ ├── y_object_empty_key.json │ │ │ ├── y_string_comments.json │ │ │ ├── y_string_in_array.json │ │ │ ├── y_string_null_escape.json │ │ │ ├── y_string_simple_ascii.json │ │ │ ├── y_string_unicode_2.json │ │ │ ├── y_structure_lonely_int.json │ │ │ ├── y_structure_lonely_null.json │ │ │ ├── y_structure_lonely_true.json │ │ │ ├── i_number_neg_int_huge_exp.json │ │ │ ├── i_number_real_neg_overflow.json │ │ │ ├── i_number_real_pos_overflow.json │ │ │ ├── i_number_real_underflow.json │ │ │ ├── i_number_too_big_neg_int.json │ │ │ ├── i_number_too_big_pos_int.json │ │ │ ├── i_string_invalid_surrogate.json │ │ │ ├── i_string_invalid_utf-8.json │ │ │ ├── i_string_truncated-utf-8.json │ │ │ ├── i_string_utf16BE_no_BOM.json │ │ │ ├── i_string_utf16LE_no_BOM.json │ │ │ ├── n_array_comma_after_close.json │ │ │ ├── n_array_comma_and_number.json │ │ │ ├── n_array_missing_value.json │ │ │ ├── n_array_number_and_comma.json │ │ │ ├── n_multidigit_number_then_00.json │ │ │ ├── n_number_hex_1_digit.json │ │ │ ├── n_number_infinity.json │ │ │ ├── n_number_minus_space_1.json │ │ │ ├── n_number_with_alpha.json │ │ │ ├── n_number_with_leading_zero.json │ │ │ ├── n_object_bad_value.json │ │ │ ├── n_object_bracket_key.json │ │ │ ├── n_object_double_colon.json │ │ │ ├── n_object_missing_colon.json │ │ │ ├── n_object_missing_key.json │ │ │ ├── n_object_unquoted_key.json │ │ │ ├── n_string_escaped_emoji.json │ │ │ ├── n_string_incomplete_escape.json │ │ │ ├── n_string_single_doublequote.json │ │ │ ├── n_string_unescaped_newline.json │ │ │ ├── n_string_unescaped_tab.json │ │ │ ├── n_string_unicode_CapitalU.json │ │ │ ├── n_structure_U+2060_word_joined.json │ │ │ ├── n_structure_angle_bracket_..json │ │ │ ├── n_structure_lone-open-bracket.json │ │ │ ├── n_structure_open_array_comma.json │ │ │ ├── n_structure_open_object_comma.json │ │ │ ├── n_structure_unclosed_array.json │ │ │ ├── n_structure_unicode-identifier.json │ │ │ ├── y_array_arraysWithSpaces.json │ │ │ ├── y_number_negative_zero.json │ │ │ ├── y_number_real_capital_e.json │ │ │ ├── y_number_real_exponent.json │ │ │ ├── y_number_real_pos_exponent.json │ │ │ ├── y_string_allowed_escapes.json │ │ │ ├── y_string_double_escape_a.json │ │ │ ├── y_string_double_escape_n.json │ │ │ ├── y_string_nbsp_uescaped.json │ │ │ ├── y_string_one-byte-utf-8.json │ │ │ ├── y_string_three-byte-utf-8.json │ │ │ ├── y_string_two-byte-utf-8.json │ │ │ ├── y_string_u+2028_line_sep.json │ │ │ ├── y_string_u+2029_par_sep.json │ │ │ ├── y_string_uescaped_newline.json │ │ │ ├── y_structure_lonely_false.json │ │ │ ├── y_structure_lonely_string.json │ │ │ ├── y_structure_string_empty.json │ │ │ ├── y_structure_true_in_array.json │ │ │ ├── y_structure_whitespace_array.json │ │ │ ├── i_number_double_huge_neg_exp.json │ │ │ ├── i_number_pos_double_huge_exp.json │ │ │ ├── i_number_very_big_negative_int.json │ │ │ ├── i_string_UTF-8_invalid_sequence.json │ │ │ ├── i_string_UTF8_surrogate_U+D800.json │ │ │ ├── i_string_lone_second_surrogate.json │ │ │ ├── i_string_not_in_unicode_range.json │ │ │ ├── i_structure_UTF-8_BOM_empty_object.json │ │ │ ├── n_array_double_comma.json │ │ │ ├── n_array_double_extra_comma.json │ │ │ ├── n_array_incomplete_invalid_value.json │ │ │ ├── n_array_unclosed_trailing_comma.json │ │ │ ├── n_array_unclosed_with_object_inside.json │ │ │ ├── n_number_U+FF11_fullwidth_digit_one.json │ │ │ ├── n_number_hex_2_digits.json │ │ │ ├── n_number_real_garbage_after_e.json │ │ │ ├── n_number_starting_with_dot.json │ │ │ ├── n_number_with_alpha_char.json │ │ │ ├── n_object_garbage_at_end.json │ │ │ ├── n_object_missing_semicolon.json │ │ │ ├── n_object_trailing_comma.json │ │ │ ├── n_object_unterminated-value.json │ │ │ ├── n_string_1_surrogate_then_escape.json │ │ │ ├── n_string_accentuated_char_no_quotes.json │ │ │ ├── n_string_escaped_backslash_bad.json │ │ │ ├── n_string_escaped_ctrl_char_tab.json │ │ │ ├── n_string_incomplete_surrogate.json │ │ │ ├── n_string_invalid_backslash_esc.json │ │ │ ├── n_string_invalid_unicode_escape.json │ │ │ ├── n_string_no_quotes_with_bad_escape.json │ │ │ ├── n_string_single_quote.json │ │ │ ├── n_string_start_escape_unclosed.json │ │ │ ├── n_string_unescaped_ctrl_char.json │ │ │ ├── n_string_with_trailing_garbage.json │ │ │ ├── n_structure_angle_bracket_null.json │ │ │ ├── n_structure_ascii-unicode-identifier.json │ │ │ ├── n_structure_capitalized_True.json │ │ │ ├── n_structure_close_unopened_array.json │ │ │ ├── n_structure_open_array_apostrophe.json │ │ │ ├── n_structure_open_array_open_object.json │ │ │ ├── n_structure_open_array_string.json │ │ │ ├── n_structure_open_object_close_array.json │ │ │ ├── n_structure_open_object_open_array.json │ │ │ ├── n_structure_open_object_open_string.json │ │ │ ├── n_structure_open_open.json │ │ │ ├── n_structure_trailing_#.json │ │ │ ├── n_structure_whitespace_formfeed.json │ │ │ ├── y_array_ending_with_newline.json │ │ │ ├── y_array_with_1_and_newline.json │ │ │ ├── y_array_with_leading_space.json │ │ │ ├── y_array_with_trailing_space.json │ │ │ ├── y_number_real_capital_e_neg_exp.json │ │ │ ├── y_number_real_capital_e_pos_exp.json │ │ │ ├── y_number_real_fraction_exponent.json │ │ │ ├── y_object.json │ │ │ ├── y_string_backslash_doublequotes.json │ │ │ ├── y_string_escaped_noncharacter.json │ │ │ ├── y_string_unescaped_char_delete.json │ │ │ ├── y_string_unicode_U+FDD0_nonchar.json │ │ │ ├── y_string_unicode_U+FFFE_nonchar.json │ │ │ ├── y_string_with_del_character.json │ │ │ ├── y_structure_lonely_negative_real.json │ │ │ ├── i_string_incomplete_surrogate_pair.json │ │ │ ├── i_string_invalid_lonely_surrogate.json │ │ │ ├── i_string_inverted_surrogates_U+1D11E.json │ │ │ ├── i_string_lone_utf8_continuation_byte.json │ │ │ ├── i_string_overlong_sequence_2_bytes.json │ │ │ ├── i_string_overlong_sequence_6_bytes.json │ │ │ ├── n_array_1_true_without_comma.json │ │ │ ├── n_array_inner_array_no_comma.json │ │ │ ├── n_array_number_and_several_commas.json │ │ │ ├── n_number_invalid-negative-real.json │ │ │ ├── n_number_minus_infinity.json │ │ │ ├── n_number_neg_int_starting_with_zero.json │ │ │ ├── n_number_neg_real_without_int_part.json │ │ │ ├── n_number_neg_with_garbage_at_end.json │ │ │ ├── n_object_comma_instead_of_colon.json │ │ │ ├── n_object_trailing_comment.json │ │ │ ├── n_object_with_trailing_garbage.json │ │ │ ├── n_string_1_surrogate_then_escape_u.json │ │ │ ├── n_string_1_surrogate_then_escape_u1.json │ │ │ ├── n_string_1_surrogate_then_escape_u1x.json │ │ │ ├── n_string_invalid-utf-8-in-escape.json │ │ │ ├── n_string_invalid_utf8_after_escape.json │ │ │ ├── n_string_single_string_no_double_quotes.json │ │ │ ├── n_structure_array_trailing_garbage.json │ │ │ ├── n_structure_null-byte-outside-string.json │ │ │ ├── n_structure_object_unclosed_no_value.json │ │ │ ├── n_structure_open_array_open_string.json │ │ │ ├── n_structure_unclosed_object.json │ │ │ ├── y_number_double_close_to_zero.json │ │ │ ├── y_object_string_unicode.json │ │ │ ├── y_string_1_2_3_bytes_UTF-8_sequences.json │ │ │ ├── y_string_accepted_surrogate_pair.json │ │ │ ├── y_string_accepted_surrogate_pairs.json │ │ │ ├── y_string_escaped_control_character.json │ │ │ ├── y_string_last_surrogates_1_and_2.json │ │ │ ├── y_string_nonCharacterInUTF-8_U+FFFF.json │ │ │ ├── y_string_unicodeEscapedBackslash.json │ │ │ ├── y_string_unicode_U+10FFFE_nonchar.json │ │ │ ├── y_string_unicode_U+1FFFE_nonchar.json │ │ │ ├── y_structure_trailing_newline.json │ │ │ ├── i_object_key_lone_2nd_surrogate.json │ │ │ ├── i_string_1st_surrogate_but_2nd_missing.json │ │ │ ├── i_string_1st_valid_surrogate_2nd_invalid.json │ │ │ ├── i_string_overlong_sequence_6_bytes_null.json │ │ │ ├── n_array_colon_instead_of_comma.json │ │ │ ├── n_array_spaces_vertical_tab_formfeed.json │ │ │ ├── n_number_real_without_fractional_part.json │ │ │ ├── n_object_key_with_single_quotes.json │ │ │ ├── n_object_repeated_null_null.json │ │ │ ├── n_object_trailing_comment_open.json │ │ │ ├── n_string_incomplete_escaped_character.json │ │ │ ├── n_structure_array_with_extra_array_close.json │ │ │ ├── n_structure_array_with_unclosed_string.json │ │ │ ├── n_structure_number_with_trailing_garbage.json │ │ │ ├── n_structure_object_followed_by_closing_object.json │ │ │ ├── n_structure_whitespace_U+2060_word_joiner.json │ │ │ ├── y_array_heterogeneous.json │ │ │ ├── y_object_duplicated_key.json │ │ │ ├── y_object_with_newlines.json │ │ │ ├── y_string_backslash_and_u_escaped_zero.json │ │ │ ├── y_string_in_array_with_leading_space.json │ │ │ ├── y_string_nonCharacterInUTF-8_U+10FFFF.json │ │ │ ├── y_string_reservedCharacterInUTF-8_U+1BFFF.json │ │ │ ├── y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json │ │ │ ├── y_string_unicode_U+2064_invisible_plus.json │ │ │ ├── y_string_unicode_escaped_double_quote.json │ │ │ ├── i_string_incomplete_surrogate_and_escape_valid.json │ │ │ ├── i_string_incomplete_surrogates_escape_valid.json │ │ │ ├── n_array_items_separated_by_semicolon.json │ │ │ ├── n_number_minus_sign_with_trailing_garbage.json │ │ │ ├── n_object_several_trailing_commas.json │ │ │ ├── n_object_trailing_comment_slash_open.json │ │ │ ├── n_object_two_commas_in_a_row.json │ │ │ ├── n_object_with_single_string.json │ │ │ ├── n_string_incomplete_surrogate_escape_invalid.json │ │ │ ├── n_string_leading_uescaped_thinspace.json │ │ │ ├── n_structure_open_object_string_with_apostrophes.json │ │ │ ├── n_structure_uescaped_LF_before_string.json │ │ │ ├── n_structure_unclosed_array_partial_null.json │ │ │ ├── y_array_with_several_null.json │ │ │ ├── y_object_escaped_null_in_key.json │ │ │ ├── n_array_newlines_unclosed.json │ │ │ ├── n_structure_comma_instead_of_closing_brace.json │ │ │ ├── n_structure_object_with_comment.json │ │ │ ├── n_structure_object_with_trailing_garbage.json │ │ │ ├── n_structure_unclosed_array_unfinished_false.json │ │ │ ├── n_structure_unclosed_array_unfinished_true.json │ │ │ ├── y_object_duplicated_key_and_value.json │ │ │ ├── y_object_extreme_numbers.json │ │ │ ├── y_object_long_strings.json │ │ │ ├── y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json │ │ │ ├── n_array_unclosed_with_new_lines.json │ │ │ ├── n_object_non_string_key_but_huge_number_instead.json │ │ │ ├── n_object_trailing_comment_slash_open_incomplete.json │ │ │ ├── n_array_invalid_utf8.json │ │ │ ├── n_array_a_invalid_utf8.json │ │ │ ├── n_structure_single_eacute.json │ │ │ ├── i_string_UTF-16LE_with_BOM.json │ │ │ ├── n_number_invalid-utf-8-in-int.json │ │ │ ├── n_structure_lone-invalid-utf-8.json │ │ │ ├── n_structure_incomplete_UTF8_BOM.json │ │ │ ├── n_number_invalid-utf-8-in-exponent.json │ │ │ ├── n_number_invalid-utf-8-in-bigger-int.json │ │ │ ├── n_number_real_with_invalid_utf8_after_e.json │ │ │ ├── n_object_lone_continuation_byte_in_key_and_trailing_comma.json │ │ │ └── i_structure_500_nested_arrays.json │ │ └── original │ │ │ ├── n_number_+1.json │ │ │ ├── n_number_0e.json │ │ │ ├── n_single_space.json │ │ │ ├── y_array_empty.json │ │ │ ├── y_number.json │ │ │ ├── y_object_empty.json │ │ │ ├── y_string_pi.json │ │ │ ├── n_array_just_comma.json │ │ │ ├── n_array_just_minus.json │ │ │ ├── n_array_unclosed.json │ │ │ ├── n_number_++.json │ │ │ ├── n_number_+Inf.json │ │ │ ├── n_number_-01.json │ │ │ ├── n_number_-1.0..json │ │ │ ├── n_number_-2..json │ │ │ ├── n_number_-NaN.json │ │ │ ├── n_number_.-1.json │ │ │ ├── n_number_.2e-3.json │ │ │ ├── n_number_0.1.2.json │ │ │ ├── n_number_0.3e+.json │ │ │ ├── n_number_0.3e.json │ │ │ ├── n_number_0.e1.json │ │ │ ├── n_number_0e+.json │ │ │ ├── n_number_1.0e+.json │ │ │ ├── n_number_1.0e-.json │ │ │ ├── n_number_1.0e.json │ │ │ ├── n_number_1eE2.json │ │ │ ├── n_number_2.e+3.json │ │ │ ├── n_number_2.e-3.json │ │ │ ├── n_number_2.e3.json │ │ │ ├── n_number_9.e+.json │ │ │ ├── n_number_Inf.json │ │ │ ├── n_number_NaN.json │ │ │ ├── n_object_emoji.json │ │ │ ├── n_object_no-colon.json │ │ │ ├── n_structure_no_data.json │ │ │ ├── y_array_false.json │ │ │ ├── y_array_null.json │ │ │ ├── y_number_0e+1.json │ │ │ ├── y_number_0e1.json │ │ │ ├── y_string_space.json │ │ │ ├── y_string_utf8.json │ │ │ ├── n_array_double_comma.json │ │ │ ├── n_array_extra_close.json │ │ │ ├── n_array_extra_comma.json │ │ │ ├── n_array_incomplete.json │ │ │ ├── n_array_star_inside.json │ │ │ ├── n_incomplete_false.json │ │ │ ├── n_incomplete_null.json │ │ │ ├── n_incomplete_true.json │ │ │ ├── n_number_0_capital_E+.json │ │ │ ├── n_number_0_capital_E.json │ │ │ ├── n_number_1_000.json │ │ │ ├── n_number_expression.json │ │ │ ├── n_number_hex_1_digit.json │ │ │ ├── n_number_invalid+-.json │ │ │ ├── n_object_missing_key.json │ │ │ ├── n_string_escape_x.json │ │ │ ├── n_structure_end_array.json │ │ │ ├── n_structure_open_object.json │ │ │ ├── n_structure_single_star.json │ │ │ ├── y_array_empty-string.json │ │ │ ├── y_number_after_space.json │ │ │ ├── y_number_minus_zero.json │ │ │ ├── y_number_negative_one.json │ │ │ ├── y_number_negative_zero.json │ │ │ ├── y_number_simple_int.json │ │ │ ├── y_object_empty_key.json │ │ │ ├── y_object_simple.json │ │ │ ├── y_string_in_array.json │ │ │ ├── y_string_unicode.json │ │ │ ├── y_string_unicode_2.json │ │ │ ├── y_structure_lonely_int.json │ │ │ ├── y_structure_string_empty.json │ │ │ ├── n_array_comma_after_close.json │ │ │ ├── n_array_comma_and_number.json │ │ │ ├── n_array_missing_value.json │ │ │ ├── n_array_number_and_comma.json │ │ │ ├── n_multidigit_number_then_00.json │ │ │ ├── n_number_hex_2_digits.json │ │ │ ├── n_number_infinity.json │ │ │ ├── n_number_minus_space_1.json │ │ │ ├── n_number_with_alpha.json │ │ │ ├── n_number_with_leading_zero.json │ │ │ ├── n_object_bad_value.json │ │ │ ├── n_object_double_colon.json │ │ │ ├── n_object_missing_colon.json │ │ │ ├── n_object_missing_value.json │ │ │ ├── n_object_non_string_key.json │ │ │ ├── n_object_single_quote.json │ │ │ ├── n_object_unquoted_key.json │ │ │ ├── n_string_backslash_00.json │ │ │ ├── n_string_escaped_emoji.json │ │ │ ├── n_string_incomplete_escape.json │ │ │ ├── n_string_single_doublequote.json │ │ │ ├── n_string_unescaped_tab.json │ │ │ ├── n_structure_UTF8_BOM_no_data.json │ │ │ ├── n_structure_angle_bracket_..json │ │ │ ├── n_structure_double_array.json │ │ │ ├── n_structure_lone-open-bracket.json │ │ │ ├── n_structure_open_array_comma.json │ │ │ ├── n_structure_open_object_comma.json │ │ │ ├── n_structure_unclosed_array.json │ │ │ ├── n_structure_unicode-identifier.json │ │ │ ├── y_array_arraysWithSpaces.json │ │ │ ├── y_array_with_leading_space.json │ │ │ ├── y_array_with_trailing_space.json │ │ │ ├── y_number_int_with_exp.json │ │ │ ├── y_number_negative_int.json │ │ │ ├── y_number_real_capital_e.json │ │ │ ├── y_number_real_exponent.json │ │ │ ├── y_number_real_neg_exp.json │ │ │ ├── y_object_basic.json │ │ │ ├── y_string_double_escape_a.json │ │ │ ├── y_string_double_escape_n.json │ │ │ ├── y_string_null_escape.json │ │ │ ├── y_string_simple_ascii.json │ │ │ ├── y_string_u+2028_line_sep.json │ │ │ ├── y_string_u+2029_par_sep.json │ │ │ ├── y_structure_lonely_false.json │ │ │ ├── y_structure_lonely_null.json │ │ │ ├── y_structure_lonely_string.json │ │ │ ├── y_structure_lonely_true.json │ │ │ ├── y_structure_true_in_array.json │ │ │ ├── i_number_neg_int_huge_exp.json │ │ │ ├── i_structure_UTF-8_BOM_empty_object.json │ │ │ ├── n_array_1_true_without_comma.json │ │ │ ├── n_array_double_extra_comma.json │ │ │ ├── n_array_incomplete_invalid_value.json │ │ │ ├── n_array_inner_array_no_comma.json │ │ │ ├── n_array_unclosed_trailing_comma.json │ │ │ ├── n_number_minus_infinity.json │ │ │ ├── n_number_real_garbage_after_e.json │ │ │ ├── n_number_starting_with_dot.json │ │ │ ├── n_object_bracket_key.json │ │ │ ├── n_object_garbage_at_end.json │ │ │ ├── n_object_missing_semicolon.json │ │ │ ├── n_object_trailing_comma.json │ │ │ ├── n_object_unterminated-value.json │ │ │ ├── n_string_escaped_ctrl_char_tab.json │ │ │ ├── n_string_invalid_backslash_esc.json │ │ │ ├── n_string_start_escape_unclosed.json │ │ │ ├── n_string_unescaped_ctrl_char.json │ │ │ ├── n_string_unicode_CapitalU.json │ │ │ ├── n_string_with_trailing_garbage.json │ │ │ ├── n_structure_U+2060_word_joined.json │ │ │ ├── n_structure_capitalized_True.json │ │ │ ├── n_structure_close_unopened_array.json │ │ │ ├── n_structure_open_array_apostrophe.json │ │ │ ├── n_structure_open_array_open_object.json │ │ │ ├── n_structure_open_array_string.json │ │ │ ├── n_structure_open_object_open_array.json │ │ │ ├── n_structure_trailing_#.json │ │ │ ├── n_structure_whitespace_formfeed.json │ │ │ ├── y_array_ending_with_newline.json │ │ │ ├── y_array_with_1_and_newline.json │ │ │ ├── y_number_real_pos_exponent.json │ │ │ ├── y_number_simple_real.json │ │ │ ├── y_object.json │ │ │ ├── y_string_comments.json │ │ │ ├── y_string_one-byte-utf-8.json │ │ │ ├── y_string_three-byte-utf-8.json │ │ │ ├── y_string_two-byte-utf-8.json │ │ │ ├── y_string_unescaped_char_delete.json │ │ │ ├── y_string_with_del_character.json │ │ │ ├── y_structure_lonely_negative_real.json │ │ │ ├── y_structure_whitespace_array.json │ │ │ ├── i_number_pos_double_huge_exp.json │ │ │ ├── i_number_real_pos_overflow.json │ │ │ ├── i_number_real_underflow.json │ │ │ ├── i_string_invalid_surrogate.json │ │ │ ├── i_string_lone_second_surrogate.json │ │ │ ├── n_array_colon_instead_of_comma.json │ │ │ ├── n_array_items_separated_by_semicolon.json │ │ │ ├── n_array_number_and_several_commas.json │ │ │ ├── n_array_unclosed_with_object_inside.json │ │ │ ├── n_number_U+FF11_fullwidth_digit_one.json │ │ │ ├── n_number_neg_int_starting_with_zero.json │ │ │ ├── n_number_neg_real_without_int_part.json │ │ │ ├── n_number_neg_with_garbage_at_end.json │ │ │ ├── n_number_real_without_fractional_part.json │ │ │ ├── n_object_trailing_comment.json │ │ │ ├── n_object_with_trailing_garbage.json │ │ │ ├── n_string_accentuated_char_no_quotes.json │ │ │ ├── n_string_escaped_backslash_bad.json │ │ │ ├── n_string_invalid_unicode_escape.json │ │ │ ├── n_string_no_quotes_with_bad_escape.json │ │ │ ├── n_string_single_quote.json │ │ │ ├── n_structure_angle_bracket_null.json │ │ │ ├── n_structure_array_trailing_garbage.json │ │ │ ├── n_structure_ascii-unicode-identifier.json │ │ │ ├── n_structure_null-byte-outside-string.json │ │ │ ├── n_structure_object_unclosed_no_value.json │ │ │ ├── n_structure_open_array_open_string.json │ │ │ ├── n_structure_open_object_close_array.json │ │ │ ├── n_structure_open_object_open_string.json │ │ │ ├── n_structure_open_open.json │ │ │ ├── n_structure_unclosed_object.json │ │ │ ├── y_array_heterogeneous.json │ │ │ ├── y_number_real_capital_e_neg_exp.json │ │ │ ├── y_number_real_capital_e_pos_exp.json │ │ │ ├── y_object_duplicated_key.json │ │ │ ├── y_string_backslash_doublequotes.json │ │ │ ├── y_string_escaped_noncharacter.json │ │ │ ├── y_string_nbsp_uescaped.json │ │ │ ├── y_string_nonCharacterInUTF-8_U+FFFF.json │ │ │ ├── y_string_unicode_U+FDD0_nonchar.json │ │ │ ├── y_string_unicode_U+FFFE_nonchar.json │ │ │ ├── y_structure_trailing_newline.json │ │ │ ├── i_number_double_huge_neg_exp.json │ │ │ ├── i_number_real_neg_overflow.json │ │ │ ├── i_object_key_lone_2nd_surrogate.json │ │ │ ├── i_string_incomplete_surrogate_pair.json │ │ │ ├── i_string_invalid_lonely_surrogate.json │ │ │ ├── n_array_newlines_unclosed.json │ │ │ ├── n_array_spaces_vertical_tab_formfeed.json │ │ │ ├── n_number_invalid-negative-real.json │ │ │ ├── n_object_comma_instead_of_colon.json │ │ │ ├── n_object_key_with_single_quotes.json │ │ │ ├── n_object_several_trailing_commas.json │ │ │ ├── n_object_trailing_comment_open.json │ │ │ ├── n_object_two_commas_in_a_row.json │ │ │ ├── n_string_1_surrogate_then_escape.json │ │ │ ├── n_string_1_surrogate_then_escape_u.json │ │ │ ├── n_string_incomplete_escaped_character.json │ │ │ ├── n_string_incomplete_surrogate.json │ │ │ ├── n_string_single_string_no_double_quotes.json │ │ │ ├── n_string_unescaped_newline.json │ │ │ ├── n_structure_array_with_extra_array_close.json │ │ │ ├── n_structure_array_with_unclosed_string.json │ │ │ ├── n_structure_number_with_trailing_garbage.json │ │ │ ├── n_structure_whitespace_U+2060_word_joiner.json │ │ │ ├── y_array_with_several_null.json │ │ │ ├── y_number_real_fraction_exponent.json │ │ │ ├── y_object_with_newlines.json │ │ │ ├── y_string_allowed_escapes.json │ │ │ ├── y_string_escaped_control_character.json │ │ │ ├── y_string_in_array_with_leading_space.json │ │ │ ├── y_string_nonCharacterInUTF-8_U+10FFFF.json │ │ │ ├── y_string_uEscape.json │ │ │ ├── y_string_uescaped_newline.json │ │ │ ├── y_string_unicodeEscapedBackslash.json │ │ │ ├── i_number_too_big_pos_int.json │ │ │ ├── i_string_1st_surrogate_but_2nd_missing.json │ │ │ ├── n_array_unclosed_with_new_lines.json │ │ │ ├── n_number_minus_sign_with_trailing_garbage.json │ │ │ ├── n_number_with_alpha_char.json │ │ │ ├── n_object_repeated_null_null.json │ │ │ ├── n_object_trailing_comment_slash_open.json │ │ │ ├── n_object_with_single_string.json │ │ │ ├── n_string_1_surrogate_then_escape_u1.json │ │ │ ├── n_string_1_surrogate_then_escape_u1x.json │ │ │ ├── n_string_leading_uescaped_thinspace.json │ │ │ ├── n_structure_object_followed_by_closing_object.json │ │ │ ├── n_structure_object_with_comment.json │ │ │ ├── n_structure_open_object_string_with_apostrophes.json │ │ │ ├── n_structure_uescaped_LF_before_string.json │ │ │ ├── n_structure_unclosed_array_partial_null.json │ │ │ ├── y_object_duplicated_key_and_value.json │ │ │ ├── y_object_escaped_null_in_key.json │ │ │ ├── y_string_accepted_surrogate_pair.json │ │ │ ├── y_string_backslash_and_u_escaped_zero.json │ │ │ ├── y_string_last_surrogates_1_and_2.json │ │ │ ├── y_string_reservedCharacterInUTF-8_U+1BFFF.json │ │ │ ├── y_string_unicode_U+10FFFE_nonchar.json │ │ │ ├── y_string_unicode_U+1FFFE_nonchar.json │ │ │ ├── y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json │ │ │ ├── y_string_unicode_U+2064_invisible_plus.json │ │ │ ├── y_string_unicode_escaped_double_quote.json │ │ │ ├── i_string_1st_valid_surrogate_2nd_invalid.json │ │ │ ├── i_string_inverted_surrogates_U+1D11E.json │ │ │ ├── n_structure_comma_instead_of_closing_brace.json │ │ │ ├── n_structure_object_with_trailing_garbage.json │ │ │ ├── n_structure_unclosed_array_unfinished_false.json │ │ │ ├── n_structure_unclosed_array_unfinished_true.json │ │ │ ├── i_number_too_big_neg_int.json │ │ │ ├── i_string_incomplete_surrogate_and_escape_valid.json │ │ │ ├── i_string_incomplete_surrogates_escape_valid.json │ │ │ ├── n_object_non_string_key_but_huge_number_instead.json │ │ │ ├── n_object_trailing_comment_slash_open_incomplete.json │ │ │ ├── y_object_extreme_numbers.json │ │ │ ├── y_string_1_2_3_bytes_UTF-8_sequences.json │ │ │ ├── y_string_accepted_surrogate_pairs.json │ │ │ ├── n_string_incomplete_surrogate_escape_invalid.json │ │ │ ├── y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json │ │ │ ├── i_number_very_big_negative_int.json │ │ │ ├── y_number_double_close_to_zero.json │ │ │ ├── i_string_iso_latin_1.json │ │ │ ├── n_array_invalid_utf8.json │ │ │ ├── y_object_long_strings.json │ │ │ ├── i_string_invalid_utf-8.json │ │ │ ├── i_string_utf16BE_no_BOM.json │ │ │ ├── i_string_utf16LE_no_BOM.json │ │ │ ├── n_array_a_invalid_utf8.json │ │ │ ├── y_object_string_unicode.json │ │ │ ├── i_string_truncated-utf-8.json │ │ │ ├── n_structure_single_eacute.json │ │ │ ├── i_string_UTF-16LE_with_BOM.json │ │ │ ├── i_string_UTF8_surrogate_U+D800.json │ │ │ ├── i_string_not_in_unicode_range.json │ │ │ ├── n_number_invalid-utf-8-in-int.json │ │ │ ├── n_structure_lone-invalid-utf-8.json │ │ │ ├── i_number_huge_exp.json │ │ │ ├── i_string_UTF-8_invalid_sequence.json │ │ │ ├── n_string_invalid-utf-8-in-escape.json │ │ │ ├── n_structure_incomplete_UTF8_BOM.json │ │ │ ├── i_string_overlong_sequence_2_bytes.json │ │ │ ├── i_string_overlong_sequence_6_bytes.json │ │ │ ├── n_number_invalid-utf-8-in-exponent.json │ │ │ ├── n_string_invalid_utf8_after_escape.json │ │ │ ├── i_string_lone_utf8_continuation_byte.json │ │ │ ├── n_number_invalid-utf-8-in-bigger-int.json │ │ │ ├── i_string_overlong_sequence_6_bytes_null.json │ │ │ ├── n_number_real_with_invalid_utf8_after_e.json │ │ │ ├── n_object_lone_continuation_byte_in_key_and_trailing_comma.json │ │ │ └── i_structure_500_nested_arrays.json │ ├── java │ │ └── dev │ │ │ └── blaauwendraad │ │ │ └── masker │ │ │ └── json │ │ │ ├── config │ │ │ └── JsonMaskingConfigTestUtil.java │ │ │ ├── JsonMaskerTestInstance.java │ │ │ ├── util │ │ │ ├── FuzzingDurationUtil.java │ │ │ └── JsonFormatter.java │ │ │ ├── EmptyKeyTest.java │ │ │ ├── JsonPathLookupTest.java │ │ │ ├── RecurringKeyTest.java │ │ │ ├── NumberMaskingTest.java │ │ │ ├── MaskArrayValuesTest.java │ │ │ ├── MaskObjectValuesTest.java │ │ │ ├── MultiTargetKeyTest.java │ │ │ ├── ColonInKeyOrValueTest.java │ │ │ ├── PreserveLengthTest.java │ │ │ ├── EscapedCharactersTest.java │ │ │ ├── TargetKeyCaseSensitivityTest.java │ │ │ ├── MaskObjectInNonMaskedArrayTest.java │ │ │ ├── path │ │ │ └── JsonPathTest.java │ │ │ ├── PrettyPrintTest.java │ │ │ ├── AssumedLengthValuesTest.java │ │ │ ├── MaskAllKeysTest.java │ │ │ ├── MultiJsonTest.java │ │ │ ├── ConcurrentMaskingTest.java │ │ │ └── MaskingStateTest.java │ └── resources │ │ ├── test-case-sensitivity.json │ │ ├── test-recurring-key.json │ │ ├── test-preserve-length.json │ │ ├── test-empty-key.json │ │ ├── test-object-in-non-masked-array.json │ │ ├── test-contains-colon.json │ │ ├── test-number-values.json │ │ └── test-multiple-target-keys.json ├── jmh │ ├── benchmark-history │ │ ├── README.md │ │ ├── 2022-06-09.md │ │ ├── 2022-07-02.md │ │ ├── 2022-07-12.md │ │ └── 2022-09-11.md │ └── java │ │ └── dev │ │ └── blaauwendraad │ │ └── masker │ │ └── json │ │ └── InstanceCreationBenchmark.java └── main │ ├── java │ ├── dev │ │ └── blaauwendraad │ │ │ └── masker │ │ │ └── json │ │ │ ├── util │ │ │ ├── package-info.java │ │ │ └── AsciiJsonUtil.java │ │ │ ├── path │ │ │ ├── package-info.java │ │ │ └── JsonPath.java │ │ │ ├── config │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── InvalidJsonException.java │ │ │ ├── DescriptiveValueMasker.java │ │ │ ├── JsonMasker.java │ │ │ └── ValueMasker.java │ └── module-info.java │ └── java17 │ └── dev │ └── blaauwendraad │ └── masker │ └── json │ ├── util │ └── AsciiJsonUtil.java │ └── ValueMasker.java ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── adr └── _template.md ├── .gitignore ├── .github ├── dependabot.yml └── workflows │ ├── update-gradle-wrapper.yml │ └── on-release-tag.yml ├── LICENSE.md ├── CONTRIBUTING.md └── SECURITY.md /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "json-masker" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0e.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_Inf.json: -------------------------------------------------------------------------------- 1 | [Inf] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_NaN.json: -------------------------------------------------------------------------------- 1 | [NaN] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_single_space.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_empty.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_null.json: -------------------------------------------------------------------------------- 1 | [null] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_empty.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_pi.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_+1.json: -------------------------------------------------------------------------------- 1 | [+1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0e.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_single_space.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_empty.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number.json: -------------------------------------------------------------------------------- 1 | [123e65] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_empty.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_pi.json: -------------------------------------------------------------------------------- 1 | ["π"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_just_comma.json: -------------------------------------------------------------------------------- 1 | [,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_star_inside.json: -------------------------------------------------------------------------------- 1 | [*] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_unclosed.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_incomplete_null.json: -------------------------------------------------------------------------------- 1 | [nul] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_incomplete_true.json: -------------------------------------------------------------------------------- 1 | ["&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_++.json: -------------------------------------------------------------------------------- 1 | [++"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_+1.json: -------------------------------------------------------------------------------- 1 | [+"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_+Inf.json: -------------------------------------------------------------------------------- 1 | [+Inf] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_-01.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_-1.0..json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_-2..json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_-NaN.json: -------------------------------------------------------------------------------- 1 | ["###"NaN] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_.-1.json: -------------------------------------------------------------------------------- 1 | [."###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_.2e-3.json: -------------------------------------------------------------------------------- 1 | [."###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0.1.2.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0.3e+.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0.3e.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0.e1.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0e+.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_1.0e+.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_1.0e-.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_1.0e.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_1eE2.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_2.e+3.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_2.e-3.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_2.e3.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_9.e+.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_emoji.json: -------------------------------------------------------------------------------- 1 | {🇨🇭} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_no-colon.json: -------------------------------------------------------------------------------- 1 | {"a" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_end_array.json: -------------------------------------------------------------------------------- 1 | ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_false.json: -------------------------------------------------------------------------------- 1 | ["&&&"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_0e+1.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_0e1.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_simple.json: -------------------------------------------------------------------------------- 1 | {"a":[]} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_space.json: -------------------------------------------------------------------------------- 1 | "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_uEscape.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_utf8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_just_comma.json: -------------------------------------------------------------------------------- 1 | [,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_just_minus.json: -------------------------------------------------------------------------------- 1 | [-] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_unclosed.json: -------------------------------------------------------------------------------- 1 | ["" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_++.json: -------------------------------------------------------------------------------- 1 | [++1234] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_+Inf.json: -------------------------------------------------------------------------------- 1 | [+Inf] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_-01.json: -------------------------------------------------------------------------------- 1 | [-01] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_-1.0..json: -------------------------------------------------------------------------------- 1 | [-1.0.] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_-2..json: -------------------------------------------------------------------------------- 1 | [-2.] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_-NaN.json: -------------------------------------------------------------------------------- 1 | [-NaN] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_.-1.json: -------------------------------------------------------------------------------- 1 | [.-1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_.2e-3.json: -------------------------------------------------------------------------------- 1 | [.2e-3] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0.1.2.json: -------------------------------------------------------------------------------- 1 | [0.1.2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0.3e+.json: -------------------------------------------------------------------------------- 1 | [0.3e+] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0.3e.json: -------------------------------------------------------------------------------- 1 | [0.3e] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0.e1.json: -------------------------------------------------------------------------------- 1 | [0.e1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0e+.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_1.0e+.json: -------------------------------------------------------------------------------- 1 | [1.0e+] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_1.0e-.json: -------------------------------------------------------------------------------- 1 | [1.0e-] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_1.0e.json: -------------------------------------------------------------------------------- 1 | [1.0e] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_1eE2.json: -------------------------------------------------------------------------------- 1 | [1eE2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_2.e+3.json: -------------------------------------------------------------------------------- 1 | [2.e+3] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_2.e-3.json: -------------------------------------------------------------------------------- 1 | [2.e-3] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_2.e3.json: -------------------------------------------------------------------------------- 1 | [2.e3] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_9.e+.json: -------------------------------------------------------------------------------- 1 | [9.e+] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_Inf.json: -------------------------------------------------------------------------------- 1 | [Inf] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_NaN.json: -------------------------------------------------------------------------------- 1 | [NaN] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_emoji.json: -------------------------------------------------------------------------------- 1 | {🇨🇭} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_no-colon.json: -------------------------------------------------------------------------------- 1 | {"a" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_false.json: -------------------------------------------------------------------------------- 1 | [false] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_null.json: -------------------------------------------------------------------------------- 1 | [null] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_0e+1.json: -------------------------------------------------------------------------------- 1 | [0e+1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_0e1.json: -------------------------------------------------------------------------------- 1 | [0e1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_space.json: -------------------------------------------------------------------------------- 1 | " " -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_utf8.json: -------------------------------------------------------------------------------- 1 | ["€𝄞"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_huge_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_iso_latin_1.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_extra_close.json: -------------------------------------------------------------------------------- 1 | ["***"]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["***",] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_incomplete.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_just_minus.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_incomplete_false.json: -------------------------------------------------------------------------------- 1 | ["&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0_capital_E+.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_0_capital_E.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_1_000.json: -------------------------------------------------------------------------------- 1 | ["###" 0"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_expression.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_invalid+-.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_missing_value.json: -------------------------------------------------------------------------------- 1 | {"a": -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_non_string_key.json: -------------------------------------------------------------------------------- 1 | {1:1} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_single_quote.json: -------------------------------------------------------------------------------- 1 | {'a':0} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_backslash_00.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_escape_x.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_UTF8_BOM_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_double_array.json: -------------------------------------------------------------------------------- 1 | [][] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object.json: -------------------------------------------------------------------------------- 1 | { -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_single_star.json: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_empty-string.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_after_space.json: -------------------------------------------------------------------------------- 1 | [ "###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_int_with_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_minus_zero.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_negative_int.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_negative_one.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_neg_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_simple_int.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_simple_real.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_basic.json: -------------------------------------------------------------------------------- 1 | {"asd":"***"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_empty_key.json: -------------------------------------------------------------------------------- 1 | {"":"###"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_comments.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_in_array.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_null_escape.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_simple_ascii.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_2.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_int.json: -------------------------------------------------------------------------------- 1 | "###" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_null.json: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_true.json: -------------------------------------------------------------------------------- 1 | "&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_double_comma.json: -------------------------------------------------------------------------------- 1 | [1,,2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_extra_close.json: -------------------------------------------------------------------------------- 1 | ["x"]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["",] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_incomplete.json: -------------------------------------------------------------------------------- 1 | ["x" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_star_inside.json: -------------------------------------------------------------------------------- 1 | [*] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_incomplete_false.json: -------------------------------------------------------------------------------- 1 | [fals] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_incomplete_null.json: -------------------------------------------------------------------------------- 1 | [nul] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_incomplete_true.json: -------------------------------------------------------------------------------- 1 | [tru] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0_capital_E+.json: -------------------------------------------------------------------------------- 1 | [0E+] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_0_capital_E.json: -------------------------------------------------------------------------------- 1 | [0E] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_1_000.json: -------------------------------------------------------------------------------- 1 | [1 000.0] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_expression.json: -------------------------------------------------------------------------------- 1 | [1+2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_hex_1_digit.json: -------------------------------------------------------------------------------- 1 | [0x1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_invalid+-.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_missing_key.json: -------------------------------------------------------------------------------- 1 | {:"b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_escape_x.json: -------------------------------------------------------------------------------- 1 | ["\x00"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_end_array.json: -------------------------------------------------------------------------------- 1 | ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object.json: -------------------------------------------------------------------------------- 1 | { -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_single_star.json: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_empty-string.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_after_space.json: -------------------------------------------------------------------------------- 1 | [ 4] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_minus_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_negative_one.json: -------------------------------------------------------------------------------- 1 | [-1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_negative_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_simple_int.json: -------------------------------------------------------------------------------- 1 | [123] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_empty_key.json: -------------------------------------------------------------------------------- 1 | {"":0} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_simple.json: -------------------------------------------------------------------------------- 1 | {"a":[]} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_in_array.json: -------------------------------------------------------------------------------- 1 | ["asd"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode.json: -------------------------------------------------------------------------------- 1 | ["\uA66D"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_2.json: -------------------------------------------------------------------------------- 1 | ["⍂㈴⍂"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_int.json: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_string_empty.json: -------------------------------------------------------------------------------- 1 | "" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_neg_int_huge_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_real_neg_overflow.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_real_pos_overflow.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_real_underflow.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_too_big_neg_int.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_too_big_pos_int.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_invalid_surrogate.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_invalid_utf-8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_truncated-utf-8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_utf16BE_no_BOM.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_utf16LE_no_BOM.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_comma_after_close.json: -------------------------------------------------------------------------------- 1 | ["***"], -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_comma_and_number.json: -------------------------------------------------------------------------------- 1 | [,"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_missing_value.json: -------------------------------------------------------------------------------- 1 | [ , "***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_number_and_comma.json: -------------------------------------------------------------------------------- 1 | ["###",] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_multidigit_number_then_00.json: -------------------------------------------------------------------------------- 1 | "###" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_hex_1_digit.json: -------------------------------------------------------------------------------- 1 | ["###"x"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_infinity.json: -------------------------------------------------------------------------------- 1 | [Infini"&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_minus_space_1.json: -------------------------------------------------------------------------------- 1 | ["###" 1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_with_alpha.json: -------------------------------------------------------------------------------- 1 | ["###"a"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_with_leading_zero.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_bad_value.json: -------------------------------------------------------------------------------- 1 | ["***", "&&&"h] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_bracket_key.json: -------------------------------------------------------------------------------- 1 | {[: "x"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_double_colon.json: -------------------------------------------------------------------------------- 1 | {"x"::"b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_missing_colon.json: -------------------------------------------------------------------------------- 1 | {"a" b} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_missing_key.json: -------------------------------------------------------------------------------- 1 | {:"b"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_unquoted_key.json: -------------------------------------------------------------------------------- 1 | {a: "b"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_escaped_emoji.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_incomplete_escape.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_single_doublequote.json: -------------------------------------------------------------------------------- 1 | "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_unescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_unescaped_tab.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_unicode_CapitalU.json: -------------------------------------------------------------------------------- 1 | "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_U+2060_word_joined.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_angle_bracket_..json: -------------------------------------------------------------------------------- 1 | <.> -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_lone-open-bracket.json: -------------------------------------------------------------------------------- 1 | [ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_array_comma.json: -------------------------------------------------------------------------------- 1 | [, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object_comma.json: -------------------------------------------------------------------------------- 1 | {, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unclosed_array.json: -------------------------------------------------------------------------------- 1 | ["###" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unicode-identifier.json: -------------------------------------------------------------------------------- 1 | å -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_arraysWithSpaces.json: -------------------------------------------------------------------------------- 1 | [[] ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_negative_zero.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_capital_e.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_exponent.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_pos_exponent.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_allowed_escapes.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_double_escape_a.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_double_escape_n.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_nbsp_uescaped.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_one-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_three-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_two-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_u+2028_line_sep.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_u+2029_par_sep.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_uescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_false.json: -------------------------------------------------------------------------------- 1 | "&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_string.json: -------------------------------------------------------------------------------- 1 | "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_string_empty.json: -------------------------------------------------------------------------------- 1 | "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_true_in_array.json: -------------------------------------------------------------------------------- 1 | ["&&&"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_whitespace_array.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_comma_after_close.json: -------------------------------------------------------------------------------- 1 | [""], -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_comma_and_number.json: -------------------------------------------------------------------------------- 1 | [,1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_missing_value.json: -------------------------------------------------------------------------------- 1 | [ , ""] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_number_and_comma.json: -------------------------------------------------------------------------------- 1 | [1,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_multidigit_number_then_00.json: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_hex_2_digits.json: -------------------------------------------------------------------------------- 1 | [0x42] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_infinity.json: -------------------------------------------------------------------------------- 1 | [Infinity] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_minus_space_1.json: -------------------------------------------------------------------------------- 1 | [- 1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_with_alpha.json: -------------------------------------------------------------------------------- 1 | [1.2a-3] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_with_leading_zero.json: -------------------------------------------------------------------------------- 1 | [012] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_bad_value.json: -------------------------------------------------------------------------------- 1 | ["x", truth] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_double_colon.json: -------------------------------------------------------------------------------- 1 | {"x"::"b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_missing_colon.json: -------------------------------------------------------------------------------- 1 | {"a" b} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_missing_value.json: -------------------------------------------------------------------------------- 1 | {"a": -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_non_string_key.json: -------------------------------------------------------------------------------- 1 | {1:1} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_single_quote.json: -------------------------------------------------------------------------------- 1 | {'a':0} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_unquoted_key.json: -------------------------------------------------------------------------------- 1 | {a: "b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_backslash_00.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_escaped_emoji.json: -------------------------------------------------------------------------------- 1 | ["\🌀"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_incomplete_escape.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_single_doublequote.json: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_unescaped_tab.json: -------------------------------------------------------------------------------- 1 | [" "] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_UTF8_BOM_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_angle_bracket_..json: -------------------------------------------------------------------------------- 1 | <.> -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_double_array.json: -------------------------------------------------------------------------------- 1 | [][] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_lone-open-bracket.json: -------------------------------------------------------------------------------- 1 | [ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_array_comma.json: -------------------------------------------------------------------------------- 1 | [, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object_comma.json: -------------------------------------------------------------------------------- 1 | {, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unclosed_array.json: -------------------------------------------------------------------------------- 1 | [1 -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unicode-identifier.json: -------------------------------------------------------------------------------- 1 | å -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_arraysWithSpaces.json: -------------------------------------------------------------------------------- 1 | [[] ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_with_trailing_space.json: -------------------------------------------------------------------------------- 1 | [2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_int_with_exp.json: -------------------------------------------------------------------------------- 1 | [20e1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_negative_int.json: -------------------------------------------------------------------------------- 1 | [-123] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_capital_e.json: -------------------------------------------------------------------------------- 1 | [1E22] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_exponent.json: -------------------------------------------------------------------------------- 1 | [123e45] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1e-2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_basic.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_double_escape_a.json: -------------------------------------------------------------------------------- 1 | ["\\a"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_double_escape_n.json: -------------------------------------------------------------------------------- 1 | ["\\n"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_null_escape.json: -------------------------------------------------------------------------------- 1 | ["\u0000"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_simple_ascii.json: -------------------------------------------------------------------------------- 1 | ["asd "] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_u+2028_line_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_u+2029_par_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_false.json: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_null.json: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_string.json: -------------------------------------------------------------------------------- 1 | "asd" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_true.json: -------------------------------------------------------------------------------- 1 | true -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_true_in_array.json: -------------------------------------------------------------------------------- 1 | [true] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_double_huge_neg_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_pos_double_huge_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_number_very_big_negative_int.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_UTF-8_invalid_sequence.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_UTF8_surrogate_U+D800.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_lone_second_surrogate.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_not_in_unicode_range.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_structure_UTF-8_BOM_empty_object.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_double_comma.json: -------------------------------------------------------------------------------- 1 | ["###",,"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_double_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["***",,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_incomplete_invalid_value.json: -------------------------------------------------------------------------------- 1 | [x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_unclosed_trailing_comma.json: -------------------------------------------------------------------------------- 1 | ["###", -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_unclosed_with_object_inside.json: -------------------------------------------------------------------------------- 1 | [{} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_U+FF11_fullwidth_digit_one.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_hex_2_digits.json: -------------------------------------------------------------------------------- 1 | ["###"x"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_real_garbage_after_e.json: -------------------------------------------------------------------------------- 1 | ["###"a] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_starting_with_dot.json: -------------------------------------------------------------------------------- 1 | [."###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_with_alpha_char.json: -------------------------------------------------------------------------------- 1 | ["###"H"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | {"a":"***" 123} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_missing_semicolon.json: -------------------------------------------------------------------------------- 1 | {"a" "b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_trailing_comma.json: -------------------------------------------------------------------------------- 1 | {"id":"###",} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_unterminated-value.json: -------------------------------------------------------------------------------- 1 | {"a":"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_1_surrogate_then_escape.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_accentuated_char_no_quotes.json: -------------------------------------------------------------------------------- 1 | [é] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_escaped_backslash_bad.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_escaped_ctrl_char_tab.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_incomplete_surrogate.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_invalid_backslash_esc.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_invalid_unicode_escape.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_no_quotes_with_bad_escape.json: -------------------------------------------------------------------------------- 1 | [\n] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_single_quote.json: -------------------------------------------------------------------------------- 1 | ['single quo"&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_start_escape_unclosed.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_unescaped_ctrl_char.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | "***"x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_angle_bracket_null.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_ascii-unicode-identifier.json: -------------------------------------------------------------------------------- 1 | aå -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_capitalized_True.json: -------------------------------------------------------------------------------- 1 | [True] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_close_unopened_array.json: -------------------------------------------------------------------------------- 1 | "###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_array_apostrophe.json: -------------------------------------------------------------------------------- 1 | [' -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_array_open_object.json: -------------------------------------------------------------------------------- 1 | [{ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_array_string.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object_close_array.json: -------------------------------------------------------------------------------- 1 | {] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object_open_array.json: -------------------------------------------------------------------------------- 1 | {[ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object_open_string.json: -------------------------------------------------------------------------------- 1 | {"a -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_open.json: -------------------------------------------------------------------------------- 1 | ["***"\{["\{["\{ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_trailing_#.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}#{} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_whitespace_formfeed.json: -------------------------------------------------------------------------------- 1 | [ ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_ending_with_newline.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_with_1_and_newline.json: -------------------------------------------------------------------------------- 1 | ["###" 2 | ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_with_trailing_space.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_capital_e_neg_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_capital_e_pos_exp.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_real_fraction_exponent.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"***", "dfg":"***"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_backslash_doublequotes.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_escaped_noncharacter.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unescaped_char_delete.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+FDD0_nonchar.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_with_del_character.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_lonely_negative_real.json: -------------------------------------------------------------------------------- 1 | "###" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_neg_int_huge_exp.json: -------------------------------------------------------------------------------- 1 | [-1e+9999] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_structure_UTF-8_BOM_empty_object.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_1_true_without_comma.json: -------------------------------------------------------------------------------- 1 | [1 true] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_double_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["x",,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_incomplete_invalid_value.json: -------------------------------------------------------------------------------- 1 | [x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_inner_array_no_comma.json: -------------------------------------------------------------------------------- 1 | [3[4]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_unclosed_trailing_comma.json: -------------------------------------------------------------------------------- 1 | [1, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_minus_infinity.json: -------------------------------------------------------------------------------- 1 | [-Infinity] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_real_garbage_after_e.json: -------------------------------------------------------------------------------- 1 | [1ea] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_starting_with_dot.json: -------------------------------------------------------------------------------- 1 | [.123] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_bracket_key.json: -------------------------------------------------------------------------------- 1 | {[: "x"} 2 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | {"a":"a" 123} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_missing_semicolon.json: -------------------------------------------------------------------------------- 1 | {"a" "b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_trailing_comma.json: -------------------------------------------------------------------------------- 1 | {"id":0,} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_unterminated-value.json: -------------------------------------------------------------------------------- 1 | {"a":"a -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_escaped_ctrl_char_tab.json: -------------------------------------------------------------------------------- 1 | ["\ "] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_invalid_backslash_esc.json: -------------------------------------------------------------------------------- 1 | ["\a"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_start_escape_unclosed.json: -------------------------------------------------------------------------------- 1 | ["\ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_unescaped_ctrl_char.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_unicode_CapitalU.json: -------------------------------------------------------------------------------- 1 | "\UA66D" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | ""x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_U+2060_word_joined.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_capitalized_True.json: -------------------------------------------------------------------------------- 1 | [True] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_close_unopened_array.json: -------------------------------------------------------------------------------- 1 | 1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_array_apostrophe.json: -------------------------------------------------------------------------------- 1 | [' -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_array_open_object.json: -------------------------------------------------------------------------------- 1 | [{ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_array_string.json: -------------------------------------------------------------------------------- 1 | ["a" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object_open_array.json: -------------------------------------------------------------------------------- 1 | {[ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_trailing_#.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}#{} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_whitespace_formfeed.json: -------------------------------------------------------------------------------- 1 | [ ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_ending_with_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_with_1_and_newline.json: -------------------------------------------------------------------------------- 1 | [1 2 | ] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_pos_exponent.json: -------------------------------------------------------------------------------- 1 | [1e+2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_simple_real.json: -------------------------------------------------------------------------------- 1 | [123.456789] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf", "dfg":"fgh"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_comments.json: -------------------------------------------------------------------------------- 1 | ["a/*b*/c/*d//e"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_one-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u002c"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_three-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0821"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_two-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0123"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unescaped_char_delete.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_with_del_character.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_lonely_negative_real.json: -------------------------------------------------------------------------------- 1 | -0.1 -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_whitespace_array.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_incomplete_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_invalid_lonely_surrogate.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_inverted_surrogates_U+1D11E.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_lone_utf8_continuation_byte.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_overlong_sequence_2_bytes.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_overlong_sequence_6_bytes.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_1_true_without_comma.json: -------------------------------------------------------------------------------- 1 | ["###" true] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_inner_array_no_comma.json: -------------------------------------------------------------------------------- 1 | ["###"["###"]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_number_and_several_commas.json: -------------------------------------------------------------------------------- 1 | ["###",,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_invalid-negative-real.json: -------------------------------------------------------------------------------- 1 | ["###"foo] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_minus_infinity.json: -------------------------------------------------------------------------------- 1 | ["###"Infini"&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_neg_int_starting_with_zero.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_neg_real_without_int_part.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_neg_with_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | ["###"x] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_comma_instead_of_colon.json: -------------------------------------------------------------------------------- 1 | {"x", null} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_trailing_comment.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}/**/ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}# -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_1_surrogate_then_escape_u.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_1_surrogate_then_escape_u1.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_1_surrogate_then_escape_u1x.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_invalid-utf-8-in-escape.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_invalid_utf8_after_escape.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_single_string_no_double_quotes.json: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_array_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | ["###"]x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_null-byte-outside-string.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_object_unclosed_no_value.json: -------------------------------------------------------------------------------- 1 | {"": -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_array_open_string.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unclosed_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_number_double_close_to_zero.json: -------------------------------------------------------------------------------- 1 | ["###"] 2 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_string_unicode.json: -------------------------------------------------------------------------------- 1 | {"title":"***" } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_1_2_3_bytes_UTF-8_sequences.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_accepted_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_accepted_surrogate_pairs.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_escaped_control_character.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_last_surrogates_1_and_2.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_nonCharacterInUTF-8_U+FFFF.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicodeEscapedBackslash.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+10FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+1FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_structure_trailing_newline.json: -------------------------------------------------------------------------------- 1 | ["***"] 2 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_pos_double_huge_exp.json: -------------------------------------------------------------------------------- 1 | [1.5e+9999] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_real_pos_overflow.json: -------------------------------------------------------------------------------- 1 | [123123e100000] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_real_underflow.json: -------------------------------------------------------------------------------- 1 | [123e-10000000] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_invalid_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\ud800abc"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_lone_second_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\uDFAA"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_colon_instead_of_comma.json: -------------------------------------------------------------------------------- 1 | ["": 1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_items_separated_by_semicolon.json: -------------------------------------------------------------------------------- 1 | [1:2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_number_and_several_commas.json: -------------------------------------------------------------------------------- 1 | [1,,] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_unclosed_with_object_inside.json: -------------------------------------------------------------------------------- 1 | [{} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_U+FF11_fullwidth_digit_one.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_neg_int_starting_with_zero.json: -------------------------------------------------------------------------------- 1 | [-012] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_neg_real_without_int_part.json: -------------------------------------------------------------------------------- 1 | [-.123] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_neg_with_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | [-1x] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_real_without_fractional_part.json: -------------------------------------------------------------------------------- 1 | [1.] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_trailing_comment.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**/ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}# -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_accentuated_char_no_quotes.json: -------------------------------------------------------------------------------- 1 | [é] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_escaped_backslash_bad.json: -------------------------------------------------------------------------------- 1 | ["\\\"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_invalid_unicode_escape.json: -------------------------------------------------------------------------------- 1 | ["\uqqqq"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_no_quotes_with_bad_escape.json: -------------------------------------------------------------------------------- 1 | [\n] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_single_quote.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_angle_bracket_null.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_array_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [1]x -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_ascii-unicode-identifier.json: -------------------------------------------------------------------------------- 1 | aå -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_null-byte-outside-string.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_object_unclosed_no_value.json: -------------------------------------------------------------------------------- 1 | {"": -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_array_open_string.json: -------------------------------------------------------------------------------- 1 | ["a -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object_close_array.json: -------------------------------------------------------------------------------- 1 | {] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object_open_string.json: -------------------------------------------------------------------------------- 1 | {"a -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_open.json: -------------------------------------------------------------------------------- 1 | ["\{["\{["\{["\{ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unclosed_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"asd" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_heterogeneous.json: -------------------------------------------------------------------------------- 1 | [null, 1, "1", {}] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_capital_e_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1E-2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_capital_e_pos_exp.json: -------------------------------------------------------------------------------- 1 | [1E+2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_duplicated_key.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"c"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_backslash_doublequotes.json: -------------------------------------------------------------------------------- 1 | ["\""] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_escaped_noncharacter.json: -------------------------------------------------------------------------------- 1 | ["\uFFFF"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_nbsp_uescaped.json: -------------------------------------------------------------------------------- 1 | ["new\u00A0line"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_nonCharacterInUTF-8_U+FFFF.json: -------------------------------------------------------------------------------- 1 | ["￿"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+FDD0_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFDD0"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFFFE"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_structure_trailing_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] 2 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_object_key_lone_2nd_surrogate.json: -------------------------------------------------------------------------------- 1 | {"\uDFAA":"###"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_1st_surrogate_but_2nd_missing.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_1st_valid_surrogate_2nd_invalid.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_overlong_sequence_6_bytes_null.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_colon_instead_of_comma.json: -------------------------------------------------------------------------------- 1 | ["***": "###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_spaces_vertical_tab_formfeed.json: -------------------------------------------------------------------------------- 1 | ["***"\"&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_real_without_fractional_part.json: -------------------------------------------------------------------------------- 1 | ["###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_key_with_single_quotes.json: -------------------------------------------------------------------------------- 1 | {key: 'value'} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_repeated_null_null.json: -------------------------------------------------------------------------------- 1 | {null:null,null:null} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_trailing_comment_open.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}/**// -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_incomplete_escaped_character.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_array_with_extra_array_close.json: -------------------------------------------------------------------------------- 1 | ["###"]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_array_with_unclosed_string.json: -------------------------------------------------------------------------------- 1 | ["***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_number_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | "###"@ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_object_followed_by_closing_object.json: -------------------------------------------------------------------------------- 1 | {}} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_whitespace_U+2060_word_joiner.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_heterogeneous.json: -------------------------------------------------------------------------------- 1 | [null, "###", "***", {}] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_duplicated_key.json: -------------------------------------------------------------------------------- 1 | {"a":"***","a":"***"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_with_newlines.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": "***" 3 | } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_backslash_and_u_escaped_zero.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_in_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [ "***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_nonCharacterInUTF-8_U+10FFFF.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_reservedCharacterInUTF-8_U+1BFFF.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_U+2064_invisible_plus.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_unicode_escaped_double_quote.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_double_huge_neg_exp.json: -------------------------------------------------------------------------------- 1 | [123.456e-789] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_real_neg_overflow.json: -------------------------------------------------------------------------------- 1 | [-123123e100000] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_object_key_lone_2nd_surrogate.json: -------------------------------------------------------------------------------- 1 | {"\uDFAA":0} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_incomplete_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["\uDd1ea"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_invalid_lonely_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\ud800"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_newlines_unclosed.json: -------------------------------------------------------------------------------- 1 | ["a", 2 | 4 3 | ,1, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_spaces_vertical_tab_formfeed.json: -------------------------------------------------------------------------------- 1 | [" a"\f] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_invalid-negative-real.json: -------------------------------------------------------------------------------- 1 | [-123.123foo] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_comma_instead_of_colon.json: -------------------------------------------------------------------------------- 1 | {"x", null} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_key_with_single_quotes.json: -------------------------------------------------------------------------------- 1 | {key: 'value'} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_several_trailing_commas.json: -------------------------------------------------------------------------------- 1 | {"id":0,,,,,} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_trailing_comment_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**// -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_two_commas_in_a_row.json: -------------------------------------------------------------------------------- 1 | {"a":"b",,"c":"d"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_1_surrogate_then_escape.json: -------------------------------------------------------------------------------- 1 | ["\uD800\"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_1_surrogate_then_escape_u.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_incomplete_escaped_character.json: -------------------------------------------------------------------------------- 1 | ["\u00A"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_incomplete_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_single_string_no_double_quotes.json: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_unescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new 2 | line"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_array_with_extra_array_close.json: -------------------------------------------------------------------------------- 1 | [1]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_array_with_unclosed_string.json: -------------------------------------------------------------------------------- 1 | ["asd] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_number_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | 2@ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_whitespace_U+2060_word_joiner.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_array_with_several_null.json: -------------------------------------------------------------------------------- 1 | [1,null,null,null,2] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_real_fraction_exponent.json: -------------------------------------------------------------------------------- 1 | [123.456e78] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_with_newlines.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": "b" 3 | } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_allowed_escapes.json: -------------------------------------------------------------------------------- 1 | ["\"\\\/\b\f\n\r\t"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_escaped_control_character.json: -------------------------------------------------------------------------------- 1 | ["\u0012"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_in_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [ "asd"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_nonCharacterInUTF-8_U+10FFFF.json: -------------------------------------------------------------------------------- 1 | ["􏿿"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_uEscape.json: -------------------------------------------------------------------------------- 1 | ["\u0061\u30af\u30EA\u30b9"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_uescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new\u000Aline"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicodeEscapedBackslash.json: -------------------------------------------------------------------------------- 1 | ["\u005C"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_incomplete_surrogate_and_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_incomplete_surrogates_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_items_separated_by_semicolon.json: -------------------------------------------------------------------------------- 1 | ["###":"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_minus_sign_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | ["###"foo] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_several_trailing_commas.json: -------------------------------------------------------------------------------- 1 | {"id":"###",,,,,} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_trailing_comment_slash_open.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}// -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_two_commas_in_a_row.json: -------------------------------------------------------------------------------- 1 | {"a":"***",,"c"***"d"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_with_single_string.json: -------------------------------------------------------------------------------- 1 | { "foo" : "***", "a" } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_incomplete_surrogate_escape_invalid.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_string_leading_uescaped_thinspace.json: -------------------------------------------------------------------------------- 1 | [\u"###""asd"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_open_object_string_with_apostrophes.json: -------------------------------------------------------------------------------- 1 | {'a' -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_uescaped_LF_before_string.json: -------------------------------------------------------------------------------- 1 | [\u"###"A"***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unclosed_array_partial_null.json: -------------------------------------------------------------------------------- 1 | [ "&&&", nul -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_array_with_several_null.json: -------------------------------------------------------------------------------- 1 | ["###",null,null,null,"###"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_escaped_null_in_key.json: -------------------------------------------------------------------------------- 1 | {"foo\u0000bar": "###"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_too_big_pos_int.json: -------------------------------------------------------------------------------- 1 | [100000000000000000000] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_1st_surrogate_but_2nd_missing.json: -------------------------------------------------------------------------------- 1 | ["\uDADA"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_unclosed_with_new_lines.json: -------------------------------------------------------------------------------- 1 | [1, 2 | 1 3 | ,1 -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_minus_sign_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [-foo] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_with_alpha_char.json: -------------------------------------------------------------------------------- 1 | [1.8011670033376514H-308] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_repeated_null_null.json: -------------------------------------------------------------------------------- 1 | {null:null,null:null} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_trailing_comment_slash_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}// -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_with_single_string.json: -------------------------------------------------------------------------------- 1 | { "foo" : "bar", "a" } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_1_surrogate_then_escape_u1.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_1_surrogate_then_escape_u1x.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1x"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_leading_uescaped_thinspace.json: -------------------------------------------------------------------------------- 1 | [\u0020"asd"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_object_followed_by_closing_object.json: -------------------------------------------------------------------------------- 1 | {}} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_object_with_comment.json: -------------------------------------------------------------------------------- 1 | {"a":/*comment*/"b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_open_object_string_with_apostrophes.json: -------------------------------------------------------------------------------- 1 | {'a' -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_uescaped_LF_before_string.json: -------------------------------------------------------------------------------- 1 | [\u000A""] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unclosed_array_partial_null.json: -------------------------------------------------------------------------------- 1 | [ false, nul -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_duplicated_key_and_value.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"b"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_escaped_null_in_key.json: -------------------------------------------------------------------------------- 1 | {"foo\u0000bar": 42} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_accepted_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["\uD801\udc37"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_backslash_and_u_escaped_zero.json: -------------------------------------------------------------------------------- 1 | ["\\u0000"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_last_surrogates_1_and_2.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFF"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_reservedCharacterInUTF-8_U+1BFFF.json: -------------------------------------------------------------------------------- 1 | ["𛿿"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+10FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFE"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+1FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uD83F\uDFFE"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json: -------------------------------------------------------------------------------- 1 | ["\u200B"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_U+2064_invisible_plus.json: -------------------------------------------------------------------------------- 1 | ["\u2064"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_unicode_escaped_double_quote.json: -------------------------------------------------------------------------------- 1 | ["\u0022"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_newlines_unclosed.json: -------------------------------------------------------------------------------- 1 | ["***", 2 | "###" 3 | ,"###", -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_comma_instead_of_closing_brace.json: -------------------------------------------------------------------------------- 1 | {"x": "&&&", -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_object_with_comment.json: -------------------------------------------------------------------------------- 1 | {"a":/*comment*/"b"***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a": "&&&"} "***" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unclosed_array_unfinished_false.json: -------------------------------------------------------------------------------- 1 | [ "&&&", "&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_unclosed_array_unfinished_true.json: -------------------------------------------------------------------------------- 1 | [ "&&&", "&&&" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_duplicated_key_and_value.json: -------------------------------------------------------------------------------- 1 | {"a":"***","a":"***"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_extreme_numbers.json: -------------------------------------------------------------------------------- 1 | { "min": "###", "max": "###" } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_object_long_strings.json: -------------------------------------------------------------------------------- 1 | {"x":[{"id": "***"}], "id": "***"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json: -------------------------------------------------------------------------------- 1 | ["***"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_1st_valid_surrogate_2nd_invalid.json: -------------------------------------------------------------------------------- 1 | ["\uD888\u1234"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_inverted_surrogates_U+1D11E.json: -------------------------------------------------------------------------------- 1 | ["\uDd1e\uD834"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_comma_instead_of_closing_brace.json: -------------------------------------------------------------------------------- 1 | {"x": true, -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a": true} "x" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unclosed_array_unfinished_false.json: -------------------------------------------------------------------------------- 1 | [ true, fals -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_unclosed_array_unfinished_true.json: -------------------------------------------------------------------------------- 1 | [ false, tru -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_unclosed_with_new_lines.json: -------------------------------------------------------------------------------- 1 | ["###", 2 | "###" 3 | ,"###" -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_non_string_key_but_huge_number_instead.json: -------------------------------------------------------------------------------- 1 | {9999E9999:1} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_trailing_comment_slash_open_incomplete.json: -------------------------------------------------------------------------------- 1 | {"a":"***"}/ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_too_big_neg_int.json: -------------------------------------------------------------------------------- 1 | [-123123123123123123123123123123] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_incomplete_surrogate_and_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\n"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_incomplete_surrogates_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\uD800\n"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_non_string_key_but_huge_number_instead.json: -------------------------------------------------------------------------------- 1 | {9999E9999:1} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_trailing_comment_slash_open_incomplete.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/ -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_extreme_numbers.json: -------------------------------------------------------------------------------- 1 | { "min": -1.0e+28, "max": 1.0e+28 } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_1_2_3_bytes_UTF-8_sequences.json: -------------------------------------------------------------------------------- 1 | ["\u0060\u012a\u12AB"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_accepted_surrogate_pairs.json: -------------------------------------------------------------------------------- 1 | ["\ud83d\ude39\ud83d\udc8d"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_incomplete_surrogate_escape_invalid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\uD800\x"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd1e"] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_very_big_negative_int.json: -------------------------------------------------------------------------------- 1 | [-237462374673276894279832749832423479823246327846] -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_number_double_close_to_zero.json: -------------------------------------------------------------------------------- 1 | [-0.000000000000000000000000000000000000000000000000000000000000000000000000000001] 2 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_array_invalid_utf8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_array_a_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_array_a_invalid_utf8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_iso_latin_1.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_iso_latin_1.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_array_invalid_utf8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_long_strings.json: -------------------------------------------------------------------------------- 1 | {"x":[{"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_single_eacute.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_structure_single_eacute.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_invalid_utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_invalid_utf-8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_utf16BE_no_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_utf16BE_no_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_utf16LE_no_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_utf16LE_no_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_array_a_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_array_a_invalid_utf8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/y_object_string_unicode.json: -------------------------------------------------------------------------------- 1 | {"title":"\u041f\u043e\u043b\u0442\u043e\u0440\u0430 \u0417\u0435\u043c\u043b\u0435\u043a\u043e\u043f\u0430" } -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_string_UTF-16LE_with_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/i_string_UTF-16LE_with_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_truncated-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_truncated-utf-8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_single_eacute.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_structure_single_eacute.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-int.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_lone-invalid-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_structure_lone-invalid-utf-8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_UTF-16LE_with_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_UTF-16LE_with_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_structure_incomplete_UTF8_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_structure_incomplete_UTF8_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_UTF8_surrogate_U+D800.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_UTF8_surrogate_U+D800.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_not_in_unicode_range.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_not_in_unicode_range.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-int.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_lone-invalid-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_structure_lone-invalid-utf-8.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-exponent.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-exponent.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_number_huge_exp.json: -------------------------------------------------------------------------------- 1 | [0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_UTF-8_invalid_sequence.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_UTF-8_invalid_sequence.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_invalid-utf-8-in-escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_string_invalid-utf-8-in-escape.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_structure_incomplete_UTF8_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_structure_incomplete_UTF8_BOM.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-bigger-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_number_invalid-utf-8-in-bigger-int.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_overlong_sequence_2_bytes.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_overlong_sequence_2_bytes.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_overlong_sequence_6_bytes.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_overlong_sequence_6_bytes.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-exponent.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-exponent.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_string_invalid_utf8_after_escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_string_invalid_utf8_after_escape.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_number_real_with_invalid_utf8_after_e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_number_real_with_invalid_utf8_after_e.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_lone_utf8_continuation_byte.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_lone_utf8_continuation_byte.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-bigger-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_number_invalid-utf-8-in-bigger-int.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_string_overlong_sequence_6_bytes_null.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/i_string_overlong_sequence_6_bytes_null.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_number_real_with_invalid_utf8_after_e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_number_real_with_invalid_utf8_after_e.json -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/n_object_lone_continuation_byte_in_key_and_trailing_comma.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/masked/n_object_lone_continuation_byte_in_key_and_trailing_comma.json -------------------------------------------------------------------------------- /src/jmh/benchmark-history/README.md: -------------------------------------------------------------------------------- 1 | ### Benchmark history 2 | 3 | To prevent performance regressions, we keep track of changes in JMH benchmarks (10 s warmup, 10s average time) after each commit that could impact the performance of the masker. -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains internal utilities. 3 | */ 4 | @NullMarked 5 | package dev.blaauwendraad.masker.json.util; 6 | 7 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/n_object_lone_continuation_byte_in_key_and_trailing_comma.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Breus/json-masker/HEAD/src/test/JSONTestSuite/original/n_object_lone_continuation_byte_in_key_and_trailing_comma.json -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/path/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains internal configuration for the JSONPath support. 3 | */ 4 | @NullMarked 5 | package dev.blaauwendraad.masker.json.path; 6 | 7 | import org.jspecify.annotations.NullMarked; 8 | -------------------------------------------------------------------------------- /adr/_template.md: -------------------------------------------------------------------------------- 1 | # . 2 | 3 | Date: <current-date> 4 | 5 | ## Status 6 | 7 | Accepted | Draft | Deprecated | Superseded by <link-to-new-adr> 8 | 9 | ## Context 10 | 11 | We have options... 12 | 13 | ## Decision 14 | 15 | We decide to do X... 16 | 17 | ## Consequences 18 | 19 | Therefore Y... -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains configuration and builders for creating a {@link dev.blaauwendraad.masker.json.JsonMasker} 3 | * instance 4 | */ 5 | @NullMarked 6 | package dev.blaauwendraad.masker.json.config; 7 | 8 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module dev.blaauwendraad.masker.json { 2 | requires java.base; 3 | // https://github.com/ben-manes/caffeine/issues/535#issuecomment-854879514 4 | requires static org.jspecify; 5 | 6 | exports dev.blaauwendraad.masker.json; 7 | exports dev.blaauwendraad.masker.json.config; 8 | exports dev.blaauwendraad.masker.json.path; 9 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IntelliJ settings 2 | .idea 3 | 4 | # MacOS file system 5 | .DS_Store 6 | 7 | # Build files 8 | **/build/ 9 | !src/**/build/ 10 | out 11 | 12 | # Java 13 | *.class 14 | 15 | # Java archives 16 | *.jar 17 | *.war 18 | *.ear 19 | 20 | # Gradle 21 | .gradle 22 | .gradletasknamecache 23 | gradle-app.setting 24 | 25 | 26 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 27 | !gradle-wrapper.jar 28 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/config/JsonMaskingConfigTestUtil.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.config; 2 | 3 | /** 4 | * Utility class to configure internal configuration of JsonMaskingConfig 5 | */ 6 | public final class JsonMaskingConfigTestUtil { 7 | public static void setBufferSize(JsonMaskingConfig jsonMaskingConfig, int bufferSize) { 8 | jsonMaskingConfig.bufferSize = bufferSize; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/JsonMaskerTestInstance.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | public record JsonMaskerTestInstance( 4 | String input, 5 | String expectedOutput, 6 | JsonMasker jsonMasker 7 | ) { 8 | @Override 9 | public String toString() { 10 | return jsonMasker.getClass().getSimpleName() + ": input='" + input + '\'' + 11 | ", expectedOutput='" + expectedOutput + '\''; 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains the {@link dev.blaauwendraad.masker.json.JsonMasker}, main entrypoint for masking the JSON. 3 | * Additionally, the package contains {@link dev.blaauwendraad.masker.json.ValueMasker} for low-level masking 4 | * customization and {@link dev.blaauwendraad.masker.json.ValueMaskers} for out-of-the-box maskers. 5 | */ 6 | @NullMarked 7 | package dev.blaauwendraad.masker.json; 8 | 9 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gradle" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | assignees: 8 | - "Breus" 9 | reviewers: 10 | - "Breus" 11 | - package-ecosystem: "github-actions" 12 | directory: "/" 13 | schedule: 14 | interval: "monthly" 15 | assignees: 16 | - "Breus" 17 | reviewers: 18 | - "Breus" 19 | labels: 20 | - "dependencies" 21 | - "automerge" 22 | pull-request-branch-name: 23 | separator: "-" 24 | commit-message: 25 | prefix: "deps" 26 | -------------------------------------------------------------------------------- /src/main/java17/dev/blaauwendraad/masker/json/util/AsciiJsonUtil.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.util; 2 | 3 | public final class AsciiJsonUtil { 4 | 5 | private AsciiJsonUtil() { /* don't instantiate */ } 6 | 7 | public static boolean isWhiteSpace(byte utf8Character) { 8 | return switch (utf8Character) { 9 | case '\n', '\t', '\r', ' ' -> true; 10 | default -> false; 11 | }; 12 | } 13 | 14 | public static boolean isNumericCharacter(byte utf8Character) { 15 | return switch (utf8Character) { 16 | case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '+', '.', 'e', 'E' -> true; 17 | default -> false; 18 | }; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/util/FuzzingDurationUtil.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.util; 2 | 3 | import java.time.Duration; 4 | 5 | public class FuzzingDurationUtil { 6 | public static final Duration TOTAL_TEST_DURATION_SECONDS = Duration.ofSeconds(isCi() ? 300 : 30); 7 | 8 | private static boolean isCi() { 9 | return System.getenv("CI") != null; 10 | } 11 | 12 | /** 13 | * Determines time limit for an individual test so that whole tests suite executes in either 30 seconds (local) 14 | * or 5 minutes (CI) 15 | */ 16 | public static long determineTestTimeLimit(long numberOfTests) { 17 | return TOTAL_TEST_DURATION_SECONDS.toMillis() / numberOfTests; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/InvalidJsonException.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | /** 4 | * Calling any of the mask methods of the {@link JsonMasker} can result in two cases: 5 | * 6 | * <ol> 7 | * <li>In case valid JSON was provided, valid JSON is returned according to the provided masking 8 | * configurations 9 | * <li>In case invalid JSON was provided, the exception defined in this class is thrown 10 | * </ol> 11 | */ 12 | public class InvalidJsonException extends RuntimeException { 13 | public InvalidJsonException(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | public InvalidJsonException(String message) { 18 | super(message); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/update-gradle-wrapper.yml: -------------------------------------------------------------------------------- 1 | name: Update Gradle Wrapper 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * Mon" 6 | workflow_dispatch: 7 | 8 | jobs: 9 | update-gradle-wrapper: 10 | if: ${{ github.repository == 'Breus/json-masker' }} 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v6 14 | 15 | - name: Setup JDK 17 16 | uses: actions/setup-java@v5 17 | with: 18 | java-version: '17' 19 | distribution: 'temurin' 20 | cache: 'gradle' 21 | 22 | - uses: gradle-update/update-gradle-wrapper-action@v2 23 | with: 24 | repo-token: ${{ secrets.UPDATE_GRADLE_WRAPPER_PAT }} 25 | labels: dependencies 26 | 27 | - uses: gradle/actions/wrapper-validation@v5 -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/EmptyKeyTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class EmptyKeyTest { 11 | @ParameterizedTest 12 | @MethodSource("emptyKeyTestFile") 13 | void emptyKey(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> emptyKeyTestFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-empty-key.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/JsonPathLookupTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | class JsonPathLookupTest { 11 | @ParameterizedTest 12 | @MethodSource("jsonPathFile") 13 | void lookupTestJsonPaths(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> jsonPathFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-json-path.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/RecurringKeyTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | class RecurringKeyTest { 11 | @ParameterizedTest 12 | @MethodSource("recurringKeyFile") 13 | void recurringKey(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> recurringKeyFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-recurring-key.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/jmh/benchmark-history/2022-06-09.md: -------------------------------------------------------------------------------- 1 | - CPU: Apple Macbook Pro M1, 2020 2 | 3 | ```text 4 | Benchmark Mode Cnt Score Error Units 5 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysLargeJson avgt 2649,220 ns/op 6 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysSmallJson avgt 246,187 ns/op 7 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysLargeJson avgt 260032,673 ns/op 8 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysSmallJson avgt 15819,945 ns/op 9 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysLargeJson avgt 142586,845 ns/op 10 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysSmallJson avgt 3156,930 ns/op 11 | ``` 12 | -------------------------------------------------------------------------------- /src/jmh/benchmark-history/2022-07-02.md: -------------------------------------------------------------------------------- 1 | - CPU: Apple Macbook Pro M1, 2020 2 | 3 | ```text 4 | Benchmark Mode Cnt Score Error Units 5 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysLargeJson avgt 2741,496 ns/op 6 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysSmallJson avgt 153,333 ns/op 7 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysLargeJson avgt 259726,763 ns/op 8 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysSmallJson avgt 14396,989 ns/op 9 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysLargeJson avgt 146207,944 ns/op 10 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysSmallJson avgt 3102,921 ns/op 11 | ``` 12 | -------------------------------------------------------------------------------- /src/jmh/benchmark-history/2022-07-12.md: -------------------------------------------------------------------------------- 1 | - CPU: Apple Macbook Pro M1, 2020 2 | 3 | ```text 4 | Benchmark Mode Cnt Score Error Units 5 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysLargeJson avgt 2512,185 ns/op 6 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysSmallJson avgt 165,912 ns/op 7 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysLargeJson avgt 262763,770 ns/op 8 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysSmallJson avgt 14650,831 ns/op 9 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysLargeJson avgt 142375,488 ns/op 10 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysSmallJson avgt 3125,639 ns/op 11 | ``` 12 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/NumberMaskingTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | class NumberMaskingTest { 11 | @ParameterizedTest 12 | @MethodSource("numberMaskingFile") 13 | void numberMasking(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> numberMaskingFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-number-values.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/test-case-sensitivity.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "maskMe" 6 | ], 7 | "caseSensitiveTargetKeys": true 8 | }, 9 | "input": { 10 | "someKey": { 11 | "maskme": "value", 12 | "maskMe": "value" 13 | } 14 | }, 15 | "expectedOutput": { 16 | "someKey": { 17 | "maskme": "value", 18 | "maskMe": "***" 19 | } 20 | } 21 | }, 22 | { 23 | "maskingConfig": { 24 | "maskKeys": [ 25 | "maskMe" 26 | ] 27 | }, 28 | "input": { 29 | "someKey": { 30 | "maskme": "value", 31 | "maskMe": "value" 32 | } 33 | }, 34 | "expectedOutput": { 35 | "someKey": { 36 | "maskme": "***", 37 | "maskMe": "***" 38 | } 39 | } 40 | } 41 | ] 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MaskArrayValuesTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class MaskArrayValuesTest { 11 | @ParameterizedTest 12 | @MethodSource("arrayValuesFile") 13 | void arrayValues(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> arrayValuesFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-masking-array-values.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MaskObjectValuesTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | class MaskObjectValuesTest { 11 | @ParameterizedTest 12 | @MethodSource("nestedObjectFile") 13 | void multiTargetKey(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> nestedObjectFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-masking-object-values.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/test-recurring-key.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "someKey", 6 | "someKey2" 7 | ] 8 | }, 9 | "input": { 10 | "someKey3": { 11 | "someKey": "hello", 12 | "someKey2": { 13 | "someKey": "hi" 14 | } 15 | }, 16 | "someKey": "hell1o" 17 | }, 18 | "expectedOutput": { 19 | "someKey3": { 20 | "someKey": "***", 21 | "someKey2": { 22 | "someKey": "***" 23 | } 24 | }, 25 | "someKey": "***" 26 | } 27 | }, 28 | { 29 | "maskingConfig": { 30 | "maskKeys": [ 31 | "a" 32 | ] 33 | }, 34 | "input": { 35 | "a": { 36 | "a": "g\"" 37 | } 38 | }, 39 | "expectedOutput": { 40 | "a": { 41 | "a": "***" 42 | } 43 | } 44 | } 45 | ] -------------------------------------------------------------------------------- /src/jmh/benchmark-history/2022-09-11.md: -------------------------------------------------------------------------------- 1 | - CPU: Apple Macbook Pro M1, 2020 2 | - Java: 17.0.7 3 | 4 | ```text 5 | Benchmark Mode Cnt Score Error Units 6 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysLargeJson avgt 2560,033 ns/op 7 | JsonMaskMultipleTargetKeysBenchmark.keyContainsMaskMultiKeysSmallJson avgt 156,414 ns/op 8 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysLargeJson avgt 258476,113 ns/op 9 | JsonMaskMultipleTargetKeysBenchmark.loopMaskMultipleKeysSmallJson avgt 14488,738 ns/op 10 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysLargeJson avgt 141392,930 ns/op 11 | JsonMaskMultipleTargetKeysBenchmark.parseAndMaskMultiKeysSmallJson avgt 3079,517 ns/op 12 | ``` 13 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MultiTargetKeyTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class MultiTargetKeyTest { 11 | @ParameterizedTest 12 | @MethodSource("multiTargetKeyFile") 13 | void multiTargetKey(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> multiTargetKeyFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-multiple-target-keys.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/ColonInKeyOrValueTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | class ColonInKeyOrValueTest { 11 | 12 | @ParameterizedTest 13 | @MethodSource("testContainsColonFile") 14 | void containsColon(JsonMaskerTestInstance testInstance) { 15 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 16 | testInstance.expectedOutput()); 17 | } 18 | 19 | private static Stream<JsonMaskerTestInstance> testContainsColonFile() throws IOException { 20 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-contains-colon.json").stream(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/PreserveLengthTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class PreserveLengthTest { 11 | @ParameterizedTest 12 | @MethodSource("lengthObfuscationFile") 13 | void lengthObfuscation(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), 15 | testInstance.input(), testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> lengthObfuscationFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-preserve-length.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/EscapedCharactersTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class EscapedCharactersTest { 11 | @ParameterizedTest 12 | @MethodSource("escapedCharactersFile") 13 | void escapedCharacters(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> escapedCharactersFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-escaped-characters.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/TargetKeyCaseSensitivityTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class TargetKeyCaseSensitivityTest { 11 | @ParameterizedTest 12 | @MethodSource("caseSensitivityFile") 13 | void caseSensitivityInTargetKeys(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> caseSensitivityFile() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-case-sensitivity.json").stream(); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MaskObjectInNonMaskedArrayTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import org.junit.jupiter.params.ParameterizedTest; 4 | import org.junit.jupiter.params.provider.MethodSource; 5 | 6 | import java.io.IOException; 7 | import java.util.stream.Stream; 8 | 9 | 10 | final class MaskObjectInNonMaskedArrayTest { 11 | @ParameterizedTest 12 | @MethodSource("objectInNonMaskedArrayValues") 13 | void maskObjectInNonMaskedArray(JsonMaskerTestInstance testInstance) { 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 15 | testInstance.expectedOutput()); 16 | } 17 | 18 | private static Stream<JsonMaskerTestInstance> objectInNonMaskedArrayValues() throws IOException { 19 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-object-in-non-masked-array.json").stream(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/JSONTestSuite/masked/i_structure_500_nested_arrays.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/test/JSONTestSuite/original/i_structure_500_nested_arrays.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/path/JsonPathTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.path; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | 6 | class JsonPathTest { 7 | 8 | @Test 9 | void getLastSegment() { 10 | JsonPath jsonPath = new JsonPath(new String[]{"a", "b"}); 11 | Assertions.assertEquals("b", jsonPath.getQueryArgument()); 12 | } 13 | 14 | @Test 15 | void getLastSegmentForEmptyJsonPath() { 16 | JsonPath jsonPath = new JsonPath(new String[]{}); 17 | Assertions.assertNull(jsonPath.getQueryArgument()); 18 | } 19 | 20 | @Test 21 | void shouldCheckSegmentsOnEquals() { 22 | JsonPath a = new JsonPath(new String[]{"a", "b"}); 23 | JsonPath b = new JsonPath(new String[]{"a", "b"}); 24 | 25 | Assertions.assertEquals(a, a); 26 | Assertions.assertEquals(a, b); 27 | Assertions.assertEquals(a.hashCode(), b.hashCode()); 28 | Assertions.assertNotEquals(a, null); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/util/AsciiJsonUtil.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.util; 2 | 3 | public final class AsciiJsonUtil { 4 | 5 | private AsciiJsonUtil() { /* don't instantiate */ } 6 | 7 | public static boolean isWhiteSpace(byte utf8Character) { 8 | switch (utf8Character) { 9 | case '\n': 10 | case '\t': 11 | case '\r': 12 | case ' ': 13 | return true; 14 | default: 15 | return false; 16 | } 17 | } 18 | 19 | public static boolean isNumericCharacter(byte utf8Character) { 20 | switch (utf8Character) { 21 | case '0': 22 | case '1': 23 | case '2': 24 | case '3': 25 | case '4': 26 | case '5': 27 | case '6': 28 | case '7': 29 | case '8': 30 | case '9': 31 | case '-': 32 | case '+': 33 | case '.': 34 | case 'e': 35 | case 'E': 36 | return true; 37 | default: 38 | return false; 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2025 [Breus Blaauwendraad](https://github.com/Breus) & [Artur Havliukovskyi](https://github.com/gavlyukovskiy) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/PrettyPrintTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | import org.junit.jupiter.api.Test; 5 | import tools.jackson.databind.JsonNode; 6 | import tools.jackson.databind.json.JsonMapper; 7 | import tools.jackson.databind.node.JsonNodeFactory; 8 | import tools.jackson.databind.node.ObjectNode; 9 | 10 | import static org.assertj.core.api.Assertions.assertThat; 11 | 12 | class PrettyPrintTest { 13 | 14 | @Test 15 | void prettyPrintMaskingKeyContains() { 16 | ObjectNode objectNode = JsonNodeFactory.instance.objectNode().put("Test", "Value"); 17 | JsonNode jsonNode = JsonNodeFactory.instance.objectNode().set("Test1", objectNode); 18 | String prettyString = jsonNode.toPrettyString(); 19 | JsonMasker jsonMasker = new KeyContainsMasker(JsonMaskingConfig.builder().maskKeys("Test").build()); 20 | String mask = jsonMasker.mask(prettyString); 21 | assertThat(JsonMapper.builder() 22 | .build() 23 | .readValue(mask, JsonNode.class) 24 | .findValue("Test") 25 | .asString()).isEqualTo("***"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/DescriptiveValueMasker.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | /** 4 | * {@link DescriptiveValueMasker} provides the description of what the implementation does. 5 | * 6 | * <p>In order to keep the API concise, the {@link ValueMasker} only requires the implementation 7 | * code, but for debugging and tests, it's convenient to know how each JSON value is supposed to be 8 | * masked. 9 | * 10 | * <p>As a result, when {@link dev.blaauwendraad.masker.json.config.KeyMaskingConfig} is serialized, 11 | * we can see the configuration as {@code maskNumbersWith="###"} instead of 12 | * {@code maskNumbersWith=dev.blaauwendraad.masker.json.ValueMaskers$$Lambda$425/0x000000080022e890@1039bfc4} 13 | * 14 | * @see ValueMaskers#describe(String, T) 15 | */ 16 | final class DescriptiveValueMasker<T extends ValueMasker> implements ValueMasker.AnyValueMasker { 17 | private final String description; 18 | private final T delegate; 19 | 20 | DescriptiveValueMasker(String description, T delegate) { 21 | this.description = description; 22 | this.delegate = delegate; 23 | } 24 | 25 | @Override 26 | public void maskValue(ValueMaskerContext context) { 27 | delegate.maskValue(context); 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return description; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/util/JsonFormatter.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.util; 2 | 3 | import dev.blaauwendraad.masker.randomgen.InvalidJsonPrettyPrinter; 4 | import dev.blaauwendraad.masker.randomgen.RandomWhiteSpacePrettyPrinter; 5 | import tools.jackson.databind.JsonNode; 6 | import tools.jackson.databind.json.JsonMapper; 7 | 8 | public enum JsonFormatter { 9 | PRETTY, 10 | COMPACT, 11 | RANDOM_WHITESPACE, 12 | INVALID_JSON; 13 | 14 | private final static int MAX_NUMBER_OF_SPACES_TO_INJECT = 50; 15 | 16 | private static final JsonMapper RANDOM_WHITESPACE_JSON_MAPPER = JsonMapper.builder().defaultPrettyPrinter(new RandomWhiteSpacePrettyPrinter(JsonFormatter.MAX_NUMBER_OF_SPACES_TO_INJECT)).build(); 17 | private static final JsonMapper INVALID_JSON_MAPPER = JsonMapper.builder().defaultPrettyPrinter(new InvalidJsonPrettyPrinter()).build(); 18 | 19 | public String format(JsonNode jsonNode) { 20 | return switch (this) { 21 | case PRETTY -> jsonNode.toPrettyString(); 22 | case COMPACT -> jsonNode.toString(); 23 | case RANDOM_WHITESPACE -> RANDOM_WHITESPACE_JSON_MAPPER.writeValueAsString(jsonNode); 24 | case INVALID_JSON -> INVALID_JSON_MAPPER.writeValueAsString(jsonNode); 25 | }; 26 | } 27 | 28 | public boolean isValid() { 29 | return this != INVALID_JSON; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/test-preserve-length.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "maskMe" 6 | ], 7 | "maskStringCharactersWith": "*", 8 | "maskNumberDigitsWith": 8 9 | }, 10 | "input": { 11 | "maskMe": "#\f\ta", 12 | "(J": [ 13 | [ 14 | "l", 15 | 1.7931133E38 16 | ], 17 | null 18 | ], 19 | "š": [ 20 | 1.8640192E38, 21 | true 22 | ], 23 | "q\u0007": true 24 | }, 25 | "expectedOutput": { 26 | "maskMe": "****", 27 | "(J": [ 28 | [ 29 | "l", 30 | 1.7931133E38 31 | ], 32 | null 33 | ], 34 | "š": [ 35 | 1.8640192E38, 36 | true 37 | ], 38 | "q\u0007": true 39 | } 40 | }, 41 | { 42 | "maskingConfig": { 43 | "maskKeys": [ 44 | "stringKey", 45 | "numberKey", 46 | "booleanKey" 47 | ], 48 | "maskStringCharactersWith": "*", 49 | "maskNumberDigitsWith": 8 50 | }, 51 | "input": { 52 | "stringKey": "hello", 53 | "otherKey": null, 54 | "numberKey": 1234, 55 | "someKey2": 2, 56 | "booleanKey": false 57 | }, 58 | "expectedOutput": { 59 | "stringKey": "*****", 60 | "otherKey": null, 61 | "numberKey": 8888, 62 | "someKey2": 2, 63 | "booleanKey": "&&&" 64 | } 65 | } 66 | ] -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/path/JsonPath.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json.path; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | 5 | import java.util.Arrays; 6 | 7 | /** 8 | * The library represents a jsonpath as an array of segments. 9 | * See {@link JsonPathParser} for details. 10 | */ 11 | public final class JsonPath { 12 | private final String[] segments; 13 | 14 | public JsonPath(String[] segments) { 15 | this.segments = segments; 16 | } 17 | 18 | /** 19 | * The last segment of the jsonpath key is an actual target key. 20 | * 21 | * @return the last segment of the jsonpath key. 22 | */ 23 | @Nullable 24 | public String getQueryArgument() { 25 | return segments.length != 0 ? segments[segments.length - 1] : null; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return String.join(".", segments); 31 | } 32 | 33 | @Override 34 | public boolean equals(Object o) { 35 | if (this == o) { 36 | return true; 37 | } 38 | if (!(o instanceof JsonPath)) { 39 | return false; 40 | } 41 | JsonPath jsonPath = (JsonPath) o; 42 | return Arrays.equals(segments, jsonPath.segments); 43 | } 44 | 45 | @Override 46 | public int hashCode() { 47 | return Arrays.hashCode(segments); 48 | } 49 | 50 | public String[] segments() { 51 | return segments; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | jmh = "1.37" 3 | 4 | [libraries] 5 | assertj-core = { group = "org.assertj", name = "assertj-core", version = "3.27.6" } 6 | jspecify = { group = "org.jspecify", name = "jspecify", version = "1.0.0" } 7 | jackson-databind = { group = "tools.jackson.core", name = "jackson-databind", version = "3.0.3" } 8 | junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api" } 9 | junit-bom = { group = "org.junit", name = "junit-bom", version = "6.0.1" } 10 | junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" } 11 | junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params" } 12 | junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine" } 13 | jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" } 14 | jmh-generator-annproccesor = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" } 15 | nullaway = { group = "com.uber.nullaway", name = "nullaway", version = "0.12.10" } 16 | errorprone-core = { group = "com.google.errorprone", name = "error_prone_core", version = "2.42.0" } 17 | 18 | [plugins] 19 | jmh = { id = "me.champeau.jmh", version = "0.7.3" } 20 | nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" } 21 | test-logger = { id = "com.adarshr.test-logger", version = "4.0.0" } 22 | sonarqube = { id = "org.sonarqube", version = "7.1.0.6387" } 23 | errorprone = { id = "net.ltgt.errorprone", version = "4.3.0" } 24 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/AssumedLengthValuesTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | import org.junit.jupiter.api.Test; 5 | 6 | /** 7 | * The test suite covers masking of values whose length is assumed by the masker: "true", "false" and "null" 8 | */ 9 | class AssumedLengthValuesTest { 10 | @Test 11 | void shouldMaskConstantSizeValues() { 12 | JsonMaskingConfig config = JsonMaskingConfig.builder().maskKeys("mask").build(); 13 | JsonMasker jsonMasker = JsonMasker.getMasker(config); 14 | 15 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":false}", "{\"mask\":\"&&&\"}"); 16 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":true}", "{\"mask\":\"&&&\"}"); 17 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":null}", "{\"mask\":null}"); 18 | } 19 | @Test 20 | void shouldAllowConstantSizeValuesInMaskMode() { 21 | JsonMaskingConfig config = JsonMaskingConfig.builder().allowKeys("mask").build(); 22 | JsonMasker jsonMasker = JsonMasker.getMasker(config); 23 | 24 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":false}", "{\"mask\":false}"); 25 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":true}", "{\"mask\":true}"); 26 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, "{\"mask\":null}", "{\"mask\":null}"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/on-release-tag.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Tag & Release Workflow 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | release: 10 | if: ${{ github.repository == 'Breus/json-masker' }} 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v6 14 | 15 | - uses: actions/setup-java@v5 16 | with: 17 | java-version: '17' 18 | distribution: 'temurin' 19 | cache: 'gradle' 20 | 21 | - name: Get version from tag 22 | id: get-version 23 | shell: bash 24 | run: | 25 | version="${GITHUB_REF_NAME#v}" 26 | regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9]+)?$" 27 | if [[ $version =~ $regex ]]; then 28 | echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT 29 | else 30 | echo "Version $version is not a valid SemVer" 31 | exit 1 32 | fi 33 | 34 | - name: Build 35 | run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishToMavenLocal 36 | 37 | - name: Upload release artifacts to Sonatype 38 | env: 39 | SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }} 40 | SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} 41 | GPG_PRIV_KEY: ${{ secrets.GPG_PRIV_KEY }} 42 | GPG_PASS_PHRASE: ${{ secrets.GPG_PASS_PHRASE }} 43 | run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MaskAllKeysTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | import org.assertj.core.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.params.ParameterizedTest; 7 | import org.junit.jupiter.params.provider.MethodSource; 8 | 9 | import java.io.IOException; 10 | import java.util.Set; 11 | import java.util.stream.Stream; 12 | 13 | 14 | final class MaskAllKeysTest { 15 | @ParameterizedTest 16 | @MethodSource("testMaskAllKeys") 17 | void maskAllKeysFromFile(JsonMaskerTestInstance testInstance) { 18 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(testInstance.jsonMasker(), testInstance.input(), 19 | testInstance.expectedOutput()); 20 | } 21 | 22 | private static Stream<JsonMaskerTestInstance> testMaskAllKeys() throws IOException { 23 | return JsonMaskerTestUtil.getJsonMaskerTestInstancesFromFile("test-mask-all-keys.json").stream(); 24 | } 25 | 26 | @Test 27 | void maskAllKeys() { 28 | var jsonMasker = JsonMasker.getMasker(JsonMaskingConfig.builder().allowKeys(Set.of()).build()); 29 | Assertions.assertThat(jsonMasker.mask("{\"someKey\": 0}")).isEqualTo("{\"someKey\": \"###\"}"); 30 | } 31 | 32 | @Test 33 | void maskAllJsonPaths() { 34 | var jsonMasker = JsonMasker.getMasker(JsonMaskingConfig.builder().allowJsonPaths(Set.of()).build()); 35 | Assertions.assertThat(jsonMasker.mask("{\"someKey\": 0}")).isEqualTo("{\"someKey\": \"###\"}"); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/test/resources/test-empty-key.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "someKey", 6 | "" 7 | ] 8 | }, 9 | "input": { 10 | "w&EK": [ 11 | { 12 | "%SO": { 13 | "[": {}, 14 | "targetKey2": {}, 15 | "+BAU^s}d": { 16 | "targetKey1": "***", 17 | "": "y5dYloB", 18 | "targetKey2": "***", 19 | "wTMS_dT": "c", 20 | "$+feSlg!E": "yUInkY=", 21 | "\"L": "Mw;GdNc" 22 | }, 23 | "": "" 24 | } 25 | } 26 | ] 27 | }, 28 | "expectedOutput": { 29 | "w&EK": [ 30 | { 31 | "%SO": { 32 | "[": {}, 33 | "targetKey2": {}, 34 | "+BAU^s}d": { 35 | "targetKey1": "***", 36 | "": "***", 37 | "targetKey2": "***", 38 | "wTMS_dT": "c", 39 | "$+feSlg!E": "yUInkY=", 40 | "\"L": "Mw;GdNc" 41 | }, 42 | "": "***" 43 | } 44 | } 45 | ] 46 | } 47 | }, 48 | { 49 | "maskingConfig": { 50 | "maskKeys": [ 51 | "" 52 | ] 53 | }, 54 | "input": { 55 | "": 1 56 | }, 57 | "expectedOutput": { 58 | "": "###" 59 | } 60 | }, 61 | { 62 | "maskingConfig": { 63 | "maskKeys": [ 64 | "" 65 | ] 66 | }, 67 | "input": { 68 | "": true 69 | }, 70 | "expectedOutput": { 71 | "": "&&&" 72 | } 73 | } 74 | ] 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to json-masker 2 | 3 | We very much welcome your input! We want to make contributing to this project as easy and transparent as possible, whether it is: 4 | 5 | - Reporting a bug 6 | - Discussing additional features 7 | - Submitting a fix 8 | - Reporting a security vulnerability 9 | 10 | ## We develop with Github 11 | 12 | We use GitHub to host the code, have discussions about (additional) features, track issues, as well as accept pull requests. 13 | 14 | ## All code changes happen through pull requests 15 | 16 | To contribute to this project, please open a pull request as follows: 17 | 18 | 1. Create a fork of the repository and branch from the master branch 19 | 2. If you've added any new functionality, make sure to add full test coverage 20 | 3. If you've changed APIs, update the JavaDoc 21 | 4. Ensure the test suite passes 22 | 5. Make sure the line-length your code is 120 characters 23 | 6. Open your pull request on GitHub 24 | 25 | ## Any contributions you make will be under the MIT Software License 26 | 27 | In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern. 28 | 29 | ## Report bugs using Github's issues 30 | 31 | We use GitHub issues to track public bugs. Feel free to report a bug by [opening a new issue](https://github.com/Breus/json-masker/issues/new/choose). 32 | 33 | ## Writing a proper bug report 34 | 35 | Proper bug reports tend to have: 36 | 37 | - A quick summary and/or background 38 | - Steps to reproduce 39 | - Sample code, if possible 40 | - What you expected would happen 41 | - What actually happens 42 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) 43 | -------------------------------------------------------------------------------- /src/test/resources/test-object-in-non-masked-array.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "maskMe" 6 | ] 7 | }, 8 | "input": { 9 | "someKey": [ 10 | "hello", 11 | 123, 12 | { 13 | "maskMe": { 14 | "hello": "hi", 15 | "bye": { 16 | "cya": "adios" 17 | } 18 | } 19 | } 20 | ] 21 | }, 22 | "expectedOutput": { 23 | "someKey": [ 24 | "hello", 25 | 123, 26 | { 27 | "maskMe": { 28 | "hello": "***", 29 | "bye": { 30 | "cya": "***" 31 | } 32 | } 33 | } 34 | ] 35 | } 36 | }, 37 | { 38 | "maskingConfig": { 39 | "maskKeys": [ 40 | "maskMe" 41 | ] 42 | }, 43 | "input": { 44 | "someKey": [ 45 | "hello", 46 | 123, 47 | { 48 | "maskMe": { 49 | "hello": "hi", 50 | "bye": { 51 | "cya": [ 52 | "hello", 53 | 123, 54 | "bye", 55 | { 56 | "hello": "bye" 57 | } 58 | ] 59 | } 60 | } 61 | } 62 | ] 63 | }, 64 | "expectedOutput": { 65 | "someKey": [ 66 | "hello", 67 | 123, 68 | { 69 | "maskMe": { 70 | "hello": "***", 71 | "bye": { 72 | "cya": [ 73 | "***", 74 | "###", 75 | "***", 76 | { 77 | "hello": "***" 78 | } 79 | ] 80 | } 81 | } 82 | } 83 | ] 84 | } 85 | } 86 | ] 87 | -------------------------------------------------------------------------------- /src/test/resources/test-contains-colon.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "targetKey:1" 6 | ] 7 | }, 8 | "input": { 9 | "targetKey:1": { 10 | "yes": ":val:ue\\::", 11 | "someKey": { 12 | "\":\"": "\":\"" 13 | } 14 | } 15 | }, 16 | "expectedOutput": { 17 | "targetKey:1": { 18 | "yes": "***", 19 | "someKey": { 20 | "\":\"": "***" 21 | } 22 | } 23 | } 24 | }, 25 | { 26 | "maskingConfig": { 27 | "maskKeys": [ 28 | "targetKey:1" 29 | ] 30 | }, 31 | "input": { 32 | "targetKey:1": { 33 | "targetKey:1": ":val:ue\\::", 34 | "someKey": { 35 | "\":\"": "\":\"" 36 | }, 37 | "hello": [ 38 | ",:\",:", 39 | ",,\"::" 40 | ] 41 | } 42 | }, 43 | "expectedOutput": { 44 | "targetKey:1": { 45 | "targetKey:1": "***", 46 | "someKey": { 47 | "\":\"": "***" 48 | }, 49 | "hello": [ 50 | "***", 51 | "***" 52 | ] 53 | } 54 | } 55 | }, 56 | { 57 | "maskingConfig": { 58 | "maskKeys": [ 59 | "targetKey:1" 60 | ] 61 | }, 62 | "input": { 63 | "targetKey:1": { 64 | "targetKey:1": ":val:ue\\::" 65 | } 66 | }, 67 | "expectedOutput": { 68 | "targetKey:1": { 69 | "targetKey:1": "***" 70 | } 71 | } 72 | }, 73 | { 74 | "maskingConfig": { 75 | "maskKeys": [ 76 | "targetKey:1" 77 | ] 78 | }, 79 | "input": { 80 | "targetKey:1": { 81 | "targetKey:1": ":val:ue\\::", 82 | "hello": [ 83 | ",:,:\"", 84 | ",,::" 85 | ] 86 | } 87 | }, 88 | "expectedOutput": { 89 | "targetKey:1": { 90 | "targetKey:1": "***", 91 | "hello": [ 92 | "***", 93 | "***" 94 | ] 95 | } 96 | } 97 | }, 98 | { 99 | "maskingConfig": { 100 | "maskKeys": [ 101 | "targetKey:1" 102 | ] 103 | }, 104 | "input": "thisIsValidJson::", 105 | "expectedOutput": "thisIsValidJson::" 106 | } 107 | ] 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/test/resources/test-number-values.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "maskMe" 6 | ], 7 | "maskNumbersWith": 1 8 | }, 9 | "input": { 10 | "maskMe": 2 11 | }, 12 | "expectedOutput": { 13 | "maskMe": 1 14 | } 15 | }, 16 | { 17 | "maskingConfig": { 18 | "maskKeys": [ 19 | "someKey", 20 | "someKey2", 21 | "someKey4" 22 | ], 23 | "maskNumbersWith": 1111 24 | }, 25 | "input": { 26 | "someKey": "o", 27 | "someKey2": 123456 28 | }, 29 | "expectedOutput": { 30 | "someKey": "***", 31 | "someKey2": 1111 32 | } 33 | }, 34 | { 35 | "maskingConfig": { 36 | "maskKeys": [ 37 | "someKey", 38 | "someKey2", 39 | "someKey3" 40 | ], 41 | "maskNumbersWith": 8888 42 | }, 43 | "input": { 44 | "someKey": "hello", 45 | "someKey2": 0.12e+1, 46 | "someKey3": 12345 47 | }, 48 | "expectedOutput": { 49 | "someKey": "***", 50 | "someKey2": 8888, 51 | "someKey3": 8888 52 | } 53 | }, 54 | { 55 | "maskingConfig": { 56 | "maskKeys": [ 57 | "someKey", 58 | "someKey2", 59 | "someKey3" 60 | ], 61 | "maskNumberDigitsWith": 9 62 | }, 63 | "input": { 64 | "someKey": "hello", 65 | "someKey2": -0.12E-11, 66 | "someKey3": -0.5 67 | }, 68 | "expectedOutput": { 69 | "someKey": "***", 70 | "someKey2": 99999999, 71 | "someKey3": 9999 72 | } 73 | }, 74 | { 75 | "maskingConfig": { 76 | "maskKeys": [ 77 | "someKey", 78 | "someKey2", 79 | "someKey3" 80 | ], 81 | "maskNumberDigitsWith": 9 82 | }, 83 | "input": { 84 | "someKey": "hello", 85 | "someKey2": 123, 86 | "someKey3": 23 87 | }, 88 | "expectedOutput": { 89 | "someKey": "***", 90 | "someKey2": 999, 91 | "someKey3": 99 92 | } 93 | }, 94 | { 95 | "maskingConfig": { 96 | "maskKeys": [ 97 | "someKey", 98 | "someKey2", 99 | "someKey3" 100 | ], 101 | "maskNumbersWith": 0 102 | }, 103 | "input": { 104 | "someKey": "hello", 105 | "someKey2": -0.12E-1, 106 | "someKey3": -0.5 107 | }, 108 | "expectedOutput": { 109 | "someKey": "***", 110 | "someKey2": 0, 111 | "someKey3": 0 112 | } 113 | } 114 | ] -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/JsonMasker.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | 5 | import java.io.InputStream; 6 | import java.io.OutputStream; 7 | import java.io.UncheckedIOException; 8 | import java.nio.charset.StandardCharsets; 9 | import java.util.Set; 10 | 11 | /** 12 | * Masker that can be used to mask JSON objects and arrays. 13 | */ 14 | public interface JsonMasker { 15 | 16 | /** 17 | * Creates a default {@link JsonMasker} with the provided target key(s). 18 | * 19 | * @param targetKeys the key(s) to target 20 | * @return the {@link JsonMasker} instance 21 | */ 22 | static JsonMasker getMasker(Set<String> targetKeys) { 23 | return getMasker(JsonMaskingConfig.builder().maskKeys(targetKeys).build()); 24 | } 25 | 26 | /** 27 | * Creates a {@link JsonMasker} with the provided {@link JsonMaskingConfig}. 28 | * 29 | * @param maskingConfig the JSON masker configuration 30 | * @return a new {@link JsonMasker} instance corresponding to the provided {@link JsonMaskingConfig} 31 | */ 32 | static JsonMasker getMasker(JsonMaskingConfig maskingConfig) { 33 | return new KeyContainsMasker(maskingConfig); 34 | } 35 | 36 | /** 37 | * Masks the given JSON input and returns the masked output. 38 | * 39 | * @param input the JSON input as bytes 40 | * @return the masked JSON output as bytes 41 | * @throws InvalidJsonException in case invalid JSON input was provided 42 | */ 43 | byte[] mask(byte[] input); 44 | 45 | /** 46 | * Masks the given JSON input stream and writes the result into the output stream. 47 | * 48 | * @param inputStream the JSON input stream 49 | * @param outputStream masked JSON output stream 50 | * @throws InvalidJsonException in case invalid JSON input was provided 51 | * @throws UncheckedIOException if an I/O error occurs while reading from the input stream or writing to the output 52 | * stream 53 | */ 54 | void mask(InputStream inputStream, OutputStream outputStream); 55 | 56 | /** 57 | * Masks the given JSON input and returns the masked output. 58 | * 59 | * @param input the JSON input as String 60 | * @return the masked JSON output String 61 | * @throws InvalidJsonException in case invalid JSON input was provided 62 | */ 63 | default String mask(String input) { 64 | return new String(mask(input.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/dev/blaauwendraad/masker/json/ValueMasker.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | /** 4 | * A functional interface which enables masking JSON values (boolean, numbers, and strings) in almost every imaginable 5 | * way. Accepts {@link ValueMaskerContext} that contains the context of the current value being masked. 6 | * 7 | * <p> This is a sealed interface in order to make sure that correct JSON type is only masked with the implementation 8 | * that supports masking of that particular type of the value. There's also a special {@link ValueMasker.AnyValueMasker} 9 | * that can mask values of any JSON type. 10 | * <p> Most of the out-of-the-box implementation are, in fact, instances of {@link ValueMasker.AnyValueMasker}, but 11 | * some concrete implementations can only mask values of the specific type: For strings it's 12 | * {@link ValueMaskers#email(int, int, boolean, String)} and {@link ValueMaskers#eachCharacterWith(String)}, for numbers 13 | * {@link ValueMaskers#eachDigitWith(int)}. 14 | * 15 | * @see ValueMaskers for several out-of-the-box implementations 16 | */ 17 | // Sealed interface from Java 17 onwards, reverted back to non-sealed to Java 11 - Java 16 release 18 | public /* sealed */ interface ValueMasker { 19 | /** 20 | * Used for masking JSON values. Accepts {@link ValueMaskerContext} that contains context of the 21 | * current value being masked. 22 | */ 23 | void maskValue(ValueMaskerContext context); 24 | 25 | /** 26 | * {@link ValueMasker} that can mask JSON string values. 27 | * 28 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskStringsWith(ValueMasker.StringMasker) 29 | */ 30 | @FunctionalInterface 31 | interface StringMasker extends ValueMasker { 32 | } 33 | 34 | /** 35 | * {@link ValueMasker} that can mask JSON number values. 36 | * 37 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskNumbersWith(ValueMasker.NumberMasker) 38 | */ 39 | @FunctionalInterface 40 | interface NumberMasker extends ValueMasker { 41 | } 42 | 43 | /** 44 | * {@link ValueMasker} that can mask JSON boolean values. 45 | * 46 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskBooleansWith(ValueMasker.BooleanMasker) 47 | */ 48 | @FunctionalInterface 49 | interface BooleanMasker extends ValueMasker { 50 | } 51 | 52 | /** 53 | * {@link ValueMasker} that can mask any JSON value (string, number or a boolean). 54 | */ 55 | @FunctionalInterface 56 | interface AnyValueMasker extends ValueMasker, StringMasker, NumberMasker, BooleanMasker { 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java17/dev/blaauwendraad/masker/json/ValueMasker.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | /** 4 | * A functional interface which enables masking JSON values (boolean, numbers, and strings) in almost every imaginable 5 | * way. Accepts {@link ValueMaskerContext} that contains the context of the current value being masked. 6 | * 7 | * <p> This is a sealed interface in order to make sure that correct JSON type is only masked with the implementation 8 | * that supports masking of that particular type of the value. There's also a special {@link AnyValueMasker} 9 | * that can mask values of any JSON type. 10 | * <p> Most of the out-of-the-box implementation are, in fact, instances of {@link AnyValueMasker}, but 11 | * some concrete implementations can only mask values of the specific type: For strings it's 12 | * {@link ValueMaskers#email(int, int, boolean, String)} and {@link ValueMaskers#eachCharacterWith(String)}, for numbers 13 | * {@link ValueMaskers#eachDigitWith(int)}. 14 | * 15 | * @see ValueMaskers for several out-of-the-box implementations 16 | */ 17 | public sealed interface ValueMasker permits 18 | ValueMasker.StringMasker, 19 | ValueMasker.NumberMasker, 20 | ValueMasker.BooleanMasker, 21 | ValueMasker.AnyValueMasker { 22 | /** 23 | * Used for masking JSON values. Accepts {@link ValueMaskerContext} that contains context of the 24 | * current value being masked. 25 | */ 26 | void maskValue(ValueMaskerContext context); 27 | 28 | /** 29 | * {@link ValueMasker} that can mask JSON string values. 30 | * 31 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskStringsWith(StringMasker) 32 | */ 33 | @FunctionalInterface 34 | non-sealed interface StringMasker extends ValueMasker { 35 | } 36 | 37 | /** 38 | * {@link ValueMasker} that can mask JSON number values. 39 | * 40 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskNumbersWith(NumberMasker) 41 | */ 42 | @FunctionalInterface 43 | non-sealed interface NumberMasker extends ValueMasker { 44 | } 45 | 46 | /** 47 | * {@link ValueMasker} that can mask JSON boolean values. 48 | * 49 | * @see dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder#maskBooleansWith(BooleanMasker) 50 | */ 51 | @FunctionalInterface 52 | non-sealed interface BooleanMasker extends ValueMasker { 53 | } 54 | 55 | /** 56 | * {@link ValueMasker} that can mask any JSON value (string, number or a boolean). 57 | */ 58 | @FunctionalInterface 59 | non-sealed interface AnyValueMasker extends ValueMasker, StringMasker, NumberMasker, BooleanMasker { 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Last Updated: 26-01-2025 4 | 5 | ## Supported Versions 6 | 7 | The following versions of the library are supported for security updates. 8 | 9 | | Version | Supported | 10 | |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------| 11 | | [![Maven Central](https://img.shields.io/maven-metadata/v.svg?metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fdev%2Fblaauwendraad%2Fjson-masker%2Fmaven-metadata.xml&label=&color=green&style=flat-square)](https://central.sonatype.com/artifact/dev.blaauwendraad/json-masker) _(latest)_ | :white_check_mark: | 12 | | **1.0.x** | :x: | 13 | | **1.0.0-rcX** | :x: | 14 | | **0.2.x** | :x: | 15 | | **0.1.x** | :x: | 16 | 17 | ## Reporting a Vulnerability 18 | 19 | In case you find a security vulnerability for this library, please responsibly disclose this by sending an e-mail to: 20 | b[dot]blaauwendraad[at]gmail[dot]com and agavlyukovskiy[at]gmail[dot]com. 21 | 22 | If the security vulnerability is accepted, we will work on a security fix as soon as possible for the aforementioned 23 | supported versions and disclose it publicly afterwards. 24 | -------------------------------------------------------------------------------- /src/test/resources/test-multiple-target-keys.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "maskingConfig": { 4 | "maskKeys": [ 5 | "someKey", 6 | "someKey2" 7 | ] 8 | }, 9 | "input": { 10 | "someKey": "hello", 11 | "otherKey": null, 12 | "someKey2": "hi" 13 | }, 14 | "expectedOutput": { 15 | "someKey": "***", 16 | "otherKey": null, 17 | "someKey2": "***" 18 | } 19 | }, 20 | { 21 | "maskingConfig": { 22 | "maskKeys": [ 23 | "someKey", 24 | "someKey2", 25 | "someKey4" 26 | ] 27 | }, 28 | "input": { 29 | "someKey": "hello", 30 | "someKey2": "hi", 31 | "someKey3": "hey", 32 | "someKey4": [ 33 | { 34 | "someKey4": "value" 35 | } 36 | ] 37 | }, 38 | "expectedOutput": { 39 | "someKey": "***", 40 | "someKey2": "***", 41 | "someKey3": "hey", 42 | "someKey4": [ 43 | { 44 | "someKey4": "***" 45 | } 46 | ] 47 | } 48 | }, 49 | { 50 | "maskingConfig": { 51 | "maskKeys": [ 52 | "someKey", 53 | "someKey2", 54 | "someKey4" 55 | ] 56 | }, 57 | "input": { 58 | "someKey": "hello", 59 | "someKey2": "hi", 60 | "someKey2": 2123, 61 | "otherKey": null, 62 | "someKey3": "hey", 63 | "someKey4": [ 64 | { 65 | "someKey4": "value" 66 | } 67 | ] 68 | }, 69 | "expectedOutput": { 70 | "someKey": "***", 71 | "someKey2": "***", 72 | "someKey2": "###", 73 | "otherKey": null, 74 | "someKey3": "hey", 75 | "someKey4": [ 76 | { 77 | "someKey4": "***" 78 | } 79 | ] 80 | } 81 | }, 82 | { 83 | "maskingConfig": { 84 | "maskKeys": [ 85 | "targetKey1", 86 | "targetKey2" 87 | ] 88 | }, 89 | "input": { 90 | "targetKey1": { 91 | "targetKey2": "\u001C" 92 | }, 93 | "targetKey2": "W" 94 | }, 95 | "expectedOutput": { 96 | "targetKey1": { 97 | "targetKey2": "***" 98 | }, 99 | "targetKey2": "***" 100 | } 101 | }, 102 | { 103 | "maskingConfig": { 104 | "maskKeys": [ 105 | "targetKey1", 106 | "targetKey2" 107 | ] 108 | }, 109 | "input": { 110 | "targetKey1": { 111 | "targetKey2": "\u001C" 112 | }, 113 | "targetKey2": true, 114 | "targetKey1": null 115 | }, 116 | "expectedOutput": { 117 | "targetKey1": { 118 | "targetKey2": "***" 119 | }, 120 | "targetKey2": "&&&", 121 | "targetKey1": null 122 | } 123 | } 124 | ] -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MultiJsonTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.util.Set; 7 | 8 | public class MultiJsonTest { 9 | 10 | @Test 11 | void shouldMaskJsonLinesObjects() { 12 | JsonMasker jsonMasker = JsonMasker.getMasker(Set.of("maskMe")); 13 | 14 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, 15 | """ 16 | {"maskMe":"secret"} 17 | {"maskMe":"secret"} 18 | {"maskMe":"secret"} 19 | """, 20 | """ 21 | {"maskMe":"***"} 22 | {"maskMe":"***"} 23 | {"maskMe":"***"} 24 | """ 25 | ); 26 | } 27 | 28 | @Test 29 | void shouldMaskJsonLinesArrays() { 30 | JsonMasker jsonMasker = JsonMasker.getMasker(Set.of("maskMe")); 31 | 32 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, 33 | """ 34 | [{"maskMe":"secret"}] 35 | [{"maskMe":"secret"}] 36 | [{"maskMe":"secret"}] 37 | """, 38 | """ 39 | [{"maskMe":"***"}] 40 | [{"maskMe":"***"}] 41 | [{"maskMe":"***"}] 42 | """ 43 | ); 44 | } 45 | 46 | @Test 47 | void shouldMaskJsonLinesMixedTypes() { 48 | JsonMasker jsonMasker = JsonMasker.getMasker(JsonMaskingConfig.builder().allowKeys().build()); 49 | 50 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, 51 | """ 52 | "secret" 53 | true 54 | false 55 | null 56 | 123 57 | """, 58 | """ 59 | "***" 60 | "&&&" 61 | "&&&" 62 | null 63 | "###" 64 | """ 65 | ); 66 | } 67 | 68 | @Test 69 | void shouldMaskRepeatedJsonsWithoutNewLines() { 70 | JsonMasker jsonMasker = JsonMasker.getMasker(Set.of("maskMe")); 71 | 72 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(jsonMasker, 73 | """ 74 | {"maskMe":"secret"}{"maskMe":"secret"} {"maskMe":"secret"} 75 | """, 76 | """ 77 | {"maskMe":"***"}{"maskMe":"***"} {"maskMe":"***"} 78 | """ 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/ConcurrentMaskingTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.time.Duration; 8 | import java.time.Instant; 9 | import java.util.concurrent.CompletableFuture; 10 | import java.util.concurrent.ExecutorService; 11 | import java.util.concurrent.Executors; 12 | import java.util.stream.IntStream; 13 | 14 | public class ConcurrentMaskingTest { 15 | private static final Duration MAX_CONCURRENT_TEST_RUN = Duration.ofSeconds(10); 16 | private static final String JSON_INPUT = 17 | """ 18 | { 19 | "userInfo": { 20 | "personalInfo": { 21 | "firstName": "Breus", 22 | "lastName": "Blaauwendraad" 23 | }, 24 | "ipAddress": "123.102.123", 25 | "userId": 1234 26 | } 27 | }"""; 28 | 29 | private static final String EXPECTED_MASKED_OUTPUT = 30 | """ 31 | { 32 | "userInfo": { 33 | "personalInfo": { 34 | "firstName": "***", 35 | "lastName": "***" 36 | }, 37 | "ipAddress": "***", 38 | "userId": 1234 39 | } 40 | }"""; 41 | 42 | @Test 43 | void concurrentJsonPathMasking() { 44 | JsonMasker masker = 45 | JsonMasker.getMasker( 46 | JsonMaskingConfig.builder() 47 | .maskJsonPaths("$.userInfo.personalInfo", "$.userInfo.ipAddress") 48 | .build()); 49 | maskConcurrently(Runtime.getRuntime().availableProcessors(), masker); 50 | } 51 | 52 | @Test 53 | void concurrentKeyMasking() { 54 | JsonMasker masker = 55 | JsonMasker.getMasker( 56 | JsonMaskingConfig.builder().maskKeys("firstName", "lastName", "ipAddress").build()); 57 | maskConcurrently(Runtime.getRuntime().availableProcessors(), masker); 58 | } 59 | 60 | private void maskConcurrently(int nThreads, JsonMasker masker) { 61 | ExecutorService executorService = Executors.newFixedThreadPool(nThreads); 62 | IntStream.range(0, nThreads) 63 | .mapToObj(i -> CompletableFuture.runAsync(() -> { 64 | Instant testStartTime = Instant.now(); 65 | while (Instant.now().isBefore(testStartTime.plus(MAX_CONCURRENT_TEST_RUN))) { 66 | JsonMaskerTestUtil.assertJsonMaskerApiEquivalence(masker, JSON_INPUT, EXPECTED_MASKED_OUTPUT); 67 | } 68 | }, executorService)) 69 | .toList() 70 | .forEach(CompletableFuture::join); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/jmh/java/dev/blaauwendraad/masker/json/InstanceCreationBenchmark.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.randomgen.RandomJsonGenerator; 4 | import org.jspecify.annotations.NullUnmarked; 5 | import org.openjdk.jmh.annotations.Benchmark; 6 | import org.openjdk.jmh.annotations.BenchmarkMode; 7 | import org.openjdk.jmh.annotations.Fork; 8 | import org.openjdk.jmh.annotations.Measurement; 9 | import org.openjdk.jmh.annotations.Mode; 10 | import org.openjdk.jmh.annotations.OutputTimeUnit; 11 | import org.openjdk.jmh.annotations.Param; 12 | import org.openjdk.jmh.annotations.Scope; 13 | import org.openjdk.jmh.annotations.Setup; 14 | import org.openjdk.jmh.annotations.Warmup; 15 | import tools.jackson.databind.json.JsonMapper; 16 | import tools.jackson.databind.node.ArrayNode; 17 | 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | import java.util.List; 22 | import java.util.Random; 23 | import java.util.Set; 24 | import java.util.concurrent.TimeUnit; 25 | import java.util.stream.Collectors; 26 | 27 | @Warmup(iterations = 1, time = 3) 28 | @Fork(value = 1) 29 | @Measurement(iterations = 1, time = 3) 30 | @OutputTimeUnit(TimeUnit.SECONDS) 31 | @BenchmarkMode(Mode.Throughput) 32 | public class InstanceCreationBenchmark { 33 | private static final JsonMapper jsonMapper = new JsonMapper(); 34 | 35 | @org.openjdk.jmh.annotations.State(Scope.Thread) 36 | @NullUnmarked 37 | public static class State { 38 | @Param({"1", "10", "100", "ALL"}) 39 | String numberOfTargetKeys; 40 | 41 | Set<String> targetKeys; 42 | 43 | @Setup 44 | public synchronized void setup() throws IOException { 45 | try (var stream = RandomJsonGenerator.class.getResourceAsStream("/target_keys.json")) { 46 | if (stream == null) { 47 | throw new IllegalArgumentException("File not found: target_keys.json"); 48 | } 49 | List<String> targetKeyList = new ArrayList<>(); 50 | jsonMapper.readValue(stream, ArrayNode.class).forEach(t -> targetKeyList.add(t.asString())); 51 | if (!"ALL".equals(numberOfTargetKeys) && Integer.parseInt(numberOfTargetKeys) <= targetKeyList.size()) { 52 | Collections.shuffle(targetKeyList, new Random(RandomJsonGenerator.STATIC_RANDOM_SEED)); 53 | targetKeys = 54 | targetKeyList.stream().limit(Integer.parseInt(numberOfTargetKeys)).collect(Collectors.toSet()); 55 | } else { 56 | targetKeys = targetKeyList.stream().collect(Collectors.toSet()); 57 | } 58 | } 59 | } 60 | } 61 | 62 | @Benchmark 63 | public JsonMasker jsonMasker(State state) { 64 | return JsonMasker.getMasker(state.targetKeys); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/dev/blaauwendraad/masker/json/MaskingStateTest.java: -------------------------------------------------------------------------------- 1 | package dev.blaauwendraad.masker.json; 2 | 3 | import dev.blaauwendraad.masker.json.config.JsonMaskingConfig; 4 | import org.assertj.core.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.nio.charset.StandardCharsets; 8 | 9 | class MaskingStateTest { 10 | private final KeyMatcher.RadixTriePointer pointer = new KeyMatcher.RadixTriePointer(new KeyMatcher.RadixTrieNode(new byte[0], new byte[0]), 0); 11 | @Test 12 | void shouldReturnStringRepresentationForDebugging() { 13 | MaskingState maskingState = new MaskingState(""" 14 | { 15 | "maskMe": "some value" 16 | } 17 | """.getBytes(StandardCharsets.UTF_8), pointer); 18 | 19 | Assertions.assertThat(maskingState).hasToString(""" 20 | >{< 21 | "mask 22 | """.stripTrailing()); 23 | 24 | maskingState.incrementIndex(10); 25 | 26 | Assertions.assertThat(maskingState).hasToString(""" 27 | { 28 | "mas>k<Me": "some 29 | """.stripTrailing()); 30 | 31 | maskingState.incrementIndex(20); 32 | 33 | Assertions.assertThat(maskingState).hasToString(""" 34 | e value" 35 | }> 36 | """); 37 | 38 | maskingState.incrementIndex(1); 39 | 40 | Assertions.assertThat(maskingState).hasToString(""" 41 | value" 42 | } 43 | ><end of buffer> 44 | """.stripTrailing()); 45 | } 46 | 47 | @Test 48 | void shouldThrowErrorWhenGettingStartValueIndexOutsideOfMasking() { 49 | MaskingState maskingState = new MaskingState(""" 50 | { 51 | "maskMe": "some value" 52 | } 53 | """.getBytes(StandardCharsets.UTF_8), pointer); 54 | 55 | Assertions.assertThatThrownBy(maskingState::getCurrentTokenStartIndex) 56 | .isInstanceOf(IllegalStateException.class); 57 | } 58 | 59 | @Test 60 | void shouldUseCorrectOffsetWhenThrowingValueMaskerError() { 61 | var jsonMasker = JsonMasker.getMasker(JsonMaskingConfig.builder() 62 | .maskKeys("maskMe") 63 | .maskStringsWith(context -> { 64 | throw context.invalidJson("Didn't like the value at index 3", 3); 65 | }) 66 | .build() 67 | ); 68 | 69 | Assertions.assertThatThrownBy(() -> 70 | jsonMasker.mask(""" 71 | { 72 | "maskMe": "some value" 73 | } 74 | """ 75 | )) 76 | .isInstanceOf(InvalidJsonException.class) 77 | .hasMessage("Didn't like the value at index 3 at index 19"); 78 | } 79 | } 80 | --------------------------------------------------------------------------------