Open edjiang opened 8 years ago
This is good, but we need to discuss where this logic will live. Probably at the integration level, but it may need low-level SDK support.
I think that a framework integration should do this. It will achieve this by looking at the application.href
option, and then passing a baseUrl
option to the client constructor in the SDK. We should continue to maintain the REST clients, as created by the SDKs, as application-agnostic.
+1 for this. I just had a customer run into the issue that this would solve: they changed application.href
but not client.baseUrl
and were confused why it didn't work.
This is a great idea!
Since the basePath
is set to null by default, what should happen in scenarios where the basePath
is set? Should the STORMPATH_APPLICATION_HREF
take precedence over it?
For example if a user sets the STORMPATH_APPLICATION_HREF
to https://enterprise.stormpath.io/v1/applications/XYZ
and the basePath
to api.stormpath.com
or vice versa. Maybe throw a warning to the developer or raise an error?
Talked about it in the Evangelism Monthly meeting today; Tom said this should already be behavior. I could not find this documented.
If an application has:
STORMPATH_APPLICATION_HREF=https://enterprise.stormpath.io/v1/XYZ
It should auto-set the Stormpath
baseUrl
tohttps://enterprise.stormpath.io/
for developer convenience.