stormpath / stormpath-framework-spec

Language-agnostic API specification for Stormpath Framework Integrations
12 stars 14 forks source link

Define framework User-Agent #53

Closed nbarbettini closed 8 years ago

nbarbettini commented 8 years ago

agent-tracking.md details how a frontend client User-Agent is prepended to the existing framework User-Agent string, but how the latter is constructed is not defined anywhere in this spec.

edjiang commented 8 years ago

Yeah, I think we defined that at an earlier meeting, but I don't see it there.

I think we decided to send something like:

X-Stormpath-Agent: stormpath-sdk-nodejs/1.0.0 express-stormpath/1.0.0, eg, named after the framework integration / SDK names or something?

nbarbettini commented 8 years ago

Well, there are a few things going on here. @robertjd can correct me if I get any of this wrong:

  1. The frontend (mobile or SPA) client will send X-Stormpath-Agent with requests to the framework integration. For example, X-Stormpath-Agent: stormpath-sdk-angularjs/0.9.0 angular/1.4.7
  2. The framework will construct its own User-Agent string, like express-stormpath/3.0.0 express/4.13. Any incoming X-Stormpath-Agent value will be prepended to this. The framework will pass this down to the underlying SDK layer through an internal mechanism.
  3. The SDK layer will construct its own User-Agent string, like stormpath-sdk-node/0.17.5 node/5.7.1 Windows/6.3. Any value passed down from the framework level will be prepended to this. The SDK will send this with any requests made to the Stormpath API. So the final string seen by the Stormpath API will look like:

User-Agent: stormpath-sdk-angularjs/0.9.0 angular/1.4.7 express-stormpath/3.0.0 express/4.13 stormpath-sdk-node/0.17.5 node/5.7.1 Windows/6.3

A lot of this has been documented previously in Confluence, but I think it should be moved to the appropriate place in the SDK and Framework specs. @omgitstom thoughts?

edjiang commented 8 years ago

I notice you're using the angular version number as well. Would it be helpful is Swift reported the iOS version? Not sure if there's an analogue there; I don't think I can get the Swift version.

nbarbettini commented 8 years ago

The spec is pretty loose at this point - it's "any useful environment information". If we record it, we can run metrics on it. Would it be useful to have the iOS version?

lhazlewood commented 8 years ago

Immensely useful. We should capture all user agent information we can - it helps us troubleshoot problems, prioritize features for customers based on quantity of environments used (e.g. 10 users on OS X version Y need Z vs only 2 users on version A), etc. It is critically important for us and how we plan our roadmap. Basically every operating system+version, browser+version and framework+version we can capture will help us make decisions to improve experiences for our customers.

edjiang commented 8 years ago

Awesome. Added iOS version number to our thing as ex. iOS/9.2

nbarbettini commented 8 years ago

Mapped out SDK (stormpath/stormpath-sdk-spec#14) and framework (#55) behavior. I'll close this issue after we go through comments & revisions on both of those PRs.

nbarbettini commented 8 years ago

Closed via #55