This is a custom extractor for Axum that extracts the user info, via the X-Endpoint-API-UserInfo header.
If the X-Endpoint-API-UserInfo header is present and it’s a valid base 64 encoded JSON value, it returns it.
If the X-Endpoint-API-UserInfo header is present and it’s an invalid base 64 encoded JSON (either not a base 64 or a JSON structure), it returns a 400 Bad Request error with a specific message.
If the X-Endpoint-API-UserInfo header is not present, it returns a 400 Bad Request error with a specific message.