Skip to main content

Module cloud_browse

Module cloud_browse 

Source
Expand description

Finding the object stores this machine can already read, and listing what is in them.

datui could open a gs:// or s3:// URL long before this module existed, but only if you already knew the URL and typed it. That is a poor fit for how object storage is actually used: the bucket names live in somebody’s head, or in a console tab, and the thing you want on a home screen is the same thing you want for a local directory — a list of what is there.

Two rules shape everything here.

Never list a provider datui cannot then read. Discovery deliberately looks at exactly the credentials object_store will use when the file is opened, and nowhere else. It would be easy to enumerate buckets through gcloud, which is authenticated on most developer machines when nothing else is, and the result would be a screen of buckets that every Enter fails on. A provider that is invisible because its credentials are missing is a smaller problem than one that lies.

Nothing here runs on the thread that draws. Every function that touches the network is async and is driven from a worker, the same arrangement remote filesystem roots use. A bucket list is a network round trip, and a round trip on the event thread is a frozen interface.

Structs§

Environment
Everything discovery is allowed to look at, gathered in one place so it can be supplied verbatim by a test.
InstanceIdentity
Which clouds’ VM or platform identity may be used. Finding one is a request to a metadata service that hangs on some networks, so it is only made when the config asks, or where the platform itself says it is there: K_SERVICE on Cloud Run and Cloud Functions, IDENTITY_ENDPOINT or MSI_ENDPOINT on Azure App Service, Functions and Container Apps. ECS and EKS need neither: they are found by their own variables.
Level
What one level of a place listed.
Listed
A source’s first level, as the home screen lists it: buckets for S3 and Google Cloud, storage accounts for Azure.
Provider
An object store datui believes it can read, and why it believes that.
Watch
How a listing is watched while it runs.

Enums§

ProviderKind
Which API a provider speaks. Not which company runs it: MinIO, Ceph, R2 and AWS itself are all ProviderKind::S3, and are told apart by their endpoint.

Constants§

MAX_LEVEL_ROWS
The most rows one level of a bucket lists, as for a local directory: past it the listing stops and says so. A prefix of 141,000 partitions is otherwise 141 requests and every one of them held in memory before the first row is drawn.

Functions§

adc_path
The application default credentials file, where object_store reads it: %APPDATA%\gcloud\ on Windows, $HOME/.config/gcloud/ elsewhere. Kept in step with object_store::gcp deliberately: discovery must agree with the code that will later do the opening, and looking under the home directory on Windows found nothing.
detect
Object stores this machine can read, in the order they should appear.
gcs_next_page_token
The pageToken for the next page of a bucket list, when the response has one.
instance_identity
is_empty_marker
An empty object with no extension: a marker some tool left for a folder, whether or not the directory still has anything in it (yellow/year=2032 beside no year=2032/). Nothing datui opens is both empty and nameless.
is_marker
A key that stands for something other than data a user could open: the receipts a job leaves behind, and the marker some tools write in place of a folder.
is_refusal
Whether an error is the service refusing the request, rather than failing to answer.
list_account
The containers of one account in an Azure source, as rows to step into.
list_buckets
Every bucket the provider’s credentials can see.
list_first_level
Everything at the top of a source.
list_objects
One level of a bucket or prefix, as home-screen rows, up to MAX_LEVEL_ROWS.
list_objects_watched
list_objects, a page at a time: watch sees the rows as they come and can stop the listing between pages.
look_at_listing
The kind and what the listing found, as crate::discover::look_at_directory gives them for a local directory. A prefix’s row is labelled from the second.
narrowing_prefix
The server-side prefix a home filter can ask a cut-short level for, or None when it cannot ask for one.
object_path
The object_store path for a key as the service stores it.
pager_for_bucket
store_for_bucket, as the store that lists a page at a time.
parse_gcs_buckets
Bucket names from a Google Cloud Storage storage/v1/b response.
parse_s3_buckets
Bucket names from an S3 ListBuckets response.
peek_kind
What a cloud directory holds, from the first page of a delimited listing of it: Hive when its children are key=value partitions, MultiFile when they are Parquet files, else Directory. One request; nothing is read from any object.
probe_unsigned
Whether the place resolved points at can be read with no signature: Some(true) when an unsigned request succeeds, Some(false) when it is refused, None when the answer says neither (no network, a missing object, a custom endpoint).
s3_bucket_region
Where Amazon S3 keeps bucket, from the x-amz-bucket-region header S3 sends with no credentials, whatever the status. Asked once per bucket per session, and None when S3 does not say.
s3_builder
The S3 builder datui uses everywhere, so that every path authenticates identically.
split_bucket_url
Split a gs:// or s3:// URL into its bucket and the prefix inside it.
store_for_bucket
An object store for a bucket, with no key.
unreadable_google_login
The credential type of a Google login object_store cannot read, when that is what the environment or the application-default file holds: workload identity federation, an impersonated service account.

Type Aliases§

Progress
What a listing hands the rows it has so far.