Forwarding Data with Smart Data Proxies
One of the most powerful features of Qanapi Smart Data Proxies is the ability to automatically forward your encrypted or decrypted data to third-party services. This simplifies integrations and ensures sensitive data is always protected in transit.How Forwarding Works
When you use the forwarding feature:- Your application sends a request to the Qanapi Smart Data Proxy
- Qanapi processes the data (encrypts or decrypts specified fields)
- The proxy forwards the processed request to your specified destination
- The destination’s response is returned to your application through Qanapi
Forwarding Encrypted Data
To forward encrypted data to a third-party service:- Encrypt the
titleandbodyfields - Forward the modified request with encrypted fields to
https://jsonplaceholder.typicode.com/posts - Return the response from the destination to your application
Request Methods and Headers
The Smart Data Proxy preserves the HTTP method of your original request when forwarding. For example:- If you make a
POSTrequest to Qanapi, it will forward aPOSTrequest to the destination - If you make a
GETrequest to Qanapi, it will forward aGETrequest to the destination
Forwarding with Authentication
You can include authentication headers for the destination service in your request to Qanapi. These will be forwarded along with the encrypted data:Processing the Destination Response
The response from the destination service is returned to your application as-is. If the destination returns encrypted data, you can make a separate request to Qanapi to decrypt it if needed.Conditional Forwarding Based on Response
For more complex scenarios, you may want to process the response from a destination before returning it to your application. This can be achieved by using separate API calls:- First, encrypt the sensitive data
- Then, make a direct request to the destination service with the encrypted data
- Finally, decrypt any encrypted data in the response if needed
Handling Errors in Forwarded Requests
If there’s an error in forwarding your request:- If the error occurs during encryption/decryption, Qanapi will return an error response directly
- If the error occurs when communicating with the destination service, Qanapi will return the error response from the destination
Security Considerations for Forwarding
When using the forwarding feature:- Only use HTTPS destinations - Ensure destination URLs use HTTPS for secure transmission
- Be cautious with sensitive headers - Any headers you include will be forwarded
- Monitor forwarded requests - Use the Qanapi Event Log to track forwarded requests
- Validate destination URLs - Only forward to trusted destination services
Response Format
The response from a forwarded request includes:- The status code from the destination service
- All headers from the destination service
- The body of the response from the destination service
Use Cases for Forwarding
Forwarding is particularly useful for:- API Integrations: Securely integrate with third-party APIs while protecting sensitive data
- Microservices: Add a security layer between your microservices
- Legacy System Integration: Add encryption to legacy systems without modifying them
- Regulated Data: Ensure compliance when sending regulated data to external services