Urgent.News

What's breaking now, across thousands of outlets.

Tech

Day 23: The API Payload Security Pipeline: Order, Protection Levels and Keys

The previous post, The Division of Labor Between XML, JSON and MessagePack , closed by saying the other half of value comes here. Encoded and Encrypted differ by one number on the API payload, and underneath that number are three stages that run in a fixed order, while on the way back the order is more than the same run in reverse. An ERP system's API has to answer two questions that are…

The API payload security pipeline consists of three stages: serialization, compression, and encryption. These stages run in a fixed order, with serialization turning the object into bytes, compression making those bytes shorter, and encryption turning bytes into bytes with an authentication code. The order cannot be swapped without breaking the pipeline.

The ApiProtectionLevel and PayloadFormat are two different things, with the former declaring who is entitled to process the content and the latter specifying what the content should be processed into. The encryption layer is not part of the serialization or compression stages, but is instead handled by a separate layer according to the format.

Keys used for encryption come from a separate layer and are not declared by the caller. The order of these stages is important, as each stage only sees bytes that have passed through the previous stage. Compression comes before encryption because it does nothing to ciphertext, and running the order through a case study shows that swapping the order does not affect the functionality of the pipeline.

The access control compares the PayloadFormat with another enum to determine what level of security is required, with four levels: Public, Encoded, Encrypted, and LocalOnly. The Public level is the lowest, requiring only HTTPS for security, while the Encrypted level requires the most security, ensuring that content is not readable or plain text inside the server.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Part 3: Building the App & Caching for Data Latency

Part 3: Building the App & Caching for Data Latency Navigation: ← Part 2: Optimizing Dockerfiles with Multi-Stage Builds | Part 4: Full-Cycle CI/CD — From Local Hooks to AWS ECR → 📦 Companion…

  • Python Flask REST API aggregates Rick & Morty data
  • CacheMiddleware with Redis reduces data latency
  • Soft TTL and LRU eviction manage cache memory

More from Monday 16 November →