-
Notifications
You must be signed in to change notification settings - Fork 220
/
info.js
31 lines (25 loc) · 939 Bytes
/
info.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict'
let co = require('co')
let cli = require('heroku-cli-util')
let flags = require('../../lib/flags.js')
let certificateDetails = require('../../lib/certificate_details.js')
function * run (context, heroku) {
let endpoint = yield flags(context, heroku)
let cert = yield cli.action(`Fetching SSL certificate ${endpoint.name} info for ${cli.color.app(context.app)}`, {}, heroku.request({
path: endpoint._meta.path,
headers: { 'Accept': `application/vnd.heroku+json; version=3.${endpoint._meta.variant}` }
}))
certificateDetails(cert)
}
module.exports = {
topic: 'certs',
command: 'info',
flags: [
{ name: 'name', hasValue: true, description: 'name to check info on' },
{ name: 'endpoint', hasValue: true, description: 'endpoint to check info on' }
],
description: 'show certificate information for an SSL certificate',
needsApp: true,
needsAuth: true,
run: cli.command(co.wrap(run))
}