Skip to main content

Module cloud_sources

Module cloud_sources 

Source
Expand description

Every object store datui can read, as a list of sources rather than one of each kind.

A source is a store plus the login that reaches it: the default S3 settings, a Google login, or an entry in [[cloud.connections]]. Each has an ID, and the ID is what keeps two stores apart when their bucket names collide: two MinIO servers can both have a bucket called data, so a URL from an S3-compatible source names it, s3://<id>@bucket/key. Everywhere else the location is unambiguous and URLs stay the standard ones, so a URL copied out of datui still works in any other tool.

Discovery here reads environment variables and asks whether files exist. It never touches the network: listing is cloud_browse’s job, and it runs on a worker.

Structs§

Resolved
A cloud URL resolved to the plain URL the libraries understand and the settings that reach it.
S3Settings
How to reach one S3 or S3-compatible store.
Source
One store and the login that reaches it.

Enums§

Signing
Whether requests to a place carry a signature.
Tier
Where a source came from. Lower wins when the same ID turns up twice, and sources are listed in this order.

Constants§

DEFAULT_AZURE_ENV
An Azure account named in the environment: a connection string, or an account with a key or SAS token.
DEFAULT_AZURE_LOGIN
A signed-in az.
DEFAULT_GCS
The Google login found in the environment or the application-default file.
DEFAULT_S3
The source built from [cloud] s3_*, --s3-* and the AWS_* environment: what a plain s3://bucket/key has always meant.

Functions§

access_key
The bucket or container url is in, as one string: s3://bucket, s3://<id>@bucket, gs://bucket, abfss://container@account. What is learned about signing is kept per place.
discover
Every source this machine and the config describe, in display order.
endpoint_host
The host and port of an endpoint URL, for display.
expand_azure_short_url
An az://, adl:// or azure:// URL, container/path, as its canonical abfss:// form. These name no account, so it comes from where the URL was typed (inside an account on the home screen), the environment, or the one account in the config. Every other path comes back as it is.
is_within
Whether url is root or somewhere inside it. Azure URLs are compared in their canonical form, and a trailing slash does not matter.
known_access
What this session learned about signing requests to the place url is in: true for unsigned.
on_home
The sources the home screen shows: every [[cloud.connections]] entry, and of the logins found on the machine, the kinds [cloud] discover allows.
profile_source_id
The ID of the source for an AWS profile: aws- and the profile’s name, lowercased, with anything that cannot go in an ID turned into -.
remember_access
Remember for the session whether place (an access_key) is read unsigned.
remember_bucket
Remember that source reaches bucket, for URLs that do not name their source.
remember_listed
Buckets an earlier run listed, remembered as if listed now: a bucket under Recent opens with the login that found it before its source is listed again. Only S3: Google’s first level is projects, and an Azure URL names its account.
resolve
Resolve url against the sources in config and on this machine, with an Amazon S3 bucket’s own region. May run a credential command and ask S3 where the bucket is, so call it on a worker.
resolve_for_open
As resolve, for opening an object. A place whose signing is still Signing::Try is settled first with one unsigned request, since the libraries that open it make many requests and cannot retry them without a signature.
resolve_with
As resolve, with the environment supplied.