This request is in the context of Paketo's apache-tomcat buildpack.
We are trying to use a presigned S3 url to download tomcat external configurations, setting the url as the value for the environment variable BP_TOMCAT_EXT_CONF_URI. Internally the buildpack calls libpak. DependencyCache's Artifact function.
This function sets the name of the downloaded artifact based on the value returned by the filepath.Base(uri) function call.
However, if we use an http uri with query parameters this call will try to set the filename with the query parameters included.
In our case, the S3 presigned url we are using has very long query parameter values, and when libpak tries to save the downloaded file with these parameters included in the filename, it runs into file name too long error.
Possible Solution
We can parse the uri using net/url's Parse function and then get the clean uri without the query parameters using the Path property. We can also put checks to ensure this is done only for http/https URIs.
Motivation
This would add support for presigned S3 urls to the Tomcat buildpack to provide external configurations.
We already have a PR drafted, let us know if we can mark it ready for review.
Describe the Enhancement
This request is in the context of Paketo's apache-tomcat buildpack. We are trying to use a presigned S3 url to download tomcat external configurations, setting the url as the value for the environment variable
BP_TOMCAT_EXT_CONF_URI
. Internally the buildpack calls libpak. DependencyCache'sArtifact
function. This function sets the name of the downloaded artifact based on the value returned by thefilepath.Base(uri)
function call. However, if we use an http uri with query parameters this call will try to set the filename with the query parameters included.In our case, the S3 presigned url we are using has very long query parameter values, and when
libpak
tries to save the downloaded file with these parameters included in the filename, it runs into file name too long error.Possible Solution
We can parse the uri using net/url's
Parse
function and then get the clean uri without the query parameters using thePath
property. We can also put checks to ensure this is done only for http/https URIs.Motivation
This would add support for presigned S3 urls to the Tomcat buildpack to provide external configurations.
We already have a PR drafted, let us know if we can mark it ready for review.