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

V5 #107

Merged
merged 32 commits into from
Feb 21, 2024
Merged

V5 #107

merged 32 commits into from
Feb 21, 2024

Conversation

* Start moving away from BoringSSL

* Start converting RSA

* Update RSA signer

* Some fixes

* Add possible RSA pubkey creation algorithm

* Add prime number generator with Miller-Rabin test

* Prime generation performance improvement

* Attempt at private key calculation

* RSA prime generation take 2

* API tidy up

* Performance improvements

* Even more speed

* RSA tidy up

* Fix JWTSigner with new RSA impl

* Add RSA tests and polish some stuff

* Remove unused method

* Minor improvements

* Add GCD test

* Get ECDSA compiling

* Add key gen test + fixups

* Add RSA cert support + enforce bigger key sizes

* Start adding ECDSA tests

* Generify ECDSAKey

* Abstract more and add P384 and P521 keys

* Adapt curve sizes

* Fix some tests

* Base64URL decode raw key elements

* Update byteRange names

* Remove BoringSSL

* Update error description

* Fix wrong overload resolution

* Add padding option for RSA signer

* Update platform versions and start converting X5C

* Convert X5CVerifier and X5CTests (SHA256)

* Add certificate creation scripts

* Fix comment

* Address most requested issues

* Add docs and replace struct with tuple

* Remove valid X5C print statement

* Remove `rsa_oaep_misc_test` test vectors

* Performance improvements

* Remove unused files

* Apply suggestions

* 🤦‍♂️

* Minor fixes

* Refactor RSA init

* Make RSAKey a struct and update docs
@ptoffy ptoffy added the semver-major Breaking changes label Oct 28, 2023
@ptoffy ptoffy self-assigned this Oct 28, 2023
This was linked to issues Oct 28, 2023
* Implement `JWTKeyCollection` and hide `JWTSigner`

* Make `JWTSigner` `Sendable`

* Add comments and remove unused method

* Add warning when overwriting kid

* Remove `JWTSigners`

* Make `JWKSigner` `Sendable`

* Cleanups

* Update DocC comments

* Minor improvements
@ptoffy ptoffy linked an issue Nov 5, 2023 that may be closed by this pull request
ptoffy and others added 8 commits November 5, 2023 20:53
Add RS256 pre-generated token test
* Add `Sendable` support

* Add Sendable conformance to tests

* Make X5CVerifier a struct

---------

Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>
* Add support for custom time validation X5Cs

* Clean up and move JSONDecoder settings out of X5C

* Add more assertions in new X5C test

* Refactor X5CTests
* Add ECDSAKey PEM export

* Use public key from private when possible

* Refactor ECDSAKey init
@ptoffy ptoffy removed a link to an issue Nov 11, 2023
ptoffy and others added 3 commits November 12, 2023 00:32
Start removing exports
* Adopt `package` access and add RSA key PEM export

* Remove unused code

* Make equatable conformance public

* Optimise RSAKey Equatable implementation
ptoffy and others added 3 commits November 16, 2023 17:30
* Start removing enums

* Update JWTError

* Add custom decoding for new structs

* Adopt a more structured JWTError

* Minor improvements

* Test integration with v5 of JWT

* Make JWK use existing curves

* Nit: spacing

---------

Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>
* Add RSA-PSS signature algorithm support

* Add PSS signers and tests

* Replace `Data(contentsOf:)` with `URLSession`

* Remove Apple jwks test

* Fix keycollection's getSigner method

* Fix keycollection's getSigner method

---------

Co-authored-by: Paul <paultoffoloni@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e05513b) 74.91% compared to head (87561f1) 68.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
- Coverage   74.91%   68.85%   -6.06%     
==========================================
  Files          45       59      +14     
  Lines        1136     1554     +418     
==========================================
+ Hits          851     1070     +219     
- Misses        285      484     +199     

see 55 files with indirect coverage changes

ptoffy and others added 12 commits November 20, 2023 09:56
* Add option to sign tokens with x5c chains

* Add new test and fixes
* Add option to fetch RSA primitives

* Typo

* Remove unused files

* Update NOTICES
* Create first idea of split RSA keys

* Refactor signer and update docs

* Split ECDSA keys

* Remove useless parameter

* Update EdDSA

* Rename file

* Adjust spacing

* Remove useless implementations

* Clean up some access modifiers

* Move RSA to insecure namespace
* Add customisable fields to JWTHeader

* Remove unused field

* Fix en/decoding logic and add remove `package` use

* Make customFields not optional

* Add correct init to JWTHeader

* Fix CodingKey mismatch

* Remove `CaseIterable` conformance

* Fix
* Improve header structure

* Allow for custom JWT de/serialisation

* Make properties return nil instead of throwing

* Make the new API easier to use

* Add platform-agnostic de/compression algorithms

* Remove unnecessary test
Add 2048 bits key size boundary for RSA keys
@ptoffy ptoffy added this to the v5 milestone Feb 19, 2024
ptoffy and others added 2 commits February 21, 2024 10:12
* Start updating README

* Update badges in README

* Update CODEOWNERS

* Update README.md

Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>

* Update DocC

* Update docs

* Un-fancy JSON...

* Revert README header upgrade

* Add custom parsing/serialising comments

---------

Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>
Add some test to get coverage up
This was unlinked from issues Feb 21, 2024
@ptoffy ptoffy marked this pull request as ready for review February 21, 2024 16:12
@0xTim 0xTim merged commit 12391f9 into main Feb 21, 2024
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major Breaking changes
Projects
None yet
5 participants