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

Replace String/byte[] with (N)IO streams #838

Merged
merged 40 commits into from
Sep 27, 2023
Merged

Replace String/byte[] with (N)IO streams #838

merged 40 commits into from
Sep 27, 2023

Commits on Sep 18, 2023

  1. Closes #837

    Created new Writer/Reader concepts with backing implementations and tests, and deprecated the respective Serializer/Deserializer concepts.
    
    Each Serializer/Deserializer implementation now subclasses/extends their respective parent Writer/Reader implementation out of convenience.  Serializer/Deserializer are not (currently) subinterfaces of Writer/Reader to avoid forcing new implementation requirements on existing implementations.
    lhazlewood committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    dc13b04 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cda9a13 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3654934 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5432dcd View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. - Changed TokenizedJwt and TokenizedJwe interfaces and implementation…

    …s to return CharSequences instead of Strings to avoid creating new Strings on the heap
    
    - Changed internal Base64 implementation to work with a CharSequence instead of a raw char[] to reduce need to create new arrays on the heap
    - Changed Base64Decoder generics signature from Decoder<String,byte[]> to Decoder<CharSequence,byte[]>
    - Decoders.BASE64 and Decoders.BASE64URL now reflect Decoder<CharSequence,byte[]>
    - Changed Strings#utf8 implementation to accept a CharSequence instead of a String
    - Added new Strings#wrap to wrap a CharSequence into a CharBuffer if necessary
    - Replaced not-yet-released JwtBuilder#serializer method with JwtBuilder#jsonWriter
    - Replaced not-yet-released JwtParserBuilder#deserializer method with JwtParserBuilder#jsonReader
    - Moved JwtDeserializer from io.jsonwebtoken.impl to io.jsonwebtoken.impl.io package, and updated its implementation to work with the new io.jsonwebtoken.io.Writer concept
    - Updated GsonSerializer, GsonDeserializer, JacksonSerializer, JacksonDeserializer, and OrgJsonSerializer and OrgJsonDeserializer implementations to use JDK 7+ 'try with resources' try block instead of try/finally
    lhazlewood committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    1bc91d7 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. - Added license header

    lhazlewood committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    edb397c View commit details
    Browse the repository at this point in the history
  2. - Renamed JwtDeserializer to JsonObjectDeserializer that defaults to …

    …throwing MalformedJwtException. Added two subclasses, JwkDeserializer and JwkSetDeserializer that throws JWK and JWK Set-specific exceptions.
    
    - Changed ParserBuilder#deserializer method name to ParserBuilder#jsonReader
    lhazlewood committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    e45c27f View commit details
    Browse the repository at this point in the history
  3. - Removed all usages of Serializer#serialize and Deserializer#deseria…

    …lize except for deprecated implementations. All other usages now use Writer/Reader concepts
    
    - Added Jwks#json and Jwks#UNSAFE_JSON for assistance in serializing JWKs to JSON (test cases, README examples, etc)
    lhazlewood committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    475c6ff View commit details
    Browse the repository at this point in the history
  4. - Added license header

    lhazlewood committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    8cc2940 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    86364bd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8cf53fc View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. - Ensured Encoder and CompressionAlgorithm supported streams instead …

    …of just byte arrays
    
    - Copied over necessary (Apache-licensed) code from Apache commons-codec to obtain Base64OutputStream and Base64InputStream capability for efficient encoding during compact JWT creation.  Hopefully this is temporary and we can strip out most if not all of this and modify our existing Base64.java class for simpler support since we have many less use cases than what commons-codec supports.
    lhazlewood committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    41bac49 View commit details
    Browse the repository at this point in the history
  2. - Added license header

    lhazlewood committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    40dfebf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b17bfb9 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2023

  1. - Added JwtBuilder InputStream payload support: added JwtBuilder#cont…

    …ent(InputStream), JwtBuilder#content(InputStream, String contentType), JwtBuilder#content(String, String contentType)
    
    - Added CountingInputStream as a way to check and assert that b64/unencoded payload InputStreams cannot be empty.
    - 100% code coverage checkpoint
    lhazlewood committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    0a44dc4 View commit details
    Browse the repository at this point in the history
  2. Fixed erroneous JavaDoc

    lhazlewood committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    4408369 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2023

  1. - 100% coverage checkpoint. However:

      - New JwtParser parseContentJws(String,InputStream) methods still need JavaDoc.
      - Still need to make AeadAlgorithm InputStream-based
    lhazlewood committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    c151046 View commit details
    Browse the repository at this point in the history
  2. - 100% coverage checkpoint, with:

      - New JwtParser parseContentJws(String,InputStream) methods are JavaDoc'd
      - Decompression is streaming when payload is consumable
    
    Note: Still need to make AeadAlgorithm InputStream-based
    lhazlewood committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    6b9db7d View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Configuration menu
    Copy the full SHA
    14e78f5 View commit details
    Browse the repository at this point in the history
  2. 100% coverage checkpoint

    lhazlewood committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    c9e61b4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eaa897d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81e2df1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    49cf31b View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. - Renamed Encoder/Decoder and CompressionAlgorithm 'wrap' methods to …

    …encode/decode/compress/decompress for better readability and to make clearer the intent of the method. Also to avoid name/text/search collisions with 'wrap' references.
    lhazlewood committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    90b37e2 View commit details
    Browse the repository at this point in the history
  2. - Was able to move the commons-codec-related code to the impl module …

    …(ideally didn't want to expose this implementation detail to the API).
    lhazlewood committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    595bb69 View commit details
    Browse the repository at this point in the history
  3. fixed license headers

    lhazlewood committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    9f19f0e View commit details
    Browse the repository at this point in the history
  4. Removed recently added Reader/Writer concepts for just overloaded met…

    …hods in existing Serializer/Deserializer interfaces. This results in less change and is probably more intuitive for existing library users.
    lhazlewood committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    7fb7b79 View commit details
    Browse the repository at this point in the history
  5. Renamed new JwtBuilder#encoder and JwtParserBuilder#decoder methods t…

    …o JwtBuilder#b64Url and JwtParserBuilder#b64Url for shorter method chains
    lhazlewood committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    a49e64e View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2023

  1. Configuration menu
    Copy the full SHA
    f0f8078 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    096613f View commit details
    Browse the repository at this point in the history
  3. Triggering CI build

    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    19dfcd3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    523d37b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    54ed38a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    48f2b31 View commit details
    Browse the repository at this point in the history
  7. readability cleanup

    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    1ecca31 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fae29c7 View commit details
    Browse the repository at this point in the history
  9. Fixed license headers

    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    b2a3fec View commit details
    Browse the repository at this point in the history
  10. AeadAlgorithm streams checkpoint 3: AAD is now an InputStream

    remaining: change AeadAlgorithm#encrypt to receive AeadResult as a 2nd argument (like HttpServlet API)
    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    dad664a View commit details
    Browse the repository at this point in the history
  11. - Changed AeadAlgorithm#encrypt to receive AeadResult as a 2nd argument

    - Changed AeadAlgorithm#decrypt to receive an OutputStream as a 2nd argument
    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    f732971 View commit details
    Browse the repository at this point in the history
  12. - Renamed InitializationVectorSupplier to IvSupplier (was verbose, an…

    …d it's not commonly referenced in the API, so the extra verbosity isn't needed)
    lhazlewood committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    826aa54 View commit details
    Browse the repository at this point in the history