Documentation ¶
Index ¶
- func GetIndex() (*azidx.Index, error)
- func GetIndexFromLocalDir(swaggerRepo string) (*azidx.Index, error)
- func MockResourceIDFromType(azapiResourceType string) (string, string)
- func SchemaNamePathFromRef(swaggerPath string, ref openapiSpec.Ref) (schemaName string, schemaPath string)
- type ArmResource
- type CoverageReport
- type Model
- type SwaggerModel
- func GetModelInfoFromIndex(resourceId, apiVersion string) (*SwaggerModel, error)
- func GetModelInfoFromIndexRef(ref openapispec.Ref, swaggerRepo string) (*SwaggerModel, error)
- func GetModelInfoFromIndexWithType(azapiResourceType string) (*SwaggerModel, error)
- func GetModelInfoFromLocalDir(resourceId, apiVersion, swaggerPath string) (*SwaggerModel, error)
- func GetModelInfoFromLocalIndex(resourceId, apiVersion, swaggerRepo string) (*SwaggerModel, error)
- func GetModelInfoFromLocalSpecFile(resourceId, apiVersion, swaggerPath string) (*SwaggerModel, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockResourceIDFromType ¶
func SchemaNamePathFromRef ¶
func SchemaNamePathFromRef(swaggerPath string, ref openapiSpec.Ref) (schemaName string, schemaPath string)
Types ¶
type ArmResource ¶
type CoverageReport ¶
type CoverageReport struct {
Coverages map[ArmResource]*Model
}
func (*CoverageReport) AddCoverageFromState ¶
func (c *CoverageReport) AddCoverageFromState(resourceId, resourceType string, jsonBody map[string]interface{}, swaggerPath string) error
type Model ¶
type Model struct { Bool *map[string]bool `json:"Bool,omitempty"` // key is the Enum value, value is coverage status BoolCoveredCount int `json:"BoolCoveredCount,omitempty"` CoveredCount int `json:"CoveredCount,omitempty"` Discriminator *string `json:"Discriminator,omitempty"` Enum *map[string]bool `json:"Enum,omitempty"` // key is the Enum value, value is coverage status EnumCoveredCount int `json:"EnumCoveredCount,omitempty"` EnumTotalCount int `json:"EnumTotalCount,omitempty"` Format *string `json:"Format,omitempty"` HasAdditionalProperties bool `json:"HasAdditionalProperties,omitempty"` Identifier string `json:"Identifier,omitempty"` // e.g., #.properties.accessPolicies[].permissions.certificates IsAnyCovered bool `json:"IsAnyCovered"` IsFullyCovered bool `json:"IsFullyCovered,omitempty"` IsReadOnly bool `json:"IsReadOnly,omitempty"` IsRequired bool `json:"IsRequired,omitempty"` IsSecret bool `json:"IsSecret,omitempty"` // related to x-ms-secret Item *Model `json:"Item,omitempty"` ModelName string `json:"ModelName,omitempty"` Properties *map[string]*Model `json:"Properties,omitempty"` SourceFile string `json:"SourceFile,omitempty"` TotalCount int `json:"TotalCount,omitempty"` Type *string `json:"Type,omitempty"` Variants *map[string]*Model `json:"Variants,omitempty"` // variant model name is used as key, this may only contains VariantType *string `json:"VariantType,omitempty"` // the x-ms-discriminator-value of the variant model if exists, otherwise model name }
func (*Model) CountCoverage ¶
func (*Model) CredScan ¶
CredScan scans the input payload (root) and extract the secret field and value in the secrets map.
func (*Model) MarkCovered ¶
func (m *Model) MarkCovered(root interface{})
func (*Model) SplitCovered ¶
type SwaggerModel ¶
func GetModelInfoFromIndex ¶
func GetModelInfoFromIndex(resourceId, apiVersion string) (*SwaggerModel, error)
func GetModelInfoFromIndexRef ¶
func GetModelInfoFromIndexRef(ref openapispec.Ref, swaggerRepo string) (*SwaggerModel, error)
func GetModelInfoFromIndexWithType ¶
func GetModelInfoFromIndexWithType(azapiResourceType string) (*SwaggerModel, error)
func GetModelInfoFromLocalDir ¶
func GetModelInfoFromLocalDir(resourceId, apiVersion, swaggerPath string) (*SwaggerModel, error)
func GetModelInfoFromLocalIndex ¶
func GetModelInfoFromLocalIndex(resourceId, apiVersion, swaggerRepo string) (*SwaggerModel, error)
GetModelInfoFromLocalIndex tries to build index from local swagger repo and get model info from it
func GetModelInfoFromLocalSpecFile ¶
func GetModelInfoFromLocalSpecFile(resourceId, apiVersion, swaggerPath string) (*SwaggerModel, error)
Click to show internal directories.
Click to hide internal directories.