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

appAppleId is required for verification in production environment but it's easy to miss #34

Closed
shimastripe opened this issue Feb 18, 2024 · 3 comments

Comments

@shimastripe
Copy link
Contributor

WHY

  • appAppleId is nil in readme sample code.
// try! used for example purposes only
let verifier = try! SignedDataVerifier(rootCertificates: appleRootCAs, bundleId: bundleId, appAppleId: nil, environment: environment, enableOnlineChecks: enableOnlineChecks)
  • This code works fine in the sandbox environment, but not in the production environment.
    • Because SignedDataVerifier is checked appAppleId in production environment.
  • if self.bundleId != bundleId || (self.environment == .production && self.appAppleId != appAppleId) {
    return VerificationResult.invalid(VerificationError.INVALID_APP_IDENTIFIER)
  • It's easy to miss, so it is better to include some measures.

How

  • Add a comment to sample code
  • Print warning logs if appAppleId is nil
  • Create a function to check the production configuration

What do you think? I would be happy to receive your comments.

Thanks!

@alexanderjordanbaker
Copy link
Collaborator

@shimastripe
That is a good suggestion, I will plan on

  1. Adding a comment to the READMEs
  2. Throwing an error in the constructor if appAppleId is null/nil/undefined and the environment is Production

@shimastripe
Copy link
Contributor Author

Thanks @alexanderjordanbaker ! I create a PR #35 .
Is this the way you would like to do it?

@alexanderjordanbaker
Copy link
Collaborator

Resolved in #35

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

No branches or pull requests

2 participants