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

Break PowerAuthSDK dependency on shared configurations #88

Closed
hvge opened this issue Feb 13, 2018 · 0 comments
Closed

Break PowerAuthSDK dependency on shared configurations #88

hvge opened this issue Feb 13, 2018 · 0 comments
Assignees
Milestone

Comments

@hvge
Copy link
Member

hvge commented Feb 13, 2018

Currently, our iOS PowerAuthSDK class internally depends on several shared configuration instances: PA2ClientConfiguration.sharedInstance() & PA2KeychainConfiguration.sharedInstance(). We should break this dependency and allow object instantiation with using custom configuration objects.

Benefits

  • I'm working on LimeAuth library where I would like to allow instantiate high level object with all application provided configurations. Right now, it's kind of confusing when developer has to provide own PowerAuthConfiguration and then access shared instances for networking, etc...
  • Better thread safety. Later changes to shared configurations doesn't affect already instantiated SDK objects.
  • Better object testability

Proposed changes

  • Both, PA2ClientConfiguration and PA2KeychainConfiguration should implement NSCopying protocol.
  • Add new read-only keychainConfiguration property to PowerAuthSDK. The property should return copy of internally used configuration, to do not allow post-inistantiation changes in keychain configuration.
  • Add new read-only httpClientConfiguration property to PowerAuthSDK. The property should return copy of internally used configuration, to do not allow post-inistantiation changes in client configuration.
  • Add new designated initializer to PowerAuthSDK to allow construct object with exact keychain & client configurations. Due to backward compatibility, we should provide fallbacks to shared config instances once one of the new parameters is nil
  • Fix PA2PrivateHttpTokenProvider which also depends on PA2ClientConfiguration.sharedInstance()
@hvge hvge added this to the 0.18.0 milestone Feb 13, 2018
@hvge hvge self-assigned this Feb 13, 2018
@hvge hvge closed this as completed in 9464f6c Feb 13, 2018
hvge added a commit that referenced this issue Oct 22, 2018
…onfiguration.

This also fixes wrong config copying, introduced in #88
hvge added a commit that referenced this issue Oct 22, 2018
…onfiguration.

This also fixes wrong config copying, introduced in #88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant