Home / Function/ testTokenProcessing() — netty Function Reference

testTokenProcessing() — netty Function Reference

Architecture documentation for the testTokenProcessing() function in InsecureQuicTokenHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c66bf011_7879_8e09_b293_947636f716a7["testTokenProcessing()"]
  3e9f9a96_1493_8d4b_dcc7_01a24738279d["InsecureQuicTokenHandlerTest"]
  c66bf011_7879_8e09_b293_947636f716a7 -->|defined in| 3e9f9a96_1493_8d4b_dcc7_01a24738279d
  df279b8b_1d37_b2a6_bae4_b7ee63199bd6["testTokenProcessingIpv4()"]
  df279b8b_1d37_b2a6_bae4_b7ee63199bd6 -->|calls| c66bf011_7879_8e09_b293_947636f716a7
  f1760f66_c459_2552_ba30_158862fbbcac["testTokenProcessingIpv6()"]
  f1760f66_c459_2552_ba30_158862fbbcac -->|calls| c66bf011_7879_8e09_b293_947636f716a7
  style c66bf011_7879_8e09_b293_947636f716a7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-native-quic/src/test/java/io/netty/handler/codec/quic/InsecureQuicTokenHandlerTest.java lines 49–79

    private static void testTokenProcessing(boolean ipv4) throws UnknownHostException {
        byte[] bytes = new byte[Quiche.QUICHE_MAX_CONN_ID_LEN];
        ThreadLocalRandom.current().nextBytes(bytes);
        ByteBuf dcid = Unpooled.wrappedBuffer(bytes);
        ByteBuf out = Unpooled.buffer();
        try {
            final InetSocketAddress validAddress;
            final InetSocketAddress invalidAddress;
            if (ipv4) {
                validAddress = new InetSocketAddress(
                        InetAddress.getByAddress(new byte[] { 10, 10, 10, 1}), 9999);
                invalidAddress  = new InetSocketAddress(
                        InetAddress.getByAddress(new byte[] { 10, 10, 10, 10}), 9999);
            } else {
                validAddress = new InetSocketAddress(InetAddress.getByAddress(
                        new byte[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1}), 9999);
                invalidAddress  = new InetSocketAddress(InetAddress.getByAddress(
                        new byte[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}), 9999);
            }

            InsecureQuicTokenHandler.INSTANCE.writeToken(out, dcid, validAddress);
            assertThat(out.readableBytes()).isLessThanOrEqualTo(InsecureQuicTokenHandler.INSTANCE.maxTokenLength());
            assertNotEquals(-1, InsecureQuicTokenHandler.INSTANCE.validateToken(out, validAddress));

            // Use another address and check that the validate fails.
            assertEquals(-1, InsecureQuicTokenHandler.INSTANCE.validateToken(out, invalidAddress));
        } finally {
            dcid.release();
            out.release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testTokenProcessing() do?
testTokenProcessing() is a function in the netty codebase, defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/InsecureQuicTokenHandlerTest.java.
Where is testTokenProcessing() defined?
testTokenProcessing() is defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/InsecureQuicTokenHandlerTest.java at line 49.
What calls testTokenProcessing()?
testTokenProcessing() is called by 2 function(s): testTokenProcessingIpv4, testTokenProcessingIpv6.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free