MapServer / mapcache

MapCache source code directory. Please submit pull requests to the 'main' branch.
https://mapserver.org/mapcache
Other
137 stars 96 forks source link

Update S3 cache to read AWS_SESSION_TOKEN env var if present #339

Closed peetw closed 4 months ago

peetw commented 5 months ago

Also increases the line buffer when reading the S3 credentials file to ensure that the session token isn't truncated

jmckenna commented 4 months ago

@peetw it is failing for Windows, somewhere around line# 875:

D:\a\mapcache\mapcache\lib\cache_rest.c(875,25): error C2057: expected constant expression [D:\a\mapcache\mapcache\build\mapcache.vcxproj]
D:\a\mapcache\mapcache\lib\cache_rest.c(875,25): error C2466: cannot allocate an array of constant size 0 [D:\a\mapcache\mapcache\build\mapcache.vcxproj]
D:\a\mapcache\mapcache\lib\cache_rest.c(875,26): error C2133: 'line': unknown size [D:\a\mapcache\mapcache\build\mapcache.vcxproj]
peetw commented 4 months ago

@jmckenna woops, been too long since I programmed in C and not C++ (where you can use const vars to init array size) 😅 Should be fixed now

peetw commented 4 months ago

@jmckenna hmm, the build is still failing, but doesn't seem to be related to anything I've changed:

D:\a\mapcache\mapcache\lib\util.c(51,27): error C2371: 'uint64_t': redefinition; different basic types [D:\a\mapcache\mapcache\build\mapcache.vcxproj]
jmckenna commented 4 months ago

@peetw can you merge in the recent changes from the main branch, into this pull request? (to see if that fixes the Windows issue)

jmckenna commented 4 months ago

great, passes, thanks again @peetw !

github-actions[bot] commented 4 months ago

The backport to branch-1-14 failed:

The process '/usr/bin/git' failed with exit code 128
stderr ``` error: commit bfc71de778d690c79f5870ab7ed5861ce310f951 is a merge but no -m option was given. fatal: cherry-pick failed ```
stdout ``` [backport-339-to-branch-1-14 3e90691] Update S3 cache to read AWS_SESSION_TOKEN env var if present Author: Peet Whittaker Date: Thu May 2 15:13:01 2024 +0100 1 file changed, 9 insertions(+), 1 deletion(-) [backport-339-to-branch-1-14 ce96248] Increase line buffer size when reading S3 credentials file Author: Peet Whittaker Date: Thu May 2 15:52:56 2024 +0100 1 file changed, 6 insertions(+), 4 deletions(-) ```

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-branch-1-14 branch-1-14
# Navigate to the new working tree
cd .worktrees/backport-branch-1-14
# Create a new branch
git switch --create backport-339-to-branch-1-14
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick d9e53aae661aa7826584104d363759f0e0f26b8b,33d9549c6bc66ea0b1fa8a1ae7126159dc308ec9,bfc71de778d690c79f5870ab7ed5861ce310f951
# Push it to GitHub
git push --set-upstream origin backport-339-to-branch-1-14
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-branch-1-14

Then, create a pull request where the base branch is branch-1-14 and the compare/head branch is backport-339-to-branch-1-14.

peetw commented 4 months ago

@jmckenna no problem! As a related question, what's the release schedule like for MapCache? Just wondering when and in which version(s) this would be available in?

jmckenna commented 4 months ago

@peetw good point, I've updated the release milestone accordingly, thanks.