← Return to the Blogs page

Downstream calls Dependency management and Secret Management

By Oleksandr (Sasha) Antoshchenko

4/24/2024

Article

Introduction

The upcoming enhancements in Micro's Downstream Calls—Dependency Management and Secret Management—are crucial for extending the versatility and security of the microservices you can develop. By enabling Dependency Management, Micro will allow Downstream Calls to import any Node.js library by specifying a package name and version. This capability opens up a vast array of functionalities, as developers can integrate a wide range of external libraries directly into their applications, tailoring solutions to specific needs.

Secret Management will complement this by providing a secure method to manage sensitive information, such as API or database keys, within Downstream Calls. Using proven security technologies, this feature ensures that critical data is securely stored and accessible only through secured means, enhancing the overall security posture of applications built with Micro.

Together, these features significantly expand the potential applications of Downstream Calls, allowing you to build more complex, secure, and customized microservices with Micro. For example, if you want to store data in AWS S3, you would now be able to pull in the AWS-SDK and use it directly in your code while securely storing your AWS access credentials within Micro.

The main purpose of both features is to allow the user to call external sources like Databases and APIs easily and securely. We do not intend for Micro to become an IDE instead we want the user to be mainly concerned by "What their application is doing," not "How it is doing it". We still encourage you to leave all business logic that does not include calling external sources to Micro's AI.

Downstream Calls Dependency Management

Update (8 May 2024). Dependency Management for downstream calls was released today. Learn more in the release notes

Dependency Management in Micro enables Downstream Calls to seamlessly integrate external Node.js libraries, directly enhancing the functionality of your applications. This feature is critical for developers who need to incorporate specialized functionalities from the broader Node.js ecosystem into their microservices.

How It Works

Users can include any Node.js library by specifying its package name and version in the Downstream Calls configuration. Micro automates the process of fetching and integrating these libraries into the microservice environment, readying them for immediate use.

flowchart LR User[Developer] -- Specify Package --> Micro[Micro Service] Micro -- Retrieve Package --> NPM[Node Package Manager] NPM -- Return Package --> Micro Micro -- Integrate Package --> DownstreamCall[Downstream Call Execution] DownstreamCall -- Execute Logic --> Output[Service Output]

This automation supports developers by allowing them to add complex data processing or communication capabilities to their applications without manual setup.

User Responsibilities

Adopting Dependency Management does come with essential responsibilities:

  • Security: Developers should verify the security of libraries to prevent vulnerabilities in their applications. This involves using trusted sources and updating libraries regularly.
  • Compliance: Libraries must comply with legal and regulatory standards applicable in the user’s industry, particularly when processing sensitive data.
  • Performance: Developers should assess the impact of added libraries on application performance to ensure efficiency and responsiveness.

Aligning with Micro’s Goals

This feature enhances the capability of Downstream Calls to interact with external sources like databases and APIs efficiently and securely, simplifying the integration without turning Micro into an IDE. The focus remains on what the application accomplishes rather than the complexities of how it does so. Consistent with Micro's philosophy, business logic that doesn't involve external calls should still leverage Micro's AI-powered capabilities to maintain simplicity and focus on outcomes.

Conclusion

By enabling the straightforward integration of Node.js libraries, Dependency Management broadens the scope of what can be achieved with Micro’s Downstream Calls, making it easier for developers to build advanced, customized solutions while managing the underlying complexities of software dependencies.

Downstream Calls Secret Management

Secret Management within Micro's Downstream Calls safeguards sensitive information, such as API keys and database credentials, essential for secure communications with external services. This feature is designed to prevent unauthorized access and ensure that secrets are managed and accessed securely, adhering to best practices in security.

How It Works

In Micro, secrets are stored securely in an encrypted format and are only accessible within the execution environment of a Downstream Call through a predefined constant, such as secrets. This approach ensures that sensitive data remains protected both at rest and in transit, and is only exposed to the parts of the application that absolutely need it.

flowchart TD user["Svtoo User\n(You)"] subgraph svtoo as [Svtoo] micro[Micro] ss[(Secret Store)] subgraph Your_Application upstream(Upstream) gen["Logic Generated by Micro"] downstream(Downstream) response(Response) end end client["API Client\n (A user of Your API)"] user --Define application with credentials--> micro micro --Store credentials-->ss micro --Build and Deploy Application-->Your_Application client --Call API-->upstream upstream -->gen gen<-->downstream downstream--Get Credantials-->ss gen-->response response--->client

This diagram visually represents the workflow for managing secrets within Micro:

  1. Define Application: As a Svtoo user, you start by defining your application in Micro, including any necessary credentials for external services.
  2. Secure Storage: Micro securely stores these credentials in the Secret Store to ensure they are safeguarded against unauthorized access.
  3. Application Deployment: Micro then builds and deploys your application, which consists of several components including Upstream, Logic Generated by Micro (the core logic), and Downstream(s).
  4. API Interaction: When an API Client (a user of your API) makes a call, it is first received by the Upstream component.
  5. Logic Execution: The call progresses to the Logic Generated by Micro, where the main application processes occur. This component communicates with the Downstream component as needed.
  6. Secrets Fetching: For operations requiring credentials, the Downstream component retrieves them securely from the Secret Store.
  7. Response Handling: After processing, the generated response moves back through the system to the API Client.

This flow ensures that sensitive data is only accessed when necessary and remains protected throughout the application's lifecycle, aligning with best practices for security and data integrity.

Benefits

Implementing Secret Management allows developers to:

  • Enhance the security of their applications by protecting sensitive data.
  • Reduce the operational complexity involved in managing secrets, freeing developers to focus more on application logic rather than security logistics.

Conclusion

The introduction of Secret Management in Micro represents a significant step forward in enabling developers to build secure and compliant applications. By automating the protection and management of sensitive information, Micro helps ensure that your applications can safely interact with external systems without compromising security.

Stay connected!

Please consider singing up for the waitlist , to be one of the first ones to try Micro.

Interested in working with us, investing in Svtoo, or any other question, please do not hesitate to Contact Us .