Update AuthorizationService.js to support that gpii.oauth2.dbDataSource API returns promises rather than the direct data returned by the in memory data store.
To update gpii.oauth2.authorizationService, as well as other components that depend on the oauth2 data store, we will need to determine a strategy to test such components.
Until now, we test components that depend on the oauth2 data store against the gpii.oauth2.inMemoryDataStore. With the move to CouchDB, the new data store API returns promises and we can no longer use the gpii.oauth2.inMemoryDataStore in tests as is. We will need to do some work to update the unit tests for components that depend on the oauth2 data store. Some options:
- Continue to maintain the gpii.oauth2.inMemoryDataStore and update it to return promises
- Mock the oauth2 data store (for example, using Sinon.js)
- Use PouchDB in the browser-based unit tests
- Convert the current browser-based unit tests into Node.js tests and use the existing GPII PouchDB testing infrastrucrure