-
Notifications
You must be signed in to change notification settings - Fork 16
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
Sample app provisioning #343
Conversation
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.
Actually, why is app_provisioning.dart
appearing in the main SDK sources? It's not in the client library features specification, as far as I'm aware, so shouldn't be part of the SDK unless we have strong reasons why it's required for the Flutter platform. If it's a utility that you need to share between example/
and test_integration/
projects, then is there a way to share it without adding to the API surface area of the core SDK?
I don't think it's possible to share it between
But as you noticed, the main drawback is the fact that this class has to be in the base package. If we'd like to keep the codebase of the library as clean as possible, there are alternative approaches that I can take with this:
If extending the base package like I've done it is not a correct direction, I suggest we take the approach 2, and simply put a copy of the class I created for provisioning in |
@ikurek Thanks for your detailed reply. It's worth us avoiding adding APIs to the base package because we've seen elsewhere that customer's can come to rely upon such unofficial (public, not public) APIs - and, in turn, we then have to support them going forwards. In the same vein, while your alternative approach 1 is a good suggestion, it only takes us further down the road of this becoming a supported public API. So, on balance, I think go with your alternative approach 2 - duplicated code - and just ensure to put a comment in both locations that points to the other to help maintainers out. Perhaps also explaining why. |
@QuintinWillison I've removed provisioning from base |
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.
Looks good to me except a small typo which Quintin already suggested a change. So I'm going to assume it's going to be fixed
This should resolve #316, as this PR is a rework of Ably SDK key provisioning system. Previously, only the integration testing was using provisioning endpoints, an now they're also utilized in the sample application, to make it work without the SDK key. The most important changes are:
test_integration
toably_flutter
base package. This makes provisioning system available to all sub-packages ofably_flutter
includingtest_integration
andexample
.provision()
andgetTokenRequest()
methods were moved to aAppProvisioning
class, which instance can be configured with additional parameters to extend provisioning capabilitiesAblyService
in the example app has to be initialized before the app UI is ranApiKeyService
utility class was created to manage API key, so it's possible to check the key source at runtimeAfter that, we only need #318 to make the sample app run without any configuration from user's side 🙂