Overview of Fory IDL Tests (Python)
mainfory-idl-tests package is used to verify that Python types generated from the Fory Definition Language (FDL) function correctly when used with the pyfory runtime.repository·main·Indexed 26 days ago
https://github.com/apache/foryA high-performance, multi-language serialization framework designed for idiomatic domain objects, schema IDL, and efficient cross-language data exchange. It includes the fory-compiler (FDL compiler) and supports shared/circular references and optimized native serialization modes. The project provides comprehensive benchmarks for C++, C#, Dart, Go, and Java to compare performance against Protocol Buffers and MessagePack.
fory-idl-tests package is used to verify that Python types generated from the Fory Definition Language (FDL) function correctly when used with the pyfory runtime.The integration_tests directory contains suites designed to verify Fory's compatibility and interoperability across different environments and languages. Key test areas include:
jdk_compatibility_tests).graalvm_tests).jpms_tests).idl_tests).grpc_tests).cpython_benchmark).Apache Fory™ xlang serialization provides a dynamic binary format for automatic cross-language object serialization. It is designed to work across multiple languages (including Java, Python, C++, Go, Rust, JS/TS, C#, Swift, Dart, Scala, and Kotlin) without requiring intermediate IDL definitions or schema compilation steps.
Key capabilities include:
The Fory deserialization security model defines how the system protects against resource and policy failures when processing untrusted or partially trusted binary data.
Key Security Boundaries:
Note on Application Responsibility: Fory does not protect the semantic meaning of a successfully deserialized value. Application-level authorization, business rules, and domain-specific validation are the responsibility of the developer, not the Fory runtime.
NumericStruct, Sample, MediaContent, and their respective list variants.The JavaScript benchmarks use specific data handling semantics for each format:
toProto, fromProto, protobufjs.create, or toObject conversion work.While the binary protocol and API are similar, Xlang mode has stricter requirements than Python Native mode:
__getstate__, __reduce__, or __reduce_ex__ in Xlang mode.Fory Row Format is a cache-friendly binary format designed for efficient random access and partial serialization. Unlike standard object graph serialization, it allows you to read individual fields without deserializing the entire object.
Key features include:
The fory-annotation-processor generates static serializers for Java classes annotated with @ForyStruct. This is useful for optimizing serialization performance and compatibility in specific environments.
ForyJsonBuilder#withCodegen(false).@Ref, @UInt8Type, or @Float16Type.@JsonType JSON model and @JsonMixin source. For ordinary Fory serialization in native images, use Fory's native-image build-time serializer generation.Apache Fory is an in-process serialization library, not a standalone network service or daemon. Because it operates within your application's process, security is a shared responsibility between the library and your implementation.
Fory focuses on protecting the runtime during the deserialization of bytes or streams. Its security boundaries include:
TypeChecker or allow-lists) that restrict which types, functions, or methods can be materialized.Since Fory does not provide encryption, authentication, or transport security, applications must handle the following:
Apache Fory provides three distinct serialization formats depending on your use case:
org.apache.fory:fory-core): Use for compact object graphs in Java-native mode or for cross-language (xlang) payloads.org.apache.fory:fory-format): Use for zero-copy random access, partial reads, or Apache Arrow integration.org.apache.fory:fory-json): Use for high-throughput standard JSON serialization for Java applications.Apache Fory™ Java offers three primary formats depending on your use case. Ensure all Fory modules used in a single application are kept on the same version.
fory-core): Use for compact object graphs in Java-native mode or for cross-language communication.fory-format): Use for zero-copy random access, partial reads, or when integrating with Apache Arrow.fory-json): Use for high-throughput standard JSON serialization/deserialization in Java applications.