From 15519283f16642a4b22d864b530db8e3820c5f03 Mon Sep 17 00:00:00 2001 From: Victoria Jeffrey Date: Wed, 4 Mar 2020 22:31:35 -0700 Subject: [PATCH 1/4] profiles API docs Signed-off-by: Victoria Jeffrey --- .../compliance/profiles/profiles.pb.go | 375 ++++++++++++++---- .../compliance/profiles/profiles.proto | 161 +++++++- .../compliance/profiles/profiles.swagger.json | 260 ++++++++---- .../data/docs/api-static/03-tags.swagger.json | 3 +- .../compliance/profiles/profiles.swagger.json | 260 ++++++++---- .../infra_proxy/infra_proxy.swagger.json | 125 ++++++ .../api/profiles.pb.swagger.go | 260 ++++++++---- 7 files changed, 1117 insertions(+), 327 deletions(-) diff --git a/api/external/compliance/profiles/profiles.pb.go b/api/external/compliance/profiles/profiles.pb.go index 46c876aee36..9a7939634db 100644 --- a/api/external/compliance/profiles/profiles.pb.go +++ b/api/external/compliance/profiles/profiles.pb.go @@ -54,8 +54,11 @@ func (Query_OrderType) EnumDescriptor() ([]byte, []int) { } type ProfilePostRequest struct { - Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` - Chunk *Chunk `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` + // Automate user to associate the profile with. Only this user will be able to see the profile in the Automate GUI. + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` + // Intentionally blank. + Chunk *Chunk `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` + // Intentionally blank. Meta *Metadata `protobuf:"bytes,3,opt,name=meta,proto3" json:"meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -108,9 +111,13 @@ func (m *ProfilePostRequest) GetMeta() *Metadata { return nil } +// Metadata about the profile. type Metadata struct { - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Name of the profile (as specified in the inspec.yml) + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Version of the profile. + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Content type of the profile (e.g. application/json, application/x-gtar, application/gzip) ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -163,6 +170,7 @@ func (m *Metadata) GetContentType() string { return "" } +// Profile contents in byte form. type Chunk struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Position int64 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"` @@ -211,9 +219,13 @@ func (m *Chunk) GetPosition() int64 { } type ProfileData struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Automate user associated with the profile. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // Name of the profile. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Version of the profile. + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Profile contents in byte form. Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -274,11 +286,13 @@ func (m *ProfileData) GetData() []byte { } type Profiles struct { - Profiles []*Profile `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` - Total int32 `protobuf:"varint,20,opt,name=total,proto3" json:"total,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // List of profiles matching the query. + Profiles []*Profile `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` + // Total count of profiles matching the query. + Total int32 `protobuf:"varint,20,opt,name=total,proto3" json:"total,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Profiles) Reset() { *m = Profiles{} } @@ -321,25 +335,40 @@ func (m *Profiles) GetTotal() int32 { } type Profile struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Maintainer string `protobuf:"bytes,3,opt,name=maintainer,proto3" json:"maintainer,omitempty"` - Copyright string `protobuf:"bytes,4,opt,name=copyright,proto3" json:"copyright,omitempty"` - CopyrightEmail string `protobuf:"bytes,5,opt,name=copyright_email,json=copyrightEmail,proto3" json:"copyright_email,omitempty"` - License string `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` - Summary string `protobuf:"bytes,7,opt,name=summary,proto3" json:"summary,omitempty"` - Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty"` - Owner string `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - Supports []*Support `protobuf:"bytes,16,rep,name=supports,proto3" json:"supports,omitempty"` - Depends []*Dependency `protobuf:"bytes,17,rep,name=depends,proto3" json:"depends,omitempty"` - Sha256 string `protobuf:"bytes,18,opt,name=sha256,proto3" json:"sha256,omitempty"` - Groups []*Group `protobuf:"bytes,19,rep,name=groups,proto3" json:"groups,omitempty"` - Controls []*Control `protobuf:"bytes,20,rep,name=controls,proto3" json:"controls,omitempty"` - Attributes []*Attribute `protobuf:"bytes,21,rep,name=attributes,proto3" json:"attributes,omitempty"` - LatestVersion string `protobuf:"bytes,22,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // The profile name, as specified in the inspec.yml + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The profile title, as specified in the inspec.yml + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + // The profile maintainer, as specified in the inspec.yml + Maintainer string `protobuf:"bytes,3,opt,name=maintainer,proto3" json:"maintainer,omitempty"` + // The profile copyright, as specified in the inspec.yml + Copyright string `protobuf:"bytes,4,opt,name=copyright,proto3" json:"copyright,omitempty"` + // The profile copyright email, as specified in the inspec.yml + CopyrightEmail string `protobuf:"bytes,5,opt,name=copyright_email,json=copyrightEmail,proto3" json:"copyright_email,omitempty"` + // The profile license, as specified in the inspec.yml + License string `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` + // The profile summary, as specified in the inspec.yml + Summary string `protobuf:"bytes,7,opt,name=summary,proto3" json:"summary,omitempty"` + // The profile version, as specified in the inspec.yml + Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty"` + // The Automate user associated with the profile. + Owner string `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` + // The list of operating systems compatible with the profile, as specified in the inspec.yml + Supports []*Support `protobuf:"bytes,16,rep,name=supports,proto3" json:"supports,omitempty"` + // The list of dependencies the profile has, as specified in the inspec.yml + Depends []*Dependency `protobuf:"bytes,17,rep,name=depends,proto3" json:"depends,omitempty"` + // The SHA256 of the profile. + Sha256 string `protobuf:"bytes,18,opt,name=sha256,proto3" json:"sha256,omitempty"` + Groups []*Group `protobuf:"bytes,19,rep,name=groups,proto3" json:"groups,omitempty"` + // The list of controls in the profile. + Controls []*Control `protobuf:"bytes,20,rep,name=controls,proto3" json:"controls,omitempty"` + // The list of attributes in the profile. + Attributes []*Attribute `protobuf:"bytes,21,rep,name=attributes,proto3" json:"attributes,omitempty"` + // The latest version of the profile. + LatestVersion string `protobuf:"bytes,22,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Profile) Reset() { *m = Profile{} } @@ -535,14 +564,23 @@ func (m *Group) GetControls() []string { } type Control struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` - Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` - Impact float32 `protobuf:"fixed32,4,opt,name=impact,proto3" json:"impact,omitempty"` - Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` - SourceLocation *SourceLocation `protobuf:"bytes,6,opt,name=source_location,json=sourceLocation,proto3" json:"source_location,omitempty"` - Results []*Result `protobuf:"bytes,7,rep,name=results,proto3" json:"results,omitempty"` - Refs []*Ref `protobuf:"bytes,8,rep,name=refs,proto3" json:"refs,omitempty"` + // The ID of the control. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The code (test) for the control. + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + // The description of the control. + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + // The impact of the control. + Impact float32 `protobuf:"fixed32,4,opt,name=impact,proto3" json:"impact,omitempty"` + // The title of the control. + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + // Intentionally blank. + SourceLocation *SourceLocation `protobuf:"bytes,6,opt,name=source_location,json=sourceLocation,proto3" json:"source_location,omitempty"` + // The results of the control tests. + Results []*Result `protobuf:"bytes,7,rep,name=results,proto3" json:"results,omitempty"` + // The refs associated with the control. + Refs []*Ref `protobuf:"bytes,8,rep,name=refs,proto3" json:"refs,omitempty"` + // The tags associated with the control. Tags map[string]string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -638,7 +676,9 @@ func (m *Control) GetTags() map[string]string { } type Ref struct { - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + // URL of the ref. + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + // Ref for the control. Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -685,11 +725,17 @@ func (m *Ref) GetRef() string { } type Result struct { - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CodeDesc string `protobuf:"bytes,2,opt,name=code_desc,json=codeDesc,proto3" json:"code_desc,omitempty"` - RunTime float32 `protobuf:"fixed32,3,opt,name=run_time,json=runTime,proto3" json:"run_time,omitempty"` - StartTime string `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + // Status of the test results (passed, failed, skipped). + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // The code (test) that was executed. + CodeDesc string `protobuf:"bytes,2,opt,name=code_desc,json=codeDesc,proto3" json:"code_desc,omitempty"` + // The amount of time it took to execute the test. + RunTime float32 `protobuf:"fixed32,3,opt,name=run_time,json=runTime,proto3" json:"run_time,omitempty"` + // The time the test started. + StartTime string `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // The failure message. + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + // Reason why the test was skipped. SkipMessage string `protobuf:"bytes,6,opt,name=skip_message,json=skipMessage,proto3" json:"skip_message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -905,10 +951,15 @@ func (m *Option) GetDefault() string { } type Support struct { - OsName string `protobuf:"bytes,1,opt,name=os_name,json=osName,proto3" json:"os_name,omitempty"` - OsFamily string `protobuf:"bytes,2,opt,name=os_family,json=osFamily,proto3" json:"os_family,omitempty"` - Release string `protobuf:"bytes,3,opt,name=release,proto3" json:"release,omitempty"` - InspecVersion string `protobuf:"bytes,4,opt,name=inspec_version,json=inspecVersion,proto3" json:"inspec_version,omitempty"` + // OS name supported by the profile. + OsName string `protobuf:"bytes,1,opt,name=os_name,json=osName,proto3" json:"os_name,omitempty"` + // OS family supported by the profile. + OsFamily string `protobuf:"bytes,2,opt,name=os_family,json=osFamily,proto3" json:"os_family,omitempty"` + // OS release supported by the profile. + Release string `protobuf:"bytes,3,opt,name=release,proto3" json:"release,omitempty"` + // Minimum InSpec version required for the profile. + InspecVersion string `protobuf:"bytes,4,opt,name=inspec_version,json=inspecVersion,proto3" json:"inspec_version,omitempty"` + // Platform supported by the profile. Platform string `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -976,16 +1027,27 @@ func (m *Support) GetPlatform() string { } type Dependency struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Git string `protobuf:"bytes,4,opt,name=git,proto3" json:"git,omitempty"` - Branch string `protobuf:"bytes,5,opt,name=branch,proto3" json:"branch,omitempty"` - Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"` - Commit string `protobuf:"bytes,7,opt,name=commit,proto3" json:"commit,omitempty"` - Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty"` - Supermarket string `protobuf:"bytes,9,opt,name=supermarket,proto3" json:"supermarket,omitempty"` - Github string `protobuf:"bytes,10,opt,name=github,proto3" json:"github,omitempty"` + // Name of the profile. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // URL of the profile. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // Path of the profile. + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + // Git location of the profile. + Git string `protobuf:"bytes,4,opt,name=git,proto3" json:"git,omitempty"` + // Branch of the profile. + Branch string `protobuf:"bytes,5,opt,name=branch,proto3" json:"branch,omitempty"` + // Tag associated with the profile. + Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"` + // Commit sha for the profile. + Commit string `protobuf:"bytes,7,opt,name=commit,proto3" json:"commit,omitempty"` + // Version of the profile. + Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty"` + // Supermarket address of the profile. + Supermarket string `protobuf:"bytes,9,opt,name=supermarket,proto3" json:"supermarket,omitempty"` + // Github address of the profile. + Github string `protobuf:"bytes,10,opt,name=github,proto3" json:"github,omitempty"` + // Automate address of the profile. Compliance string `protobuf:"bytes,11,opt,name=compliance,proto3" json:"compliance,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1095,8 +1157,11 @@ func (m *Dependency) GetCompliance() string { } type ProfileDetails struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Automate user associated with the profile. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // Name of the profile. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Version of the profile. Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1150,8 +1215,11 @@ func (m *ProfileDetails) GetVersion() string { } type CheckResult struct { - Summary *ResultSummary `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` - Errors []*CheckMessage `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` + // Intentionally blank. + Summary *ResultSummary `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` + // Errors returned by the `inspec check` command. + Errors []*CheckMessage `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` + // Warnings returned by the `inspec check` command. Warnings []*CheckMessage `protobuf:"bytes,3,rep,name=warnings,proto3" json:"warnings,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1205,9 +1273,13 @@ func (m *CheckResult) GetWarnings() []*CheckMessage { } type ResultSummary struct { - Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` - Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` + // Boolean that denotes if the profile is valid or not (as reported by `inspec check`). + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + // Timestamp of when the `inspec check` command was executed. + Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Path of the profile that was checked. + Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` + // Count of controls in the profile. Controls int32 `protobuf:"varint,4,opt,name=controls,proto3" json:"controls,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1268,10 +1340,15 @@ func (m *ResultSummary) GetControls() int32 { } type CheckMessage struct { - File string `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` - Line int32 `protobuf:"varint,2,opt,name=line,proto3" json:"line,omitempty"` - Column int32 `protobuf:"varint,3,opt,name=column,proto3" json:"column,omitempty"` - ControlId string `protobuf:"bytes,4,opt,name=control_id,json=controlId,proto3" json:"control_id,omitempty"` + // Profile file where the error or warning exists. + File string `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` + // Profile line where the error or warning exists. + Line int32 `protobuf:"varint,2,opt,name=line,proto3" json:"line,omitempty"` + // Column where the error or warning exists. + Column int32 `protobuf:"varint,3,opt,name=column,proto3" json:"column,omitempty"` + // Control ID associated with the error or warning. + ControlId string `protobuf:"bytes,4,opt,name=control_id,json=controlId,proto3" json:"control_id,omitempty"` + // Message associated with the error or warning. Msg string `protobuf:"bytes,5,opt,name=msg,proto3" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1339,7 +1416,9 @@ func (m *CheckMessage) GetMsg() string { } type ListFilter struct { - Values []string `protobuf:"bytes,20,rep,name=values,proto3" json:"values,omitempty"` + // List of values to filter on. + Values []string `protobuf:"bytes,20,rep,name=values,proto3" json:"values,omitempty"` + // The field to filter on. Type string `protobuf:"bytes,21,opt,name=type,proto3" json:"type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1386,17 +1465,25 @@ func (m *ListFilter) GetType() string { } type Query struct { - Filters []*ListFilter `protobuf:"bytes,20,rep,name=filters,proto3" json:"filters,omitempty"` - Order Query_OrderType `protobuf:"varint,21,opt,name=order,proto3,enum=chef.automate.api.compliance.profiles.v1.Query_OrderType" json:"order,omitempty"` - Sort string `protobuf:"bytes,22,opt,name=sort,proto3" json:"sort,omitempty"` - Page int32 `protobuf:"varint,23,opt,name=page,proto3" json:"page,omitempty"` - PerPage int32 `protobuf:"varint,24,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` - Owner string `protobuf:"bytes,25,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,26,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,27,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // Filters to apply to the query + Filters []*ListFilter `protobuf:"bytes,20,rep,name=filters,proto3" json:"filters,omitempty"` + // Order in which to sort. Defaults to ASC. + Order Query_OrderType `protobuf:"varint,21,opt,name=order,proto3,enum=chef.automate.api.compliance.profiles.v1.Query_OrderType" json:"order,omitempty"` + // Field on which to sort. + Sort string `protobuf:"bytes,22,opt,name=sort,proto3" json:"sort,omitempty"` + // Page of results requested. + Page int32 `protobuf:"varint,23,opt,name=page,proto3" json:"page,omitempty"` + // Number of results to return per page. + PerPage int32 `protobuf:"varint,24,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` + // Automate user associated with the profile. + Owner string `protobuf:"bytes,25,opt,name=owner,proto3" json:"owner,omitempty"` + // Name of the profile (as defined in `inspec.yml`). + Name string `protobuf:"bytes,26,opt,name=name,proto3" json:"name,omitempty"` + // Version of the profile (as defined in `inspec.yml`). + Version string `protobuf:"bytes,27,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Query) Reset() { *m = Query{} } @@ -1644,12 +1731,74 @@ type ProfilesServiceClient interface { // grpc gateway is not able to handle multi-part upload; https://github.com/grpc-ecosystem/grpc-gateway/issues/410 // so we do not auto-generate the route for profile upload; we instead custom handle with mux Create(ctx context.Context, opts ...grpc.CallOption) (ProfilesService_CreateClient, error) + // + //Read an installed profile + // + //Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + // + // + //Authorization Action: + //``` + //compliance:profiles:get + //``` Read(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (*Profile, error) + // + //Read a market profile + // + //Read the details of an un-installed profile given the profile name and version. + //in the UI, these are the profiles under the "Available" tab. + //These profiles are created and maintained by Chef, shipped with Chef Automate. + // + // + //Authorization Action: + //``` + //compliance:marketProfiles:get + //``` ReadFromMarket(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (*Profile, error) // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for profile download; we instead custom handle with mux ReadTar(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (ProfilesService_ReadTarClient, error) + // + //Delete an installed profile + // + //Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version. + //Note: this action "uninstalls" the profile. This has no impact on the market profiles. + // + // + //Authorization Action: + //``` + //compliance:profiles:delete + //``` Delete(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (*empty.Empty, error) + // + //List all profiles + // + //Lists all profiles available for the Automate instance. + //Empty params return all "market" profiles. + //Specifying the `owner` field returns all profiles installed for the specified user. + // + //Supports pagination, sorting, and filtering (wildcard supported). + // + //Supported sort fields: title, name (default: title) + //Supported filter fields: name, version, title + // + //Example: + //``` + //{ + //"filters":[ + //{"type": "title", "values": [ "Dev*"]} + //], + //"page": 1, + //"per_page": 3, + //"owner": "admin" + //} + //``` + // + // + //Authorization Action: + //``` + //compliance:profiles:list + //``` List(ctx context.Context, in *Query, opts ...grpc.CallOption) (*Profiles, error) } @@ -1768,12 +1917,74 @@ type ProfilesServiceServer interface { // grpc gateway is not able to handle multi-part upload; https://github.com/grpc-ecosystem/grpc-gateway/issues/410 // so we do not auto-generate the route for profile upload; we instead custom handle with mux Create(ProfilesService_CreateServer) error + // + //Read an installed profile + // + //Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + // + // + //Authorization Action: + //``` + //compliance:profiles:get + //``` Read(context.Context, *ProfileDetails) (*Profile, error) + // + //Read a market profile + // + //Read the details of an un-installed profile given the profile name and version. + //in the UI, these are the profiles under the "Available" tab. + //These profiles are created and maintained by Chef, shipped with Chef Automate. + // + // + //Authorization Action: + //``` + //compliance:marketProfiles:get + //``` ReadFromMarket(context.Context, *ProfileDetails) (*Profile, error) // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for profile download; we instead custom handle with mux ReadTar(*ProfileDetails, ProfilesService_ReadTarServer) error + // + //Delete an installed profile + // + //Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version. + //Note: this action "uninstalls" the profile. This has no impact on the market profiles. + // + // + //Authorization Action: + //``` + //compliance:profiles:delete + //``` Delete(context.Context, *ProfileDetails) (*empty.Empty, error) + // + //List all profiles + // + //Lists all profiles available for the Automate instance. + //Empty params return all "market" profiles. + //Specifying the `owner` field returns all profiles installed for the specified user. + // + //Supports pagination, sorting, and filtering (wildcard supported). + // + //Supported sort fields: title, name (default: title) + //Supported filter fields: name, version, title + // + //Example: + //``` + //{ + //"filters":[ + //{"type": "title", "values": [ "Dev*"]} + //], + //"page": 1, + //"per_page": 3, + //"owner": "admin" + //} + //``` + // + // + //Authorization Action: + //``` + //compliance:profiles:list + //``` List(context.Context, *Query) (*Profiles, error) } diff --git a/api/external/compliance/profiles/profiles.proto b/api/external/compliance/profiles/profiles.proto index 561b8c2952c..56bb25f5f32 100644 --- a/api/external/compliance/profiles/profiles.proto +++ b/api/external/compliance/profiles/profiles.proto @@ -16,6 +16,17 @@ service ProfilesService { // so we do not auto-generate the route for profile upload; we instead custom handle with mux rpc Create (stream ProfilePostRequest) returns (CheckResult) {}; + /* + Read an installed profile + + Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + + + Authorization Action: + ``` + compliance:profiles:get + ``` + */ rpc Read (ProfileDetails) returns (Profile) { option (google.api.http) = { get: "/compliance/profiles/read/{owner}/{name}/version/{version}" @@ -29,6 +40,20 @@ service ProfilesService { action: "compliance:profiles:get" }; }; + + /* + Read a market profile + + Read the details of an un-installed profile given the profile name and version. + in the UI, these are the profiles under the "Available" tab. + These profiles are created and maintained by Chef, shipped with Chef Automate. + + + Authorization Action: + ``` + compliance:marketProfiles:get + ``` + */ rpc ReadFromMarket (ProfileDetails) returns (Profile) { option (google.api.http) = { get: "/compliance/market/read/{name}/version/{version}" @@ -42,9 +67,23 @@ service ProfilesService { action: "compliance:marketProfiles:get" }; }; + // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for profile download; we instead custom handle with mux rpc ReadTar(ProfileDetails) returns (stream ProfileData) {}; + + /* + Delete an installed profile + + Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version. + Note: this action "uninstalls" the profile. This has no impact on the market profiles. + + + Authorization Action: + ``` + compliance:profiles:delete + ``` + */ rpc Delete (ProfileDetails) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/compliance/profiles/{owner}/{name}/version/{version}" @@ -58,6 +97,37 @@ service ProfilesService { action: "compliance:profiles:delete" }; }; + + /* + List all profiles + + Lists all profiles available for the Automate instance. + Empty params return all "market" profiles. + Specifying the `owner` field returns all profiles installed for the specified user. + + Supports pagination, sorting, and filtering (wildcard supported). + + Supported sort fields: title, name (default: title) + Supported filter fields: name, version, title + + Example: + ``` + { + "filters":[ + {"type": "title", "values": [ "Dev*"]} + ], + "page": 1, + "per_page": 3, + "owner": "admin" + } + ``` + + + Authorization Action: + ``` + compliance:profiles:list + ``` + */ rpc List (Query) returns (Profiles) { option (google.api.http) = { post: "/compliance/profiles/search" @@ -75,47 +145,78 @@ service ProfilesService { } message ProfilePostRequest { + // Automate user to associate the profile with. Only this user will be able to see the profile in the Automate GUI. string owner = 5; + // Intentionally blank. Chunk chunk = 2; - Metadata meta =3; + // Intentionally blank. + Metadata meta = 3; } +// Metadata about the profile. message Metadata { + // Name of the profile (as specified in the inspec.yml) string name = 2; + // Version of the profile. string version = 3; + // Content type of the profile (e.g. application/json, application/x-gtar, application/gzip) string content_type =4; } + +// Profile contents in byte form. message Chunk { bytes data = 1; int64 position = 2; } message ProfileData { + // Automate user associated with the profile. string owner = 1; + // Name of the profile. string name = 2; + // Version of the profile. string version = 3; + // Profile contents in byte form. bytes data = 4; } message Profiles { + // List of profiles matching the query. repeated Profile profiles = 1; + // Total count of profiles matching the query. int32 total = 20; } + message Profile { + // The profile name, as specified in the inspec.yml string name = 1; + // The profile title, as specified in the inspec.yml string title = 2; + // The profile maintainer, as specified in the inspec.yml string maintainer = 3; + // The profile copyright, as specified in the inspec.yml string copyright = 4; + // The profile copyright email, as specified in the inspec.yml string copyright_email = 5; + // The profile license, as specified in the inspec.yml string license = 6; + // The profile summary, as specified in the inspec.yml string summary = 7; + // The profile version, as specified in the inspec.yml string version = 8; + // The Automate user associated with the profile. string owner = 9; + // The list of operating systems compatible with the profile, as specified in the inspec.yml repeated Support supports = 16; + // The list of dependencies the profile has, as specified in the inspec.yml repeated Dependency depends = 17; + // The SHA256 of the profile. string sha256 = 18; repeated Group groups = 19; + // The list of controls in the profile. repeated Control controls = 20; + // The list of attributes in the profile. repeated Attribute attributes = 21; + // The latest version of the profile. string latest_version = 22; } message Group { @@ -124,27 +225,44 @@ message Group { repeated string controls = 3; } message Control { + // The ID of the control. string id = 1; + // The code (test) for the control. string code = 2; + // The description of the control. string desc = 3; + // The impact of the control. float impact = 4; + // The title of the control. string title = 5; + // Intentionally blank. SourceLocation source_location = 6; + // The results of the control tests. repeated Result results = 7; + // The refs associated with the control. repeated Ref refs = 8; + // The tags associated with the control. map tags = 9; } message Ref { + // URL of the ref. string url = 1; + // Ref for the control. string ref = 2; } message Result { + // Status of the test results (passed, failed, skipped). string status = 1; + // The code (test) that was executed. string code_desc = 2; + // The amount of time it took to execute the test. float run_time = 3; + // The time the test started. string start_time = 4; + // The failure message. string message = 5; + // Reason why the test was skipped. string skip_message = 6; } message SourceLocation { @@ -160,65 +278,106 @@ message Option { string default = 2; } message Support { + // OS name supported by the profile. string os_name = 1; + // OS family supported by the profile. string os_family = 2; + // OS release supported by the profile. string release = 3; + // Minimum InSpec version required for the profile. string inspec_version = 4; + // Platform supported by the profile. string platform = 5; } message Dependency { + // Name of the profile. string name = 1; + // URL of the profile. string url = 2; + // Path of the profile. string path = 3; + // Git location of the profile. string git = 4; + // Branch of the profile. string branch = 5; + // Tag associated with the profile. string tag = 6; + // Commit sha for the profile. string commit = 7; + // Version of the profile. string version = 8; + // Supermarket address of the profile. string supermarket = 9; + // Github address of the profile. string github = 10; + // Automate address of the profile. string compliance = 11; } message ProfileDetails { + // Automate user associated with the profile. string owner = 1; + // Name of the profile. string name = 2; + // Version of the profile. string version = 3; } message CheckResult { + // Intentionally blank. ResultSummary summary = 1; + // Errors returned by the `inspec check` command. repeated CheckMessage errors = 2; + // Warnings returned by the `inspec check` command. repeated CheckMessage warnings = 3; } message ResultSummary { + // Boolean that denotes if the profile is valid or not (as reported by `inspec check`). bool valid = 1; + // Timestamp of when the `inspec check` command was executed. string timestamp = 2; + // Path of the profile that was checked. string location = 3; + // Count of controls in the profile. int32 controls = 4; } message CheckMessage { + // Profile file where the error or warning exists. string file = 1; + // Profile line where the error or warning exists. int32 line = 2; + // Column where the error or warning exists. int32 column = 3; + // Control ID associated with the error or warning. string control_id = 4; + // Message associated with the error or warning. string msg = 5; } message ListFilter { + // List of values to filter on. repeated string values = 20; + // The field to filter on. string type = 21; } message Query { + // Filters to apply to the query repeated ListFilter filters = 20; enum OrderType { ASC = 0; DESC = 1; } + // Order in which to sort. Defaults to ASC. OrderType order = 21; + // Field on which to sort. string sort = 22; + // Page of results requested. int32 page = 23; + // Number of results to return per page. int32 per_page = 24; + // Automate user associated with the profile. string owner = 25; + // Name of the profile (as defined in `inspec.yml`). string name = 26; + // Version of the profile (as defined in `inspec.yml`). string version = 27; } diff --git a/api/external/compliance/profiles/profiles.swagger.json b/api/external/compliance/profiles/profiles.swagger.json index 38953148a46..8dfae501ae2 100644 --- a/api/external/compliance/profiles/profiles.swagger.json +++ b/api/external/compliance/profiles/profiles.swagger.json @@ -13,6 +13,8 @@ "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { + "summary": "Read a market profile", + "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", "operationId": "ReadFromMarket", "responses": { "200": { @@ -25,18 +27,21 @@ "parameters": [ { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "owner", + "description": "Automate user associated with the profile.", "in": "query", "required": false, "type": "string" @@ -49,6 +54,8 @@ }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { + "summary": "Read an installed profile", + "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", "operationId": "Read", "responses": { "200": { @@ -61,18 +68,21 @@ "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -85,6 +95,8 @@ }, "/compliance/profiles/search": { "post": { + "summary": "List all profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", "operationId": "List", "responses": { "200": { @@ -111,6 +123,8 @@ }, "/compliance/profiles/{owner}/{name}/version/{version}": { "delete": { + "summary": "Delete an installed profile", + "description": "Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version.\nNote: this action \"uninstalls\" the profile. This has no impact on the market profiles.\n\n\nAuthorization Action:\n```\ncompliance:profiles:delete\n```", "operationId": "Delete", "responses": { "200": { @@ -123,18 +137,21 @@ "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -162,21 +179,26 @@ "type": "object", "properties": { "file": { - "type": "string" + "type": "string", + "description": "Profile file where the error or warning exists." }, "line": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Profile line where the error or warning exists." }, "column": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Column where the error or warning exists." }, "control_id": { - "type": "string" + "type": "string", + "description": "Control ID associated with the error or warning." }, "msg": { - "type": "string" + "type": "string", + "description": "Message associated with the error or warning." } } }, @@ -184,19 +206,22 @@ "type": "object", "properties": { "summary": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary", + "description": "Intentionally blank." }, "errors": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Errors returned by the `inspec check` command." }, "warnings": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Warnings returned by the `inspec check` command." } } }, @@ -211,47 +236,57 @@ "type": "string", "format": "int64" } - } + }, + "description": "Profile contents in byte form." }, "chef.automate.api.compliance.profiles.v1.Control": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "The ID of the control." }, "code": { - "type": "string" + "type": "string", + "description": "The code (test) for the control." }, "desc": { - "type": "string" + "type": "string", + "description": "The description of the control." }, "impact": { "type": "number", - "format": "float" + "format": "float", + "description": "The impact of the control." }, "title": { - "type": "string" + "type": "string", + "description": "The title of the control." }, "source_location": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation", + "description": "Intentionally blank." }, "results": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Result" - } + }, + "description": "The results of the control tests." }, "refs": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Ref" - } + }, + "description": "The refs associated with the control." }, "tags": { "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "The tags associated with the control." } } }, @@ -259,37 +294,48 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "url": { - "type": "string" + "type": "string", + "description": "URL of the profile." }, "path": { - "type": "string" + "type": "string", + "description": "Path of the profile." }, "git": { - "type": "string" + "type": "string", + "description": "Git location of the profile." }, "branch": { - "type": "string" + "type": "string", + "description": "Branch of the profile." }, "tag": { - "type": "string" + "type": "string", + "description": "Tag associated with the profile." }, "commit": { - "type": "string" + "type": "string", + "description": "Commit sha for the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "supermarket": { - "type": "string" + "type": "string", + "description": "Supermarket address of the profile." }, "github": { - "type": "string" + "type": "string", + "description": "Github address of the profile." }, "compliance": { - "type": "string" + "type": "string", + "description": "Automate address of the profile." } } }, @@ -317,10 +363,12 @@ "type": "array", "items": { "type": "string" - } + }, + "description": "List of values to filter on." }, "type": { - "type": "string" + "type": "string", + "description": "The field to filter on." } } }, @@ -328,15 +376,19 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "Name of the profile (as specified in the inspec.yml)" }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "content_type": { - "type": "string" + "type": "string", + "title": "Content type of the profile (e.g. application/json, application/x-gtar, application/gzip)" } - } + }, + "description": "Metadata about the profile." }, "chef.automate.api.compliance.profiles.v1.Option": { "type": "object", @@ -353,46 +405,58 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "The profile name, as specified in the inspec.yml" }, "title": { - "type": "string" + "type": "string", + "title": "The profile title, as specified in the inspec.yml" }, "maintainer": { - "type": "string" + "type": "string", + "title": "The profile maintainer, as specified in the inspec.yml" }, "copyright": { - "type": "string" + "type": "string", + "title": "The profile copyright, as specified in the inspec.yml" }, "copyright_email": { - "type": "string" + "type": "string", + "title": "The profile copyright email, as specified in the inspec.yml" }, "license": { - "type": "string" + "type": "string", + "title": "The profile license, as specified in the inspec.yml" }, "summary": { - "type": "string" + "type": "string", + "title": "The profile summary, as specified in the inspec.yml" }, "version": { - "type": "string" + "type": "string", + "title": "The profile version, as specified in the inspec.yml" }, "owner": { - "type": "string" + "type": "string", + "description": "The Automate user associated with the profile." }, "supports": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Support" - } + }, + "title": "The list of operating systems compatible with the profile, as specified in the inspec.yml" }, "depends": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Dependency" - } + }, + "title": "The list of dependencies the profile has, as specified in the inspec.yml" }, "sha256": { - "type": "string" + "type": "string", + "description": "The SHA256 of the profile." }, "groups": { "type": "array", @@ -404,16 +468,19 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Control" - } + }, + "description": "The list of controls in the profile." }, "attributes": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Attribute" - } + }, + "description": "The list of attributes in the profile." }, "latest_version": { - "type": "string" + "type": "string", + "description": "The latest version of the profile." } } }, @@ -421,17 +488,21 @@ "type": "object", "properties": { "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "data": { "type": "string", - "format": "byte" + "format": "byte", + "description": "Profile contents in byte form." } } }, @@ -442,11 +513,13 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Profile" - } + }, + "description": "List of profiles matching the query." }, "total": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Total count of profiles matching the query." } } }, @@ -457,30 +530,38 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ListFilter" - } + }, + "title": "Filters to apply to the query" }, "order": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType", + "description": "Order in which to sort. Defaults to ASC." }, "sort": { - "type": "string" + "type": "string", + "description": "Field on which to sort." }, "page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Page of results requested." }, "per_page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Number of results to return per page." }, "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile (as defined in `inspec.yml`)." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile (as defined in `inspec.yml`)." } } }, @@ -496,10 +577,12 @@ "type": "object", "properties": { "url": { - "type": "string" + "type": "string", + "description": "URL of the ref." }, "ref": { - "type": "string" + "type": "string", + "description": "Ref for the control." } } }, @@ -507,23 +590,29 @@ "type": "object", "properties": { "status": { - "type": "string" + "type": "string", + "description": "Status of the test results (passed, failed, skipped)." }, "code_desc": { - "type": "string" + "type": "string", + "description": "The code (test) that was executed." }, "run_time": { "type": "number", - "format": "float" + "format": "float", + "description": "The amount of time it took to execute the test." }, "start_time": { - "type": "string" + "type": "string", + "description": "The time the test started." }, "message": { - "type": "string" + "type": "string", + "description": "The failure message." }, "skip_message": { - "type": "string" + "type": "string", + "description": "Reason why the test was skipped." } } }, @@ -532,17 +621,21 @@ "properties": { "valid": { "type": "boolean", - "format": "boolean" + "format": "boolean", + "description": "Boolean that denotes if the profile is valid or not (as reported by `inspec check`)." }, "timestamp": { - "type": "string" + "type": "string", + "description": "Timestamp of when the `inspec check` command was executed." }, "location": { - "type": "string" + "type": "string", + "description": "Path of the profile that was checked." }, "controls": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Count of controls in the profile." } } }, @@ -562,19 +655,24 @@ "type": "object", "properties": { "os_name": { - "type": "string" + "type": "string", + "description": "OS name supported by the profile." }, "os_family": { - "type": "string" + "type": "string", + "description": "OS family supported by the profile." }, "release": { - "type": "string" + "type": "string", + "description": "OS release supported by the profile." }, "inspec_version": { - "type": "string" + "type": "string", + "description": "Minimum InSpec version required for the profile." }, "platform": { - "type": "string" + "type": "string", + "description": "Platform supported by the profile." } } }, diff --git a/components/automate-chef-io/data/docs/api-static/03-tags.swagger.json b/components/automate-chef-io/data/docs/api-static/03-tags.swagger.json index cf4c27681b2..f1af6283239 100644 --- a/components/automate-chef-io/data/docs/api-static/03-tags.swagger.json +++ b/components/automate-chef-io/data/docs/api-static/03-tags.swagger.json @@ -2,7 +2,7 @@ "x-tagGroups": [ { "name": "Compliance", - "tags": ["ReportingService", "StatsService", "JobsService"] + "tags": ["ReportingService", "StatsService", "JobsService", "ProfilesService"] }, { "name": "Infra", @@ -27,6 +27,7 @@ ], "tags": [ { "name": "ReportingService", "x-displayName": "Reporting" }, + { "name": "ProfilesService", "x-displayName": "Profiles" }, { "name": "StatsService", "x-displayName": "Stats" }, { "name": "ConfigMgmt", "x-displayName": "Nodes" }, { "name": "NodesService", "x-displayName": "Managed Nodes" }, diff --git a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json index 38953148a46..8dfae501ae2 100644 --- a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json +++ b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json @@ -13,6 +13,8 @@ "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { + "summary": "Read a market profile", + "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", "operationId": "ReadFromMarket", "responses": { "200": { @@ -25,18 +27,21 @@ "parameters": [ { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "owner", + "description": "Automate user associated with the profile.", "in": "query", "required": false, "type": "string" @@ -49,6 +54,8 @@ }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { + "summary": "Read an installed profile", + "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", "operationId": "Read", "responses": { "200": { @@ -61,18 +68,21 @@ "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -85,6 +95,8 @@ }, "/compliance/profiles/search": { "post": { + "summary": "List all profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", "operationId": "List", "responses": { "200": { @@ -111,6 +123,8 @@ }, "/compliance/profiles/{owner}/{name}/version/{version}": { "delete": { + "summary": "Delete an installed profile", + "description": "Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version.\nNote: this action \"uninstalls\" the profile. This has no impact on the market profiles.\n\n\nAuthorization Action:\n```\ncompliance:profiles:delete\n```", "operationId": "Delete", "responses": { "200": { @@ -123,18 +137,21 @@ "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -162,21 +179,26 @@ "type": "object", "properties": { "file": { - "type": "string" + "type": "string", + "description": "Profile file where the error or warning exists." }, "line": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Profile line where the error or warning exists." }, "column": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Column where the error or warning exists." }, "control_id": { - "type": "string" + "type": "string", + "description": "Control ID associated with the error or warning." }, "msg": { - "type": "string" + "type": "string", + "description": "Message associated with the error or warning." } } }, @@ -184,19 +206,22 @@ "type": "object", "properties": { "summary": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary", + "description": "Intentionally blank." }, "errors": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Errors returned by the `inspec check` command." }, "warnings": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Warnings returned by the `inspec check` command." } } }, @@ -211,47 +236,57 @@ "type": "string", "format": "int64" } - } + }, + "description": "Profile contents in byte form." }, "chef.automate.api.compliance.profiles.v1.Control": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "The ID of the control." }, "code": { - "type": "string" + "type": "string", + "description": "The code (test) for the control." }, "desc": { - "type": "string" + "type": "string", + "description": "The description of the control." }, "impact": { "type": "number", - "format": "float" + "format": "float", + "description": "The impact of the control." }, "title": { - "type": "string" + "type": "string", + "description": "The title of the control." }, "source_location": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation", + "description": "Intentionally blank." }, "results": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Result" - } + }, + "description": "The results of the control tests." }, "refs": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Ref" - } + }, + "description": "The refs associated with the control." }, "tags": { "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "The tags associated with the control." } } }, @@ -259,37 +294,48 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "url": { - "type": "string" + "type": "string", + "description": "URL of the profile." }, "path": { - "type": "string" + "type": "string", + "description": "Path of the profile." }, "git": { - "type": "string" + "type": "string", + "description": "Git location of the profile." }, "branch": { - "type": "string" + "type": "string", + "description": "Branch of the profile." }, "tag": { - "type": "string" + "type": "string", + "description": "Tag associated with the profile." }, "commit": { - "type": "string" + "type": "string", + "description": "Commit sha for the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "supermarket": { - "type": "string" + "type": "string", + "description": "Supermarket address of the profile." }, "github": { - "type": "string" + "type": "string", + "description": "Github address of the profile." }, "compliance": { - "type": "string" + "type": "string", + "description": "Automate address of the profile." } } }, @@ -317,10 +363,12 @@ "type": "array", "items": { "type": "string" - } + }, + "description": "List of values to filter on." }, "type": { - "type": "string" + "type": "string", + "description": "The field to filter on." } } }, @@ -328,15 +376,19 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "Name of the profile (as specified in the inspec.yml)" }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "content_type": { - "type": "string" + "type": "string", + "title": "Content type of the profile (e.g. application/json, application/x-gtar, application/gzip)" } - } + }, + "description": "Metadata about the profile." }, "chef.automate.api.compliance.profiles.v1.Option": { "type": "object", @@ -353,46 +405,58 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "The profile name, as specified in the inspec.yml" }, "title": { - "type": "string" + "type": "string", + "title": "The profile title, as specified in the inspec.yml" }, "maintainer": { - "type": "string" + "type": "string", + "title": "The profile maintainer, as specified in the inspec.yml" }, "copyright": { - "type": "string" + "type": "string", + "title": "The profile copyright, as specified in the inspec.yml" }, "copyright_email": { - "type": "string" + "type": "string", + "title": "The profile copyright email, as specified in the inspec.yml" }, "license": { - "type": "string" + "type": "string", + "title": "The profile license, as specified in the inspec.yml" }, "summary": { - "type": "string" + "type": "string", + "title": "The profile summary, as specified in the inspec.yml" }, "version": { - "type": "string" + "type": "string", + "title": "The profile version, as specified in the inspec.yml" }, "owner": { - "type": "string" + "type": "string", + "description": "The Automate user associated with the profile." }, "supports": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Support" - } + }, + "title": "The list of operating systems compatible with the profile, as specified in the inspec.yml" }, "depends": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Dependency" - } + }, + "title": "The list of dependencies the profile has, as specified in the inspec.yml" }, "sha256": { - "type": "string" + "type": "string", + "description": "The SHA256 of the profile." }, "groups": { "type": "array", @@ -404,16 +468,19 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Control" - } + }, + "description": "The list of controls in the profile." }, "attributes": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Attribute" - } + }, + "description": "The list of attributes in the profile." }, "latest_version": { - "type": "string" + "type": "string", + "description": "The latest version of the profile." } } }, @@ -421,17 +488,21 @@ "type": "object", "properties": { "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "data": { "type": "string", - "format": "byte" + "format": "byte", + "description": "Profile contents in byte form." } } }, @@ -442,11 +513,13 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Profile" - } + }, + "description": "List of profiles matching the query." }, "total": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Total count of profiles matching the query." } } }, @@ -457,30 +530,38 @@ "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ListFilter" - } + }, + "title": "Filters to apply to the query" }, "order": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType", + "description": "Order in which to sort. Defaults to ASC." }, "sort": { - "type": "string" + "type": "string", + "description": "Field on which to sort." }, "page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Page of results requested." }, "per_page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Number of results to return per page." }, "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile (as defined in `inspec.yml`)." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile (as defined in `inspec.yml`)." } } }, @@ -496,10 +577,12 @@ "type": "object", "properties": { "url": { - "type": "string" + "type": "string", + "description": "URL of the ref." }, "ref": { - "type": "string" + "type": "string", + "description": "Ref for the control." } } }, @@ -507,23 +590,29 @@ "type": "object", "properties": { "status": { - "type": "string" + "type": "string", + "description": "Status of the test results (passed, failed, skipped)." }, "code_desc": { - "type": "string" + "type": "string", + "description": "The code (test) that was executed." }, "run_time": { "type": "number", - "format": "float" + "format": "float", + "description": "The amount of time it took to execute the test." }, "start_time": { - "type": "string" + "type": "string", + "description": "The time the test started." }, "message": { - "type": "string" + "type": "string", + "description": "The failure message." }, "skip_message": { - "type": "string" + "type": "string", + "description": "Reason why the test was skipped." } } }, @@ -532,17 +621,21 @@ "properties": { "valid": { "type": "boolean", - "format": "boolean" + "format": "boolean", + "description": "Boolean that denotes if the profile is valid or not (as reported by `inspec check`)." }, "timestamp": { - "type": "string" + "type": "string", + "description": "Timestamp of when the `inspec check` command was executed." }, "location": { - "type": "string" + "type": "string", + "description": "Path of the profile that was checked." }, "controls": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Count of controls in the profile." } } }, @@ -562,19 +655,24 @@ "type": "object", "properties": { "os_name": { - "type": "string" + "type": "string", + "description": "OS name supported by the profile." }, "os_family": { - "type": "string" + "type": "string", + "description": "OS family supported by the profile." }, "release": { - "type": "string" + "type": "string", + "description": "OS release supported by the profile." }, "inspec_version": { - "type": "string" + "type": "string", + "description": "Minimum InSpec version required for the profile." }, "platform": { - "type": "string" + "type": "string", + "description": "Platform supported by the profile." } } }, diff --git a/components/automate-chef-io/data/docs/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/automate-chef-io/data/docs/api_chef_automate/infra_proxy/infra_proxy.swagger.json index c03c169c58c..9f43aebc084 100644 --- a/components/automate-chef-io/data/docs/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/automate-chef-io/data/docs/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -395,6 +395,72 @@ ] } }, + "/infra/servers/{server_id}/orgs/{org_id}/clients": { + "get": { + "operationId": "GetClients", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Clients" + } + } + }, + "parameters": [ + { + "name": "server_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, + "/infra/servers/{server_id}/orgs/{org_id}/clients/{name}": { + "get": { + "operationId": "GetClient", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Client" + } + } + }, + "parameters": [ + { + "name": "server_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, "/infra/servers/{server_id}/orgs/{org_id}/cookbooks": { "get": { "operationId": "GetCookbooks", @@ -779,6 +845,65 @@ } } }, + "chef.automate.api.infra_proxy.response.Client": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "client_name": { + "type": "string" + }, + "org_name": { + "type": "string" + }, + "admin": { + "type": "boolean", + "format": "boolean" + }, + "validator": { + "type": "boolean", + "format": "boolean" + }, + "certificate": { + "type": "string" + }, + "public_key": { + "type": "string" + }, + "private_key": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "json_class": { + "type": "string" + }, + "chef_type": { + "type": "string" + } + } + }, + "chef.automate.api.infra_proxy.response.ClientListItem": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "chef.automate.api.infra_proxy.response.Clients": { + "type": "object", + "properties": { + "clients": { + "type": "array", + "items": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.ClientListItem" + } + } + } + }, "chef.automate.api.infra_proxy.response.Cookbook": { "type": "object", "properties": { diff --git a/components/automate-gateway/api/profiles.pb.swagger.go b/components/automate-gateway/api/profiles.pb.swagger.go index 1f9bd635817..37eb915d9cf 100644 --- a/components/automate-gateway/api/profiles.pb.swagger.go +++ b/components/automate-gateway/api/profiles.pb.swagger.go @@ -16,6 +16,8 @@ func init() { "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { + "summary": "Read a market profile", + "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:marketProfiles:get\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "ReadFromMarket", "responses": { "200": { @@ -28,18 +30,21 @@ func init() { "parameters": [ { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "owner", + "description": "Automate user associated with the profile.", "in": "query", "required": false, "type": "string" @@ -52,6 +57,8 @@ func init() { }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { + "summary": "Read an installed profile", + "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:get\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "Read", "responses": { "200": { @@ -64,18 +71,21 @@ func init() { "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -88,6 +98,8 @@ func init() { }, "/compliance/profiles/search": { "post": { + "summary": "List all profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the ` + "`" + `owner` + "`" + ` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n` + "`" + `` + "`" + `` + "`" + `\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:list\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "List", "responses": { "200": { @@ -114,6 +126,8 @@ func init() { }, "/compliance/profiles/{owner}/{name}/version/{version}": { "delete": { + "summary": "Delete an installed profile", + "description": "Delete an installed profile given the profile name, owner (Automate user associated with the profile), and version.\nNote: this action \"uninstalls\" the profile. This has no impact on the market profiles.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:delete\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "Delete", "responses": { "200": { @@ -126,18 +140,21 @@ func init() { "parameters": [ { "name": "owner", + "description": "Automate user associated with the profile.", "in": "path", "required": true, "type": "string" }, { "name": "name", + "description": "Name of the profile.", "in": "path", "required": true, "type": "string" }, { "name": "version", + "description": "Version of the profile.", "in": "path", "required": true, "type": "string" @@ -165,21 +182,26 @@ func init() { "type": "object", "properties": { "file": { - "type": "string" + "type": "string", + "description": "Profile file where the error or warning exists." }, "line": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Profile line where the error or warning exists." }, "column": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Column where the error or warning exists." }, "control_id": { - "type": "string" + "type": "string", + "description": "Control ID associated with the error or warning." }, "msg": { - "type": "string" + "type": "string", + "description": "Message associated with the error or warning." } } }, @@ -187,19 +209,22 @@ func init() { "type": "object", "properties": { "summary": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ResultSummary", + "description": "Intentionally blank." }, "errors": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Errors returned by the ` + "`" + `inspec check` + "`" + ` command." }, "warnings": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.CheckMessage" - } + }, + "description": "Warnings returned by the ` + "`" + `inspec check` + "`" + ` command." } } }, @@ -214,47 +239,57 @@ func init() { "type": "string", "format": "int64" } - } + }, + "description": "Profile contents in byte form." }, "chef.automate.api.compliance.profiles.v1.Control": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "The ID of the control." }, "code": { - "type": "string" + "type": "string", + "description": "The code (test) for the control." }, "desc": { - "type": "string" + "type": "string", + "description": "The description of the control." }, "impact": { "type": "number", - "format": "float" + "format": "float", + "description": "The impact of the control." }, "title": { - "type": "string" + "type": "string", + "description": "The title of the control." }, "source_location": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.SourceLocation", + "description": "Intentionally blank." }, "results": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Result" - } + }, + "description": "The results of the control tests." }, "refs": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Ref" - } + }, + "description": "The refs associated with the control." }, "tags": { "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "The tags associated with the control." } } }, @@ -262,37 +297,48 @@ func init() { "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "url": { - "type": "string" + "type": "string", + "description": "URL of the profile." }, "path": { - "type": "string" + "type": "string", + "description": "Path of the profile." }, "git": { - "type": "string" + "type": "string", + "description": "Git location of the profile." }, "branch": { - "type": "string" + "type": "string", + "description": "Branch of the profile." }, "tag": { - "type": "string" + "type": "string", + "description": "Tag associated with the profile." }, "commit": { - "type": "string" + "type": "string", + "description": "Commit sha for the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "supermarket": { - "type": "string" + "type": "string", + "description": "Supermarket address of the profile." }, "github": { - "type": "string" + "type": "string", + "description": "Github address of the profile." }, "compliance": { - "type": "string" + "type": "string", + "description": "Automate address of the profile." } } }, @@ -320,10 +366,12 @@ func init() { "type": "array", "items": { "type": "string" - } + }, + "description": "List of values to filter on." }, "type": { - "type": "string" + "type": "string", + "description": "The field to filter on." } } }, @@ -331,15 +379,19 @@ func init() { "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "Name of the profile (as specified in the inspec.yml)" }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "content_type": { - "type": "string" + "type": "string", + "title": "Content type of the profile (e.g. application/json, application/x-gtar, application/gzip)" } - } + }, + "description": "Metadata about the profile." }, "chef.automate.api.compliance.profiles.v1.Option": { "type": "object", @@ -356,46 +408,58 @@ func init() { "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "The profile name, as specified in the inspec.yml" }, "title": { - "type": "string" + "type": "string", + "title": "The profile title, as specified in the inspec.yml" }, "maintainer": { - "type": "string" + "type": "string", + "title": "The profile maintainer, as specified in the inspec.yml" }, "copyright": { - "type": "string" + "type": "string", + "title": "The profile copyright, as specified in the inspec.yml" }, "copyright_email": { - "type": "string" + "type": "string", + "title": "The profile copyright email, as specified in the inspec.yml" }, "license": { - "type": "string" + "type": "string", + "title": "The profile license, as specified in the inspec.yml" }, "summary": { - "type": "string" + "type": "string", + "title": "The profile summary, as specified in the inspec.yml" }, "version": { - "type": "string" + "type": "string", + "title": "The profile version, as specified in the inspec.yml" }, "owner": { - "type": "string" + "type": "string", + "description": "The Automate user associated with the profile." }, "supports": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Support" - } + }, + "title": "The list of operating systems compatible with the profile, as specified in the inspec.yml" }, "depends": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Dependency" - } + }, + "title": "The list of dependencies the profile has, as specified in the inspec.yml" }, "sha256": { - "type": "string" + "type": "string", + "description": "The SHA256 of the profile." }, "groups": { "type": "array", @@ -407,16 +471,19 @@ func init() { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Control" - } + }, + "description": "The list of controls in the profile." }, "attributes": { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Attribute" - } + }, + "description": "The list of attributes in the profile." }, "latest_version": { - "type": "string" + "type": "string", + "description": "The latest version of the profile." } } }, @@ -424,17 +491,21 @@ func init() { "type": "object", "properties": { "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile." }, "data": { "type": "string", - "format": "byte" + "format": "byte", + "description": "Profile contents in byte form." } } }, @@ -445,11 +516,13 @@ func init() { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Profile" - } + }, + "description": "List of profiles matching the query." }, "total": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Total count of profiles matching the query." } } }, @@ -460,30 +533,38 @@ func init() { "type": "array", "items": { "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.ListFilter" - } + }, + "title": "Filters to apply to the query" }, "order": { - "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType" + "$ref": "#/definitions/chef.automate.api.compliance.profiles.v1.Query.OrderType", + "description": "Order in which to sort. Defaults to ASC." }, "sort": { - "type": "string" + "type": "string", + "description": "Field on which to sort." }, "page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Page of results requested." }, "per_page": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Number of results to return per page." }, "owner": { - "type": "string" + "type": "string", + "description": "Automate user associated with the profile." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the profile (as defined in ` + "`" + `inspec.yml` + "`" + `)." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the profile (as defined in ` + "`" + `inspec.yml` + "`" + `)." } } }, @@ -499,10 +580,12 @@ func init() { "type": "object", "properties": { "url": { - "type": "string" + "type": "string", + "description": "URL of the ref." }, "ref": { - "type": "string" + "type": "string", + "description": "Ref for the control." } } }, @@ -510,23 +593,29 @@ func init() { "type": "object", "properties": { "status": { - "type": "string" + "type": "string", + "description": "Status of the test results (passed, failed, skipped)." }, "code_desc": { - "type": "string" + "type": "string", + "description": "The code (test) that was executed." }, "run_time": { "type": "number", - "format": "float" + "format": "float", + "description": "The amount of time it took to execute the test." }, "start_time": { - "type": "string" + "type": "string", + "description": "The time the test started." }, "message": { - "type": "string" + "type": "string", + "description": "The failure message." }, "skip_message": { - "type": "string" + "type": "string", + "description": "Reason why the test was skipped." } } }, @@ -535,17 +624,21 @@ func init() { "properties": { "valid": { "type": "boolean", - "format": "boolean" + "format": "boolean", + "description": "Boolean that denotes if the profile is valid or not (as reported by ` + "`" + `inspec check` + "`" + `)." }, "timestamp": { - "type": "string" + "type": "string", + "description": "Timestamp of when the ` + "`" + `inspec check` + "`" + ` command was executed." }, "location": { - "type": "string" + "type": "string", + "description": "Path of the profile that was checked." }, "controls": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Count of controls in the profile." } } }, @@ -565,19 +658,24 @@ func init() { "type": "object", "properties": { "os_name": { - "type": "string" + "type": "string", + "description": "OS name supported by the profile." }, "os_family": { - "type": "string" + "type": "string", + "description": "OS family supported by the profile." }, "release": { - "type": "string" + "type": "string", + "description": "OS release supported by the profile." }, "inspec_version": { - "type": "string" + "type": "string", + "description": "Minimum InSpec version required for the profile." }, "platform": { - "type": "string" + "type": "string", + "description": "Platform supported by the profile." } } }, From cdac83d822733d4f4912eaad43f40e6189cdac50 Mon Sep 17 00:00:00 2001 From: kagarmoe Date: Fri, 13 Mar 2020 13:52:06 -0700 Subject: [PATCH 2/4] Change 'read' to 'show' Signed-off-by: kagarmoe --- .../compliance/profiles/profiles.swagger.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json index 8dfae501ae2..f4e2e5f357b 100644 --- a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json +++ b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json @@ -13,8 +13,8 @@ "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { - "summary": "Read a market profile", - "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", + "summary": "View an available profile", + "description": "View the details of an un-installed profile using the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab.\nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", "operationId": "ReadFromMarket", "responses": { "200": { @@ -54,8 +54,8 @@ }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { - "summary": "Read an installed profile", - "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", + "summary": "View an installed profile", + "description": "View the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", "operationId": "Read", "responses": { "200": { @@ -95,8 +95,8 @@ }, "/compliance/profiles/search": { "post": { - "summary": "List all profiles", - "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", + "summary": "List all available profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n],\n\"page\": 1,\n\"per_page\": 3,\n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", "operationId": "List", "responses": { "200": { @@ -595,7 +595,7 @@ }, "code_desc": { "type": "string", - "description": "The code (test) that was executed." + "description": "The code (test) executed." }, "run_time": { "type": "number", @@ -612,7 +612,7 @@ }, "skip_message": { "type": "string", - "description": "Reason why the test was skipped." + "description": "Reason for skipping the test." } } }, @@ -630,7 +630,7 @@ }, "location": { "type": "string", - "description": "Path of the profile that was checked." + "description": "Path of the checked profile." }, "controls": { "type": "integer", From d988f4634632c0b538b5364a8c5510e370982b5c Mon Sep 17 00:00:00 2001 From: kagarmoe Date: Fri, 13 Mar 2020 14:41:25 -0700 Subject: [PATCH 3/4] Push the actual files Signed-off-by: kagarmoe --- .../compliance/profiles/profiles.swagger.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json index f4e2e5f357b..8a69fb5eae8 100644 --- a/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json +++ b/components/automate-chef-io/data/docs/api_chef_automate/compliance/profiles/profiles.swagger.json @@ -13,8 +13,8 @@ "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { - "summary": "View an available profile", - "description": "View the details of an un-installed profile using the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab.\nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", + "summary": "Show an available profile", + "description": "Show the details of an un-installed profile using the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab.\nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", "operationId": "ReadFromMarket", "responses": { "200": { @@ -54,8 +54,8 @@ }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { - "summary": "View an installed profile", - "description": "View the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", + "summary": "Show an installed profile", + "description": "Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", "operationId": "Read", "responses": { "200": { From 82dd5d5044a9d6f3b6989275e5a8558aa36c289c Mon Sep 17 00:00:00 2001 From: kagarmoe Date: Fri, 13 Mar 2020 14:47:28 -0700 Subject: [PATCH 4/4] Add the files once more Signed-off-by: kagarmoe --- .../compliance/profiles/profiles.pb.go | 28 ++++++++--------- .../compliance/profiles/profiles.proto | 30 +++++++++---------- .../compliance/profiles/profiles.swagger.json | 18 +++++------ .../api/profiles.pb.swagger.go | 18 +++++------ 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/api/external/compliance/profiles/profiles.pb.go b/api/external/compliance/profiles/profiles.pb.go index 9a7939634db..001d76b422c 100644 --- a/api/external/compliance/profiles/profiles.pb.go +++ b/api/external/compliance/profiles/profiles.pb.go @@ -54,7 +54,7 @@ func (Query_OrderType) EnumDescriptor() ([]byte, []int) { } type ProfilePostRequest struct { - // Automate user to associate the profile with. Only this user will be able to see the profile in the Automate GUI. + // Associate an automate user with a profile. A profile is visible only to its associated user. Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` // Intentionally blank. Chunk *Chunk `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` @@ -727,7 +727,7 @@ func (m *Ref) GetRef() string { type Result struct { // Status of the test results (passed, failed, skipped). Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // The code (test) that was executed. + // The code (test) executed. CodeDesc string `protobuf:"bytes,2,opt,name=code_desc,json=codeDesc,proto3" json:"code_desc,omitempty"` // The amount of time it took to execute the test. RunTime float32 `protobuf:"fixed32,3,opt,name=run_time,json=runTime,proto3" json:"run_time,omitempty"` @@ -735,7 +735,7 @@ type Result struct { StartTime string `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // The failure message. Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` - // Reason why the test was skipped. + // Reason for skipping the test. SkipMessage string `protobuf:"bytes,6,opt,name=skip_message,json=skipMessage,proto3" json:"skip_message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1277,7 +1277,7 @@ type ResultSummary struct { Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` // Timestamp of when the `inspec check` command was executed. Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Path of the profile that was checked. + // Path of the checked profile. Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` // Count of controls in the profile. Controls int32 `protobuf:"varint,4,opt,name=controls,proto3" json:"controls,omitempty"` @@ -1732,9 +1732,9 @@ type ProfilesServiceClient interface { // so we do not auto-generate the route for profile upload; we instead custom handle with mux Create(ctx context.Context, opts ...grpc.CallOption) (ProfilesService_CreateClient, error) // - //Read an installed profile + //Show an installed profile // - //Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + //Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. // // //Authorization Action: @@ -1743,9 +1743,9 @@ type ProfilesServiceClient interface { //``` Read(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (*Profile, error) // - //Read a market profile + //Show an available profile // - //Read the details of an un-installed profile given the profile name and version. + //Show the details of an un-installed profile using the profile name and version. //in the UI, these are the profiles under the "Available" tab. //These profiles are created and maintained by Chef, shipped with Chef Automate. // @@ -1771,7 +1771,7 @@ type ProfilesServiceClient interface { //``` Delete(ctx context.Context, in *ProfileDetails, opts ...grpc.CallOption) (*empty.Empty, error) // - //List all profiles + //List all available profiles // //Lists all profiles available for the Automate instance. //Empty params return all "market" profiles. @@ -1918,9 +1918,9 @@ type ProfilesServiceServer interface { // so we do not auto-generate the route for profile upload; we instead custom handle with mux Create(ProfilesService_CreateServer) error // - //Read an installed profile + //Show an installed profile // - //Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + //Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. // // //Authorization Action: @@ -1929,9 +1929,9 @@ type ProfilesServiceServer interface { //``` Read(context.Context, *ProfileDetails) (*Profile, error) // - //Read a market profile + //Show an available profile // - //Read the details of an un-installed profile given the profile name and version. + //Show the details of an un-installed profile using the profile name and version. //in the UI, these are the profiles under the "Available" tab. //These profiles are created and maintained by Chef, shipped with Chef Automate. // @@ -1957,7 +1957,7 @@ type ProfilesServiceServer interface { //``` Delete(context.Context, *ProfileDetails) (*empty.Empty, error) // - //List all profiles + //List all available profiles // //Lists all profiles available for the Automate instance. //Empty params return all "market" profiles. diff --git a/api/external/compliance/profiles/profiles.proto b/api/external/compliance/profiles/profiles.proto index 56bb25f5f32..1a01af0a685 100644 --- a/api/external/compliance/profiles/profiles.proto +++ b/api/external/compliance/profiles/profiles.proto @@ -17,9 +17,9 @@ service ProfilesService { rpc Create (stream ProfilePostRequest) returns (CheckResult) {}; /* - Read an installed profile + Show an installed profile - Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. + Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version. Authorization Action: @@ -42,10 +42,10 @@ service ProfilesService { }; /* - Read a market profile + Show an available profile - Read the details of an un-installed profile given the profile name and version. - in the UI, these are the profiles under the "Available" tab. + Show the details of an un-installed profile using the profile name and version. + in the UI, these are the profiles under the "Available" tab. These profiles are created and maintained by Chef, shipped with Chef Automate. @@ -67,7 +67,7 @@ service ProfilesService { action: "compliance:marketProfiles:get" }; }; - + // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for profile download; we instead custom handle with mux rpc ReadTar(ProfileDetails) returns (stream ProfileData) {}; @@ -99,7 +99,7 @@ service ProfilesService { }; /* - List all profiles + List all available profiles Lists all profiles available for the Automate instance. Empty params return all "market" profiles. @@ -115,9 +115,9 @@ service ProfilesService { { "filters":[ {"type": "title", "values": [ "Dev*"]} - ], - "page": 1, - "per_page": 3, + ], + "page": 1, + "per_page": 3, "owner": "admin" } ``` @@ -145,7 +145,7 @@ service ProfilesService { } message ProfilePostRequest { - // Automate user to associate the profile with. Only this user will be able to see the profile in the Automate GUI. + // Associate an automate user with a profile. A profile is visible only to its associated user. string owner = 5; // Intentionally blank. Chunk chunk = 2; @@ -254,7 +254,7 @@ message Ref { message Result { // Status of the test results (passed, failed, skipped). string status = 1; - // The code (test) that was executed. + // The code (test) executed. string code_desc = 2; // The amount of time it took to execute the test. float run_time = 3; @@ -262,7 +262,7 @@ message Result { string start_time = 4; // The failure message. string message = 5; - // Reason why the test was skipped. + // Reason for skipping the test. string skip_message = 6; } message SourceLocation { @@ -336,7 +336,7 @@ message ResultSummary { bool valid = 1; // Timestamp of when the `inspec check` command was executed. string timestamp = 2; - // Path of the profile that was checked. + // Path of the checked profile. string location = 3; // Count of controls in the profile. int32 controls = 4; @@ -354,7 +354,7 @@ message CheckMessage { string msg = 5; } message ListFilter { - // List of values to filter on. + // List of values to filter on. repeated string values = 20; // The field to filter on. string type = 21; diff --git a/api/external/compliance/profiles/profiles.swagger.json b/api/external/compliance/profiles/profiles.swagger.json index 8dfae501ae2..8a69fb5eae8 100644 --- a/api/external/compliance/profiles/profiles.swagger.json +++ b/api/external/compliance/profiles/profiles.swagger.json @@ -13,8 +13,8 @@ "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { - "summary": "Read a market profile", - "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", + "summary": "Show an available profile", + "description": "Show the details of an un-installed profile using the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab.\nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n```\ncompliance:marketProfiles:get\n```", "operationId": "ReadFromMarket", "responses": { "200": { @@ -54,8 +54,8 @@ }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { - "summary": "Read an installed profile", - "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", + "summary": "Show an installed profile", + "description": "Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n```\ncompliance:profiles:get\n```", "operationId": "Read", "responses": { "200": { @@ -95,8 +95,8 @@ }, "/compliance/profiles/search": { "post": { - "summary": "List all profiles", - "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", + "summary": "List all available profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the `owner` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n```\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n],\n\"page\": 1,\n\"per_page\": 3,\n\"owner\": \"admin\"\n}\n```\n\n\nAuthorization Action:\n```\ncompliance:profiles:list\n```", "operationId": "List", "responses": { "200": { @@ -595,7 +595,7 @@ }, "code_desc": { "type": "string", - "description": "The code (test) that was executed." + "description": "The code (test) executed." }, "run_time": { "type": "number", @@ -612,7 +612,7 @@ }, "skip_message": { "type": "string", - "description": "Reason why the test was skipped." + "description": "Reason for skipping the test." } } }, @@ -630,7 +630,7 @@ }, "location": { "type": "string", - "description": "Path of the profile that was checked." + "description": "Path of the checked profile." }, "controls": { "type": "integer", diff --git a/components/automate-gateway/api/profiles.pb.swagger.go b/components/automate-gateway/api/profiles.pb.swagger.go index 37eb915d9cf..06d2991fa12 100644 --- a/components/automate-gateway/api/profiles.pb.swagger.go +++ b/components/automate-gateway/api/profiles.pb.swagger.go @@ -16,8 +16,8 @@ func init() { "paths": { "/compliance/market/read/{name}/version/{version}": { "get": { - "summary": "Read a market profile", - "description": "Read the details of an un-installed profile given the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab. \nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:marketProfiles:get\n` + "`" + `` + "`" + `` + "`" + `", + "summary": "Show an available profile", + "description": "Show the details of an un-installed profile using the profile name and version.\nin the UI, these are the profiles under the \"Available\" tab.\nThese profiles are created and maintained by Chef, shipped with Chef Automate.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:marketProfiles:get\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "ReadFromMarket", "responses": { "200": { @@ -57,8 +57,8 @@ func init() { }, "/compliance/profiles/read/{owner}/{name}/version/{version}": { "get": { - "summary": "Read an installed profile", - "description": "Read the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:get\n` + "`" + `` + "`" + `` + "`" + `", + "summary": "Show an installed profile", + "description": "Show the details of an installed profile given the profile name, owner (Automate user associated with the profile), and version.\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:get\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "Read", "responses": { "200": { @@ -98,8 +98,8 @@ func init() { }, "/compliance/profiles/search": { "post": { - "summary": "List all profiles", - "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the ` + "`" + `owner` + "`" + ` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n` + "`" + `` + "`" + `` + "`" + `\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n], \n\"page\": 1, \n\"per_page\": 3, \n\"owner\": \"admin\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:list\n` + "`" + `` + "`" + `` + "`" + `", + "summary": "List all available profiles", + "description": "Lists all profiles available for the Automate instance.\nEmpty params return all \"market\" profiles.\nSpecifying the ` + "`" + `owner` + "`" + ` field returns all profiles installed for the specified user.\n\nSupports pagination, sorting, and filtering (wildcard supported).\n\nSupported sort fields: title, name (default: title)\nSupported filter fields: name, version, title\n\nExample:\n` + "`" + `` + "`" + `` + "`" + `\n{\n\"filters\":[\n{\"type\": \"title\", \"values\": [ \"Dev*\"]}\n],\n\"page\": 1,\n\"per_page\": 3,\n\"owner\": \"admin\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\n\nAuthorization Action:\n` + "`" + `` + "`" + `` + "`" + `\ncompliance:profiles:list\n` + "`" + `` + "`" + `` + "`" + `", "operationId": "List", "responses": { "200": { @@ -598,7 +598,7 @@ func init() { }, "code_desc": { "type": "string", - "description": "The code (test) that was executed." + "description": "The code (test) executed." }, "run_time": { "type": "number", @@ -615,7 +615,7 @@ func init() { }, "skip_message": { "type": "string", - "description": "Reason why the test was skipped." + "description": "Reason for skipping the test." } } }, @@ -633,7 +633,7 @@ func init() { }, "location": { "type": "string", - "description": "Path of the profile that was checked." + "description": "Path of the checked profile." }, "controls": { "type": "integer",