
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
[!WARNING] This SDK is incubating and subject to change.
The External Systems library is Python SDK built as an interface to reference Foundry Sources from code.
You can install the Python package using pip
:
pip install external-systems
For REST based sources, a preconfigured HTTP client is provided built on top of the Python requests library. For on-prem systems using Agent Proxy the client will be pre-configured with the corresponding proxy
from external_systems.sources import Source, HttpsConnection
from requests import Session
my_source: Source = ...
https_connection: HttpsConnection = my_source.get_https_connection()
source_url: str = https_connection.url
http_client: Session = https_connection.get_client()
response = http_client.get(source_url + "/api/v1/example/", timeout=10)
Source secrets can be referenced using get_secret("<secret_name>")
on the source.
from external_systems.sources import Source
my_source: Source = ...
some_secret: str = my_source.get_secret("SECRET_NAME")
For sources using session credentials we support credentials generation and refresh management. Currently on an S3 source you can access session credentials using get_aws_credentials()
. This method will throw if the source is not pre-configured with AwsCredentials
Session credentials may not be available in all Foundry runtime environments
from external_systems.sources import Source, Refreshable, AwsCredentials
s3_source: Source = ...
refreshable_credentials: Refreshable[AwsCredentials] = s3_source.get_aws_credentials()
session_credentials: AwsCredentials = refreshable_credentials.get()
For non-HTTP connections to external systems that require connections through Foundry's agent proxy, a pre-configured socket is provided.
For this example we'll be using the fabric library
import fabric
from external_systems.sources import Source
from socket import socket
SFTP_HOST = <sftp_host>
SFTP_PORT = <sftp_port>
on_prem_proxied_source: Source = ...
username: str = on_prem_sftp_server.get_secret("username")
password: str = on_prem_sftp_server.get_secret("password")
proxy_socket: socket = source.create_socket(SFTP_HOST, SFTP_PORT)
with fabric.Connection(
SFTP_HOST,
user=username,
port=SFTP_PORT,
connect_kwargs={
"password": password,
"sock": proxy_socket,
},
) as conn:
sftp = conn.sftp()
file_list = sftp.listdir(".")
For more granular use cases a pre-authenticated proxy URI is provided to allow connections to on-prem external systems.
We'll be using the httpx library.
import httpx
from external_systems.sources import Source
on_prem_system: Source = ...
authenticated_proxy_uri: str = on_prem_system.get_https_proxy_uri()
with httpx.Client(proxy=authenticated_proxy_uri) as client:
...
FAQs
A Python library for interacting with Foundry Sources
We found that external-systems demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.