-
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
Conversation
7a423ff
to
a5ade61
Compare
4bf44c2
to
58f71fa
Compare
@@ -14,6 +14,18 @@ function * run (context, heroku) { | |||
headers: { 'Accept': `application/vnd.heroku+json; version=3.${endpoint._meta.variant}` } | |||
})) | |||
|
|||
if (context.flags['show-domains']) { | |||
let domains = yield Promise.all(endpoint.domains.map(domain => { | |||
return heroku.request({ |
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?
// 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 comment
The 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 1
here instead of '0'? Or showing a blank space? 0 makes me think something isn't quite right since there is a cname for the cert. I might also be missing a key difference on the domains field vs the cname field.
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.
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.
https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07B0000008dFwjIAE/view
This PR adds two new pieces of functionality:
certs
command will now show a count of associated domains for each cert in the listcerts:info
command now has an optional--show-domains
flag which, when used, will request and display the names of all the domains associated with the cert in question.