-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(certs-v5): add domain info in certs list and info #1660
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,22 @@ function type (f) { | |
|
||
module.exports = function (certs) { | ||
let mapped = certs.filter(function (f) { return f.ssl_cert }).map(function (f) { | ||
return { | ||
let tableContents = { | ||
name: f.name, | ||
cname: f.cname, | ||
expires_at: f.ssl_cert.expires_at, | ||
ca_signed: f.ssl_cert['ca_signed?'], | ||
type: type(f), | ||
common_names: f.ssl_cert.cert_domains.join(', ') | ||
common_names: f.ssl_cert.cert_domains.join(', '), | ||
} | ||
|
||
// If they're using ACM it's not really worth showing the number of associated domains since | ||
// it'll always be 1 and is entirely outside the user's control | ||
if (!f.ssl_cert.acm) { | ||
tableContents.associated_domains = (f.domains && f.domains.length) ? f.domains.length : '0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was a bit confused seeing this in the output and after reading the comment. What do you think about using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yes. The cname field is indicating the domain(s) provided when creating the cert. The "associated domains" field is referring to the number of actual connections made between this cert and actual domains that belong to the app on Heroku. In other words, you may have a cert with a cname that reads "*.purple.com", and in Heroku, that cert could be assigned to "{foo,bar,baz}.purple.com" so you'd have 3 associated domains. Likewise, you could have a cert uploaded that does not yet have any domains associated with it, in which case 0 seems like the best thing to display. |
||
} | ||
|
||
return tableContents | ||
}) | ||
|
||
let columns = [ | ||
|
@@ -47,8 +55,12 @@ module.exports = function (certs) { | |
{label: 'Common Name(s)', key: 'common_names'}, | ||
{label: 'Expires', key: 'expires_at', format: function (f) { return f ? formatDate(f) : '' }}, | ||
{label: 'Trusted', key: 'ca_signed', format: function (f) { return f === undefined ? '' : (f ? 'True' : 'False') }}, | ||
{label: 'Type', key: 'type'} | ||
{label: 'Type', key: 'type'}, | ||
]) | ||
|
||
if (certs.some(cert => !cert.ssl_cert || !cert.ssl_cert.acm)) { | ||
columns.push({label: 'Domains', key: 'associated_domains'}) | ||
} | ||
|
||
cli.table(mapped, { columns }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this handle paginated responses?