Skip to content

Conversation

antoinepalazzolo
Copy link
Member

No description provided.

Comment on lines +21 to +27
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "JSONWebToken",
dependencies: []),
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to add the test target, in order for people to see how to use the package ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test target needs a container app with an entitlement because the library use a keychain hack to create keys, and I don't know how to do that with SPM.
I'm working on a solution without the keychain hack and CryptoKit and I'll add a test target on the package

* crypto_kit_hash:
  use CryptoKit for hash function when running on iOS 13 or later fallback to common crypto for iOS 12 and earlier removed objc compatibility implementation since common crypto module is now available
* fix_alloc_leak:
  fix memory leak when allocating buffer for SHA and HMAC result
@@ -11,7 +11,7 @@ import CryptoKit

extension Data {
func sha(_ hashFunction: SignatureAlgorithm.HashFunction) -> Data {
if #available(iOSApplicationExtension 13.0, *) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a fairly significant change as it means this can no longer be used in an app extension (such as the share extension). Is that really necessary?

@@ -40,7 +40,7 @@ extension Data {
}
}
func hmac(_ hashFunction: SignatureAlgorithm.HashFunction, secret: Data) -> Data {
if #available(iOSApplicationExtension 13.0, *) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a fairly significant change as it means this can no longer be used in an app extension (such as the share extension). Is that really necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants