Skip to content

Commit

Permalink
fix(rot): Add --collection flag back for cert template gen
Browse files Browse the repository at this point in the history
Signed-off-by: sbailey <[email protected]>
  • Loading branch information
spbsoluble committed May 13, 2024
1 parent ad76356 commit 12b3946
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/rot.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ func generateAuditReport(
actions[tp] = append(
actions[tp], ROTAction{
Thumbprint: tp,
StoreAlias: "", //TODO get this value
CertID: certID,
StoreID: store.ID,
StoreType: store.Type,
Expand Down Expand Up @@ -1825,6 +1826,7 @@ func init() {
storeTypes []string
containerNames []string
subjectNames []string
collections []string
)

storesCmd.AddCommand(rotCmd)
Expand Down Expand Up @@ -1941,6 +1943,13 @@ func init() {
[]string{},
"Multi value flag. Attempt to pre-populate the stores template with the certificate stores matching specified container types. If not specified, the template will be empty.",
)
rotGenStoreTemplateCmd.Flags().StringSliceVar(
&collections,
"collection",
[]string{},
"Certificate collection name(s) to pre-populate the stores template with. If not specified, the template will be empty.",
)

rotGenStoreTemplateCmd.Flags().StringSliceVar(
&subjectNames,
"cn",
Expand Down
1 change: 1 addition & 0 deletions cmd/rot_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (r *ROTCert) toCSV() string {

type ROTAction struct {
Thumbprint string `json:"thumbprint" mapstructure:"Thumbprint"`
StoreAlias string `json:"alias" mapstructure:"Alias;omitempty"`
CertID int `json:"cert_id" mapstructure:"CertID"`
CertDN string `json:"cert_dn" mapstructure:"SubjectName"`
CertSANs string `json:"cert_sans,omitempty" mapstructure:"CertSANs,omitempty"`
Expand Down

0 comments on commit 12b3946

Please sign in to comment.