observe_filestore_credentials_lookup/2

Resolve a local storage path to a remote service, destination and credentials.

Type: first.

#filestore_credentials_lookup{} properties:

  • id: optional resource id, available for resource-specific backend selection.
  • path: backend-relative file path to store, read or delete.

Return {ok, #filestore_credentials{}} or undefined when not handled or no credentials are configured. The standard handler selects the site's configured service using the path; custom observers can also use the resource id.

The returned record contains service (backend identifier), service_url (base URL), location (full destination URL), and credentials (backend-specific secret configuration). These records are defined in zotonic_file.hrl. Do not expose credentials in templates, logs or public API responses. #filestore_credentials{} is a result record, not a separate notification.

See module#mod_filestore for supported services and configuration.

Edit on GitHub

Observed by

Modules

mod_filestore

Store uploaded media and generated previews on S3-compatible storage, FTP/FTPS, or WebDAV. Zotonic keeps a database registry of remote files and serves them…