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

SDKS-2761 #241

Merged
merged 2 commits into from
Oct 25, 2023
Merged

SDKS-2761 #241

merged 2 commits into from
Oct 25, 2023

Conversation

jeyanthanperiyasamy
Copy link
Contributor

JIRA Ticket

Please, link jira ticket here.

Description

Briefly describe the change and any information that would help speedup the review and testing process.

Definition of Done Checklist:

  • Acceptance criteria is met.
  • All tasks listed in the user story have been completed.
  • Coded to standards.
  • Ensure backward compatibility.
  • API reference docs is updated.
  • Unit tests are written.
  • Integration tests are written.
  • e2e tests are written.
  • Functional spec is written/updated.
  • Example code snippets have been added.
  • Change log updated.
  • Documentation story is created and tracked.
  • Tech debts and remaining tasks are tracked in separated ticket(s).

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, a couple of questions nothing major

self.setVerification(result.assertKey)
let result = try await FRAppAttestDomainModal.shared.requestIntegrityToken(challenge: challenge)
self.setAttestation(result.appAttestKey)
self.setAssertion(result.assertKey ?? "")

Choose a reason for hiding this comment

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

Should we through if you have no key? Or is there a valid reason that would happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that value can be either empty or have a value ..AM needs that information

but i can modify that logic like this. good find

if let assertkey = result.assertKey {
self.setAssertion(assertkey)
}

return FRAppIntegrityKeys(attestKey: attest.base64EncodedString(),
assertKey: assert.base64EncodedString(),
keyIdentifier: keyIdentifier,
let assertion = try await withRetry {

Choose a reason for hiding this comment

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

Out of curiosity the withRetry how many times does it retry? And why are we using it here? Is there a chance of failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will retry twice, and if its failed , we have a catch block to handle a special scenario

public private(set) var assertKey: String? = nil
public private(set) var keyIdentifier: String
public private(set) var clientDataHash: String
private let key = "com.forgerock.ios.appattest.keychainservice"

Choose a reason for hiding this comment

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

Would it be useful to allow to customise this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

users has the access to just to delete the key stored in keychain , i am wondering whats the advantage of customizing this . lets discuss this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we dont share the keys between apps , we dont let users customize this

@@ -174,4 +191,8 @@ public class FRAppIntegrityCallback: MultipleValuesCallback {
}
}
}

public func isAttestationCompleted() -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing doc

Copy link
Contributor

Choose a reason for hiding this comment

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

still missing :-)

Copy link
Contributor Author

@jeyanthanperiyasamy jeyanthanperiyasamy Oct 25, 2023

Choose a reason for hiding this comment

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

done sorry, that one commit didnt pushed

Copy link
Contributor

@rodrigoareis rodrigoareis left a comment

Choose a reason for hiding this comment

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

Overall implementation looks good to me. Some missing documentation

@jeyanthanperiyasamy
Copy link
Contributor Author

addressed most of the comments

Copy link
Contributor

@rodrigoareis rodrigoareis left a comment

Choose a reason for hiding this comment

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

LGTM

self.setkeyId(result.keyIdentifier)
self.setClientData(result.clientDataHash)
self.appIntegritykeys = result
}
catch {
FRLog.e("Error: \(error.localizedDescription)")

Choose a reason for hiding this comment

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

When setting the error to the callback, it set to the actual error or the string "ClientDeviceErrors"? For Server to route to the correct outcome, it should set it to "ClientDeviceErrors", and allow developers to customize the error.

The failure will throw to developer, and if they want to have a custom outcome, they can set using FRAppIntegrityCallback.setClientError()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is addressed already.

@jeyanthanperiyasamy jeyanthanperiyasamy changed the base branch from SDKS-2630 to develop October 25, 2023 20:08
@jeyanthanperiyasamy jeyanthanperiyasamy merged commit 4218690 into develop Oct 25, 2023
5 of 7 checks passed
@jeyanthanperiyasamy jeyanthanperiyasamy deleted the SDKS-2761 branch October 25, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants