mapcache icon indicating copy to clipboard operation
mapcache copied to clipboard

Update S3 cache to read AWS_SESSION_TOKEN env var if present

Open peetw opened this issue 9 months ago • 3 comments

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

peetw avatar May 02 '24 14:05 peetw

@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]

jmckenna avatar May 10 '24 12:05 jmckenna

@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 avatar May 10 '24 13:05 peetw

@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]

peetw avatar May 10 '24 13:05 peetw

@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 avatar May 16 '24 11:05 jmckenna

great, passes, thanks again @peetw !

jmckenna avatar May 16 '24 12:05 jmckenna

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 <[email protected]>
 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 <[email protected]>
 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.

github-actions[bot] avatar May 16 '24 12:05 github-actions[bot]

@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?

peetw avatar May 16 '24 12:05 peetw

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

jmckenna avatar May 16 '24 17:05 jmckenna