1
0
mirror of https://github.com/strongdm/comply synced 2025-12-06 22:34:04 +00:00

Refactor "Standards" to "Frameworks"

This commit is contained in:
Craine Runton
2020-09-15 14:52:22 -05:00
parent dbe49a09b3
commit 84e439e7cc
17 changed files with 180 additions and 106 deletions

View File

@@ -6,7 +6,7 @@ type Control struct {
Description string `yaml:"description"`
}
type Standard struct {
type Framework struct {
Name string `yaml:"name"`
Controls map[string]Control `yaml:",inline"`
}

View File

@@ -30,7 +30,7 @@ func ReadData() (*Data, error) {
if err != nil {
return nil, err
}
standards, err := ReadStandards()
frameworks, err := ReadFrameworks()
if err != nil {
return nil, err
}
@@ -40,7 +40,7 @@ func ReadData() (*Data, error) {
Narratives: narratives,
Policies: policies,
Procedures: procedures,
Standards: standards,
Frameworks: frameworks,
}, nil
}
@@ -67,27 +67,27 @@ func tickets(rawTickets []string) ([]*Ticket, error) {
return tickets, nil
}
// ReadStandards loads standard definitions from the filesystem.
func ReadStandards() ([]*Standard, error) {
var standards []*Standard
// ReadFrameworks loads standard definitions from the filesystem.
func ReadFrameworks() ([]*Framework, error) {
var frameworks []*Framework
files, err := path.Standards()
files, err := path.Frameworks()
if err != nil {
return nil, errors.Wrap(err, "unable to enumerate paths")
}
for _, f := range files {
s := &Standard{}
s := &Framework{}
sBytes, err := ioutil.ReadFile(f.FullPath)
if err != nil {
return nil, errors.Wrap(err, "unable to read "+f.FullPath)
}
yaml.Unmarshal(sBytes, &s)
standards = append(standards, s)
frameworks = append(frameworks, s)
}
return standards, nil
return frameworks, nil
}
// ReadNarratives loads narrative descriptions from the filesystem.

View File

@@ -1,12 +1,12 @@
package model
type Data struct {
Standards []*Standard
Narratives []*Document
Policies []*Document
Procedures []*Procedure
Tickets []*Ticket
Audits []*Audit
Frameworks []*Framework
Narratives []*Document
Policies []*Document
Procedures []*Procedure
Tickets []*Ticket
Audits []*Audit
}
type Revision struct {