bebcb6453c54164564b24899c6f407310b551a93 max Thu Jan 5 06:37:34 2023 -0800 first go at s3:// support, refs #30445 adding cache file to UDC protocol support, refs #30445 handling expired presigned URLs in udc protocol, refs #30445 diff --git src/inc/udc.h src/inc/udc.h index 5460ce2..ddfcf58 100644 --- src/inc/udc.h +++ src/inc/udc.h @@ -106,30 +106,33 @@ * Free all *ret's except *retColon when done. */ void udcParseUrlFull(char *url, char **retProtocol, char **retAfterProtocol, char **retColon, char **retAuth); /* Parse the URL into components that udc treats separately. * *retAfterProtocol is Q-encoded to keep special chars out of filenames. * Free all *ret's except *retColon when done. */ char *udcDefaultDir(); /* Get default directory for cache. Use this for the udcFileOpen call if you * don't have anything better.... */ void udcSetDefaultDir(char *path); /* Set default directory for cache */ +void udcSetResolver(char *prots, char *cmd); +/* Set protocols and local wrapper program to resolve s3:// and similar URLs to HTTPS */ + void udcDisableCache(); /* Switch off caching. Re-enable with udcSetDefaultDir */ #define udcDevicePrefix "udc:" /* Prefix used by convention to indicate a file should be accessed via udc. This is * followed by the local path name or a url, so in common practice you see things like: * udc:http://genome.ucsc.edu/goldenPath/hg18/tracks/someTrack.bb */ struct slName *udcFileCacheFiles(char *url, char *cacheDir); /* Return low-level list of files used in cache. */ char *udcPathToUrl(const char *path, char *buf, size_t size, char *cacheDir); /* Translate path into an URL, store in buf, return pointer to buf if successful * and NULL if not. */ @@ -171,17 +174,23 @@ void udcSetLog(FILE *fp); /* Tell UDC where to log its statistics. */ void udcMMap(struct udcFile *file); /* Enable access to underlying file as memory using mmap. udcMMapFetch * must be called to actually access regions of the file. */ void *udcMMapFetch(struct udcFile *file, bits64 offset, bits64 size); /* Return pointer to a region of the file in memory, ensuring that regions is * cached.. udcMMap must have been called to enable access. This must be * called for first access to a range of the file or erroneous (zeros) data * maybe returned. Maybe called multiple times on a range or overlapping * returns. */ +//void setUrlResolver(char *prot, char* cmd); +/* Define a command that can be used to resolve a protocol like "s3" to a final URL */ + + +bool udcIsResolvable(char *url); +/* check if third-party protocol resolving (e.g. for "s3://") is enabled and if a URL can be resolved this way to HTTP */ #endif /* UDC_H */