Table of Contents

Class ObjectStorageEndpoint

Namespace
MailFathom.Infrastructure.ObjectStorage
Assembly
MailFathom.Infrastructure.dll

Where the deployment's S3-compatible endpoint is, which bucket it holds, and how a request to it is addressed.

public sealed record ObjectStorageEndpoint : IEquatable<ObjectStorageEndpoint>
Inheritance
ObjectStorageEndpoint
Implements
Inherited Members

Remarks

Everything here is composed from configuration and read once, because none of it can change without the client being rebuilt. What is deliberately absent is the credential: it is resolved per use through IObjectStorageCredentialSource, so an access key rotated behind an unchanged reference takes effect on the next call with nothing to invalidate and no restart to schedule.

The address is explicit and so is the signing region, which is the property the whole type exists for. The AWS client resolves both from the environment, a shared credentials file, and an instance metadata service when it is not told them, and a deployment that forgot to configure one would then quietly acquire the host's own identity and reach a metadata endpoint. Region therefore always carries a value — the configured one, or DefaultRegion for an endpoint that has no notion of a region at all — so nothing is ever left for the client to discover.

The key prefix is normalized to end in a single / when it is present, so every consumer composes a key the same way and a shared bucket's prefixes stay disjoint. An empty prefix is an endpoint whose bucket MailFathom has to itself, which is the shape a self-hosted deployment usually takes.

Fields

DefaultRegion

The signing region an endpoint that publishes none is addressed under.

TransportName

The name of the outbound client every request to the endpoint is made through.

Properties

Address

Gets the absolute address requests are sent to.

Bucket

Gets the bucket every object is written into and read from.

ConnectTimeout

Gets how long establishing a connection to the endpoint may take.

KeyPrefix

Gets the prefix every key this deployment writes begins with, ending in /, or the empty string for none.

Region

Gets the region a request is signed under.

RequestTimeout

Gets how long one whole request to the endpoint may take, connection included.

UsePathStyleAddressing

Gets whether the bucket is addressed in the path rather than in the host name.

Methods

ComposeKey(string)

Composes the key an object is stored under, beneath this deployment's own prefix.

Create(Uri, string, string, string, bool, TimeSpan, TimeSpan)

Composes the endpoint a deployment's configuration describes.