Skip to content

Instantly share code, notes, and snippets.

View javabr's full-sized avatar

Leo Bitencourt javabr

View GitHub Profile
@javabr
javabr / etags.md
Last active February 27, 2024 01:16
etags and if-match headers

Embracing ETags and If-Match Headers in API Design

Entity Tags (ETags) in response headers are identifiers that help API designers solve problems such as:

  • Preventing "mid-air" race conditions with the help of the If-Match header;
  • Improving caching strategies by adding the ETag version to the cache key and enabling servers to respond partially to requests;
  • Adopting HTTP specification and standardizing errors for concurrent updates; and
  • Uniquely identifying responses by using a "hash" as the ETag value.
@javabr
javabr / mulesoft-securing-apis-alternatives.md
Last active February 18, 2024 23:47
Securing APIs with Mulesoft - what options do we have? when to use client id/secret or oAuth?

What are my options to secure an API in Mulesoft and what are the pros. and cons. of each one?

In the world of API development and integration, securing API calls is paramount to ensure that data exchange between systems is protected from unauthorized access.

If your enterprise is using Mulesoft platform, APIs access can be protected by a combination of one or more of the schemes below:

  • IP allow or deny lists;
  • private VPCs that are not exposed to not secured networks; and,
  • secrets added to HTTP headers (or query parameters), which are inspected for validity at several points during the API lifecycle using API Policies.
@javabr
javabr / correlationIds.md
Last active February 20, 2024 20:25
Transaction Tracking in Integration Solutions with Unique Correlation IDs - Mulesoft makes it easy !

Transactions Tracking in Mulesoft

When we talk about integrating different software systems to work together, keeping track of every step of a transaction as it moves through these systems can be quite tricky.

Modern solutions are sliced in several different layers and services. Each call to your APIs and each schedule job may generate an enormous amount of logs across several different systems.

Have you ever given the task to track back an error and you don't know exactly the whole transaction lifecycle up to the moment of the issue? How much easier would be your job if all logs for a particular transaction had an unique id added to the each log statement?

This is where unique correlation IDs come into play. They act like a tracking number for each transaction, making it much easier to see the whole journey from start to finish.