Skip to content
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

Presigned URL - Expiry limit from milliseconds to seconds and epoch fixes + automatic tests #8503

Merged

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Nov 4, 2024

Explain the changes

In #8493 changes there were 2 issues -

  1. In The limit expiry check we compared ms to seconds - https://github.com/noobaa/noobaa-core/pull/8493/files#diff-6057509d5491e754e912f9e7b08644473aa76a97fb526d7e1ecfce6e9e593c7dR299, fixed this issue.
  2. Epoch seconds case - When req.query.Expires has value - we use Epoch date in seconds and not seconds expiry, therefore had to calculate the number of seconds between now and Expires epoch, which means: const expiry_seconds = req.query.Expires - Math.ceil(Date.now() / 1000); in order to compare the limit on epoch case correctly.
  3. Added presigned url test cases for both epoch/ seconds flows in test_bucketspace.js

Issues: Fixed #xxx / Gap #xxx

  1. Fixed pre signed url is not accessible after 15 mins, throws clock skew error #8490

Testing Instructions:

  1. sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha /github/noobaa-core/src/test/unit_tests/test_bucketspace.js -g 'Presigned URL tests'
  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-remove-skew-from-presigned-url branch from 19b078e to 14a4632 Compare November 4, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pre signed url is not accessible after 15 mins, throws clock skew error
2 participants