Respect UAA scopes during access control
Include order-direction in next_url and prev_url

[#68475096]
Retrofit specs for extracted AppUsageEventRepository

[#68820074]

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
AppUsageEvent guid is now unique

No longer reuses the app guid

[#68851718]

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Fix typo in the app_usage_event_api_spec

Apparently I can't type and I'm a terrible spell check.
Revert to using the app guid as the event guid after a purge

- The SecureRandom uuid was being run too early so was giving every event the same guid!
- The old "hack" of using the app's guid ensures that every event gets a unique guid

Signed-off-by: Kai Zhang <kaizhang@cn.ibm.com>
Work around pg vs mysql inconsistency

Creating an App in a STARTED state on mysql and sqlite result in an AppUsageEvent being created but on pg there is no event

[#68851718]

Signed-off-by: Kai Zhang <kaizhang@cn.ibm.com>
Temporarily disable specs, they are not reliable on mysql

We retrofitted these yesterday, the functionality under test is already exercised by controller specs
and we will re-enabled these specs as part of [#68852028]

Signed-off-by: Kai Zhang <kaizhang@cn.ibm.com>
Merge pull request #200 from sykesm/fix-api-typo

Fix typo in the app_usage_event_api_spec
Remove detected_buildpack_guid from app api.

* First step to rethink our buildpack strategy

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Add detected_buildpack_name to apps.

* Remove buildpack_name and buildpack_guid from app model.
* Change staging task to always save buildpack guid when available.
* Do not expose detected_buildpack_name and detected_buildpack_guid to API.

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Maintain detected_buildpack info when seeding app usage events

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Fix tests that assume no dirty db state

* In mysql, tests are not running in transactions and in a random order so
  they can leave states behind. We have to use less strict matchers.

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Change blueprints to use example.com

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Show specific error when match_app fails.

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Use UAA's transaction endpoints for create/update/delete of clients

Includes some refactoring of:
- ServiceBrokerRemoval => ServiceBrokerRemover
- uaa command interface changed from apply! to db_command and
  uaa_command
Add ssl support when modifying dashboard clients with UAA.
Handle 404 when requesting token from UAA
Return meaningful errors when the UAA returns an error during
create/update/delete service-broker
Remove buildpack_name and buildpack_guid from app usage events.

* This is because we don't have the app detected build pack names and guid at
* the time a start event get generated. They only become avaiable when staging
* is done and passed back by the DEAs.

Signed-off-by: Kai Zhang <kaizhang@cn.ibm.com>