Review main Merged

66075[TASK] Add base64url encode/decode functionality

Oliver Hader CR +2 V +2 Normal +87 −0 updated 09/26/22, 10:42

Commit message

Add static library functions that allow using base64url-compliant
values (according to https://tools.ietf.org/html/rfc4648#section-5).

The difference to classic base64 is, that the result alphabet is
adjusted like shown below, padding (`=`) is stripped completely:

 + position #62: `+` -> `-` (minus)
 + position #63: `/` -> `_` (underscore)

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 3138

Show 1013 earlier messages
  1. Oliver Hader uploaded patch set 1 10/07/20, 18:06

  2. TYPO3com voted on patch set 1 V +1 10/07/20, 18:18 Completed build in 12m 08s on Wed, 7 Oct, 06:18 PM Test Summary: 73860 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6337

  3. Oliver Hader marked it work in progress 10/07/20, 19:56

  4. Oliver Hader commented on patch set 1 05/20/21, 16:59

    StringUtility.php:162

    $pad = false per default

    StringUtilityTest.php:358

    add more encoding tests
  5. Oliver Hader commented on patch set 1 06/16/21, 12:24

  6. Oliver Hader commented on patch set 1 06/16/21, 12:26

    Reply

    > rebase, once https://review.typo3.org/c/Packages/TYPO3.CMS/+/69503 is merged Wrong change-set...
  7. Benni Mack wrote 11/29/21, 10:05

    Change destination moved from master to main
  8. Benni Mack updated the commit message in patch set 2 11/29/21, 13:22

  9. Simon Schaufelberger uploaded patch set 3 04/26/22, 19:21

  10. Simon Schaufelberger uploaded patch set 4 04/26/22, 19:32

  11. Simon Schaufelberger commented on patch set 4 04/26/22, 19:33

    StringUtility.php:162 Reply

    Done
  12. core-ci voted on patch set 4 V +1 04/26/22, 19:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26473

  13. core-ci voted on patch set 3 V +1 04/26/22, 19:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26472

  1. Oliver Hader uploaded patch set 5 09/26/22, 08:09

  2. Oliver Hader commented on patch set 5 09/26/22, 08:10

    This change is ready for review.
  3. Oliver Hader commented on patch set 5 09/26/22, 08:12

    StringUtilityTest.php:358 Reply

    Done
  4. core-ci voted on patch set 5 V -1 09/26/22, 08:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31527

  5. Oliver Klee commented on patch set 6 09/26/22, 08:27

    Published edit on patch set 5.
  6. core-ci voted on patch set 6 V +1 09/26/22, 08:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31528

  7. Markus Klein voted on patch set 6 CR +1 09/26/22, 08:59

  8. Markus Klein voted on patch set 6 V +1 09/26/22, 08:59

  9. Benjamin Franzke commented on patch set 6 09/26/22, 09:11

    StringUtility.php:136

    I think web-safe is too generic. Maybe: "URL and filename safe encoded"

    StringUtility.php:150

    doesn't matter much probably, but in other projects we usually use: ['+', '/', '='], ['-', '_', ''] to avoid the separate rtrim() call. I don't have a strong opinion on that though..
  10. Oliver Hader commented on patch set 6 09/26/22, 09:27

    StringUtility.php:136 Reply

    "Returns base64 with an URL and filename safe alphabet" (taken from the RFC)?

    StringUtility.php:150 Reply

    I also spotted e.g. https://github.com/firebase/php-jwt/blob/main/src/JWT.php#L378-L407 (I don't see a necessity for re-adding the padded `=` chars). I'm fine to adjust that.
  11. Oliver Hader uploaded patch set 7 09/26/22, 09:32

  12. Benjamin Franzke commented on patch set 6 09/26/22, 09:38

    StringUtility.php:136 Reply

    Ack

    StringUtility.php:150 Reply

    I think we should not readd padding. as PHP does that in C-code, we won't be faster doing it manually. Also, PHP does it to comply with the RFC, so this behaviour will not change as is it intended: > In some circumstances, the use of padding ("=") https://github.com/php/php-src/blob/e6831dbd8241f41254f8ffe61f196fc3c56a4046/ext/standard/base64.c#L310-L314
  13. Oliver Hader commented on patch set 7 09/26/22, 09:40

    StringUtility.php:136 Reply

    Done

    StringUtility.php:150 Reply

    Ack
  14. Simon Schaufelberger commented on patch set 7 09/26/22, 09:40

  15. core-ci voted on patch set 7 V +1 09/26/22, 09:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31531

  16. Oliver Hader commented on patch set 7 09/26/22, 09:43

    StringUtility.php:150 Reply

    `class Cursor implements Arrayable`... that's different scope... anyway, we are just talking about tweaks here - the result is the same.
  17. Oliver Hader commented on patch set 7 09/26/22, 09:44

    StringUtility.php:150 Reply

    Done
  18. Simon Schaufelberger commented on patch set 7 09/26/22, 09:57

    StringUtility.php:150 Reply

    This class is used for pagination and the highlighted lines are doing exactly the same: encoding and decoding of base64 urls
  19. Oliver Hader commented on patch set 7 CR -1 09/26/22, 10:00

    Tweaking...
  20. Oliver Hader uploaded patch set 8 09/26/22, 10:06

  21. core-ci voted on patch set 8 V +1 09/26/22, 10:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31533

  22. Simon Schaufelberger voted on patch set 8 V +1 CR +1 09/26/22, 10:17

  23. Benjamin Franzke voted on patch set 8 V +1 CR +1 09/26/22, 10:31

  24. Oliver Hader voted on patch set 8 V +2 CR +2 09/26/22, 10:41

  25. Oliver Hader merged patch set 9 09/26/22, 10:42