Top-Level Concepts
Understanding how Versori handles connections involves a few key concepts:- Connectors/Systems: These are the external systems you are connecting to. A system holds the configuration on how you connect to it. This connection information is defined in the system’s auth schemes. Each system can have multiple auth schemes defined at any given time.
- Auth Schemes: These are the authentication methods (e.g.,
api-key,oauth2) that belong to systems/connectors. An auth scheme represents the configuration of the authentication method, not the actual credentials. The actual credentials are stored securely in the connections themselves. - Projects: Projects contain the code that uses the connections when talking to the systems.
- Linking Systems to Projects: Projects can have multiple systems added to them. Before you can deploy a project, you must connect to all systems that are linked to it. When a system is linked to a project, you select which Auth Scheme is used to connect to the system.
- Connections: Connections belong to a system and are used by a project to talk to that system. They hold the actual credentials required by the configured auth scheme.
Managing Connections via CLI
While systems are typically created by AI agents when using the planning flow in the UI or the build agent, the CLI provides basic support for managing systems, projects, and connections.Creating a System
To create a new system in your current organization:Adding an Auth Scheme to a System
You can add or update an auth scheme configuration for a system.versori systems add-auth-scheme -h to see all available flags for specific auth types).
Adding a System to a Project
To link a system to a project, which creates a connection template:--name you provide here is how your project’s code references the system. You must ensure that this name exactly matches what your code expects when it selects the connection to use.
Listing Systems Linked to a Project
To check the configured connection templates on a project, you can list the linked systems. Using-o yaml provides a detailed view of the connection templates the configured auth schemes on the systems.
-o yaml flag to see a simplified table view:
Creating a Connection
This command connects to the connection template for a specific project. You need to provide the flags for the specified connection template (e.g.,--api-key, --client-id, etc.).
Note on Connection Name: The --name you provide here must be unique. However, unlike the system name, this connection name is only used for your own reference to easily identify the connection. It does not need to be referenced in your code anywhere.
OAuth2 Authorization Code Flow: If the configured auth scheme uses the OAuth2 authorization_code grant type, you do not need to provide any credential flags. Instead, running this command will automatically open your web browser to complete the authentication flow.
Important: The local redirect URL used for this flow is http://127.0.0.1:62168/oauth/callback. You may need to whitelist this redirect URL in your external OAuth2 application settings.
The --bypass flag is special because it ignores the configured auth scheme (if supported by the connection template).
Updating a Connection Template
Once a system is linked to a project, you might need to change the auth scheme that will be used to connect to it. You can update the configured auth schema on a project by updating its connection template:--auth-scheme-config-id is the unique ID of the auth scheme you want to use. This ID is a user-provided string defined when the auth scheme was originally added to the system.
Example:
Before updating, the system example-oauth2 is configured to use the oauth2 auth scheme:
api-key auth scheme instead:
AuthSchemeConfigs.Type has been successfully updated: