Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-certs

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-certs - npm Package Compare versions

Comparing version 1.1.15 to 1.1.16

5

lib/endpoints.js

@@ -16,2 +16,7 @@ 'use strict'

headers: {'Accept': 'application/vnd.heroku+json; version=3.sni_ssl_cert'}
}).catch(function (err) {
if (err.statusCode === 422 && err.body && err.body.id === 'space_app_not_supported') {
return []
}
throw err
}).then(function (data) {

@@ -18,0 +23,0 @@ return data

2

package.json
{
"name": "heroku-certs",
"version": "1.1.15",
"version": "1.1.16",
"description": "heroku ssl plugin",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -245,2 +245,38 @@ 'use strict'

})
it('# traps the "id":"space_app_not_supported" error in dogwood', function () {
nock('https://api.heroku.com')
.get('/apps/example')
.reply(200, {
'space': {'name': 'spacely-space-1234'}
})
nock('https://api.heroku.com')
.get('/apps/example/addons/ssl%3Aendpoint')
.reply(404, {
'id': 'not_found',
'resource': 'addon'
})
nock('https://api.heroku.com')
.get('/apps/example/domains')
.reply(200, [])
nock('https://api.heroku.com')
.get('/apps/example/ssl-endpoints')
.reply(200, [])
let mock = nock('https://api.heroku.com')
.get('/apps/example/sni-endpoints')
.reply(422, {
'id': 'space_app_not_supported',
'message': 'App heroku-certs-test is in a space, but space apps are not supported on this endpoint. Try `/apps/:id/ssl-endpoints` instead.'
})
return certs.run({app: 'example', args: {}, flags: {}}).then(function () {
mock.done()
expect(cli.stderr).to.equal('')
expect(cli.stdout).to.equal(`example has no SSL certificates.\nUse heroku certs:add CRT KEY to add one.\n`)
})
})
})

@@ -208,1 +208,55 @@ 'use strict'

})
describe('heroku certs:update (dogwood)', function () {
beforeEach(function () {
cli.mockConsole()
sinon.stub(fs, 'readFile')
nock.cleanAll()
})
afterEach(function () {
fs.readFile.restore()
})
it('# updates an endpoint when sni-endpoints 422s', function () {
nock('https://api.heroku.com')
.get('/apps/example')
.reply(200, {
'space': {'name': 'spacely-space-1234'}
})
let mockSni = nock('https://api.heroku.com')
.get('/apps/example/sni-endpoints')
.reply(422, {
'id': 'space_app_not_supported',
'message': 'App heroku-certs-test is in a space, but space apps are not supported on this endpoint. Try `/apps/:id/ssl-endpoints` instead.'
})
nock('https://api.heroku.com')
.get('/apps/example/ssl-endpoints')
.reply(200, [endpointStable])
fs.readFile
.withArgs('pem_file', sinon.match.func)
.callsArgWithAsync(1, null, 'pem content')
fs.readFile
.withArgs('key_file', sinon.match.func)
.callsArgWithAsync(1, null, 'key content')
let mockPut = nock('https://api.heroku.com')
.patch('/apps/example/ssl-endpoints/tokyo-1050', {
certificate_chain: 'pem content', private_key: 'key content'
})
.reply(200, endpointStable)
return certs.run({app: 'example', args: {CRT: 'pem_file', KEY: 'key_file'}, flags: {name: 'tokyo-1050', confirm: 'example', bypass: true}}).then(function () {
mockSni.done()
mockPut.done()
expect(cli.stderr).to.equal('Updating SSL certificate tokyo-1050 for example... done\n')
expect(cli.stdout).to.equal(
`Updated certificate details:
${certificateDetails}
`)
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc