Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
fix: update Push Notifications prompts and tests to use IAM apikey cr…
Browse files Browse the repository at this point in the history
…edentials
  • Loading branch information
Christian Compton committed Nov 7, 2018
1 parent 9c156d0 commit 368ba51
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ module.exports = Generator.extend({

var prompts = [
{ name: 'pushNotificationsName', message: 'Enter service name (blank for default):' },
{ name: 'pushNotificationsAppGuid', message: 'Enter app GUID:' },
{ name: 'pushNotificationsAppSecret', message: 'Enter app secret:', type: 'password' },
{ name: 'pushNotificationsAppGuid', message: 'Enter app GUID (blank for none):' },
{ name: 'pushNotificationsAPIKey', message: 'Enter API Key (blank for none):', type: 'password' },
{
name: 'pushNotificationsRegion',
type: 'list',
Expand All @@ -965,7 +965,7 @@ module.exports = Generator.extend({
var pushService = this.services.push
this.services.push = {
appGuid: answers.pushNotificationsAppGuid || undefined,
appSecret: answers.pushNotificationsAppSecret || undefined,
apikey: answers.pushNotificationsAPIKey || undefined,
serviceInfo: {
label: pushService.serviceInfo.label,
name: answers.pushNotificationsName || pushService.serviceInfo.name,
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function sanitizeCredentialsAndFillInDefaults (serviceType, service) {
appGuid: service.appGuid || '',
url: service.url || '',
admin_url: service.admin_url || '',
appSecret: service.appSecret || '',
apikey: service.apikey || '',
clientSecret: service.clientSecret || ''
}
case 'autoscaling':
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"chalk": "^2.1.0",
"debug": "^3.0.0",
"generator-ibm-cloud-enablement": "1.3.6",
"generator-ibm-service-enablement": "3.0.3",
"generator-ibm-service-enablement": "3.1.0",
"generator-ibm-usecase-enablement": "3.2.7",
"handlebars": "^4.0.5",
"ibm-openapi-support": "^0.0.12",
Expand Down
6 changes: 3 additions & 3 deletions test/integration/app/prompted_nobuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ describe('Integration tests (prompt no build) for swiftserver:app', function ()
commonTest.itCreatedServiceConfigFiles()
commonTest.pushnotifications.itCreatedServiceFilesWithExpectedContent('myPushNotificationsService', {
appGuid: '',
appSecret: '',
apikey: '',
clientSecret: ''
})
})
Expand All @@ -1270,7 +1270,7 @@ describe('Integration tests (prompt no build) for swiftserver:app', function ()
configure: [ 'Push Notifications' ],
pushNotificationsName: 'myPushNotificationsService',
pushNotificationsAppGuid: 'myAppGuid',
pushNotificationsAppSecret: 'myAppSecret',
pushNotificationsAPIKey: 'myAPIKey',
pushNotificationsRegion: 'United Kingdom'
})
return runContext.toPromise()
Expand All @@ -1283,7 +1283,7 @@ describe('Integration tests (prompt no build) for swiftserver:app', function ()
commonTest.itCreatedServiceConfigFiles()
commonTest.pushnotifications.itCreatedServiceFilesWithExpectedContent('myPushNotificationsService', {
appGuid: 'myAppGuid',
appSecret: 'myAppSecret',
apikey: 'myAPIKey',
clientSecret: '',
url: 'http://imfpush.eu-gb.bluemix.net'
})
Expand Down
2 changes: 1 addition & 1 deletion test/resources/unsupported_bluemix.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
},
"push": {
"appGuid": "push-app-guid",
"appSecret": "push-app-secret",
"apikey": "push-apikey",
"clientSecret": "push-client-secret",
"serviceInfo": {
"label": "push-label",
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ describe('Unit tests for swiftserver:app', function () {
configure: [ 'Push Notifications' ],
pushNotificationsName: 'myPushNotificationsService',
pushNotificationsAppGuid: 'myAppGuid',
pushNotificationsAppSecret: 'myAppSecret',
pushNotificationsAPIKey: 'myAPIKey',
pushNotificationsRegion: 'US South'
})
return runContext.toPromise()
Expand All @@ -1697,7 +1697,7 @@ describe('Unit tests for swiftserver:app', function () {
name: 'myPushNotificationsService'
},
appGuid: 'myAppGuid',
appSecret: 'myAppSecret',
apikey: 'myAPIKey',
url: 'http://imfpush.ng.bluemix.net'
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('Unit tests for helpers', function () {
appGuid: '',
url: '',
admin_url: '',
appSecret: '',
apikey: '',
clientSecret: ''
},
autoscaling: {
Expand Down Expand Up @@ -209,7 +209,7 @@ describe('Unit tests for helpers', function () {
appGuid: 'my-app-guid',
url: 'http://my-host',
admin_url: 'http://my-admin-host',
appSecret: 'my-app-secret',
apikey: 'my-apikey',
clientSecret: 'my-client-secret'
},
autoscaling: {
Expand Down

0 comments on commit 368ba51

Please sign in to comment.