-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Auth (custom headers & query parameters) #5
Comments
getSourceOptions has been made available for all sources, which allows implementors to customize the sources. |
It would be wonderful if |
I don't understand this yet. What you elaborate with an example? Here's an example to adapt the header: For GeoTiff specifically it is fortunately possible via getSourceOptions. You can use the headers object: Something like this should work: async getSourceOptions(type, options) {
if (type === SourceType.GeoTIFF) {
const token = await getToken(...); // Assign your token here...
options.sourceOptions = options.sourceOptions || {};
options.sourceOptions.headers = {
Authorization: `Bearer ${token}`
};
}
return options;
} For customizing the URL, there's an example here: Is there still anything missing in addition to this? |
@m-mohr see https://github.com/protomaps/PMTiles/pull/261/files TBH I am not 100% sure we should be going down this path. It seems like presigned URLs are strictly better, and don't require any custom header support for the generic S3-compatible API case. If we attempt to sign a URL dynamically using awsv4 signature algorithm, from what I can see every individual HTTP request with a unique Is there a specific storage system that ONLY takes |
We have services which don't have signed URLs, but instead use Authorization headers (e.g. Planet, I think). It's not really just aboiur storage systems such as S3 here, we have many APIs which just work with API keys or Bearer tokens - unfortunately. |
Is there one you know of that I can test with, or that you have access to upload to? |
Unfortunately not, sorry. |
ol-pmtiles v0.3.0 takes a |
Allow to intercept the request and append custom HTTP headers and query parameters to each request, including geotiff.js and pmtiles.
The text was updated successfully, but these errors were encountered: