-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add support for Linux #221
Conversation
d8c836f
to
8a42780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed PR description, that makes reviewing this high quality PR much easier! I love that we can remove the responsibility of JWT handling to Apple's framework.
Since this is a breaking change, I'll release this under a major version bump. 👌
Code Coverage Report
SwiftLint found issues
Generated by 🚫 Danger Swift against 470c618 |
Thanks a lot for the quick review 🚀 |
@Shakarang could you have a look at the tests? 🙏 |
All good now, thanks @AvdLee 🥳 |
Hello!
We've added support for Linux in the package to allow anyone to use it on CI. There were two issues to fix:
URLSession
APIs are not part of FoundationCommonCrypto
does not exist on LinuxURLSession
URLSession
is part ofFoundationNetworking
framework on Linux. We've added the import when the framework exists.CommonCrypto
As
CommonCrypto
is not available on Linux, we had to use another way to sign the JWT token. We're using Apple made swift-crypto. It removes a lot of manual operations as the signature is available in their framework.This framework requires macOS 11, so adding it would drop support for macOS 10.15. However, as the latest Xcode only supports macOS 12, this can be acceptable.
API Changes
We've updated the
APIConfiguration
initialiser to make it throwable when the given key is not valid. This allows to build the private key only once, and throw an error as soon as possible when we know the key is not correct.