From 4e1ccd2bcfb279b1a3833528577b9fafbfb3e36f Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Tue, 8 Aug 2023 14:12:53 -0400 Subject: [PATCH 1/2] use `path-formats` for JSON Expect Aligns with the `snake-case` YAML field names for `path-formats` instead of `path_formats` but keeps the ability to use `path_formats` for backwards-compat. Signed-off-by: Jay Pipes --- README.md | 2 +- assertion/json/json.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c03ed75..b03247f 100644 --- a/README.md +++ b/README.md @@ -409,7 +409,7 @@ tests: paths: $.author.name: Ernest Hemingway $.publisher.address.state: New York - path_formats: + path-formats: $.id: uuid4 ``` diff --git a/assertion/json/json.go b/assertion/json/json.go index b6109b7..14d4d6f 100644 --- a/assertion/json/json.go +++ b/assertion/json/json.go @@ -36,7 +36,7 @@ type Expect struct { Paths map[string]string `yaml:"paths,omitempty"` // PathFormats is a map, keyed by JSONPath expression, of expected formats // that values found at the expression should have. - PathFormats map[string]string `yaml:"path_formats,omitempty"` + PathFormats map[string]string `yaml:"path-formats,omitempty"` // Schema is a file path to the JSONSchema that the JSON should validate // against. Schema string `yaml:"schema,omitempty"` @@ -112,7 +112,7 @@ func (e *Expect) UnmarshalYAML(node *yaml.Node) error { } } e.Paths = paths - case "path_formats": + case "path_formats", "path-formats": if valNode.Kind != yaml.MappingNode { return gdterrors.ExpectedMapAt(valNode) } From b0f1c1d4567dc322ebf683b928204755365bf494 Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Tue, 8 Aug 2023 14:16:14 -0400 Subject: [PATCH 2/2] add proxy.golang.org to egress allowlist --- .github/workflows/gate-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gate-tests.yml b/.github/workflows/gate-tests.yml index 5f598a3..6553a6c 100644 --- a/.github/workflows/gate-tests.yml +++ b/.github/workflows/gate-tests.yml @@ -24,6 +24,7 @@ jobs: disable-sudo: true allowed-endpoints: > github.com:443 + proxy.golang.org:443 - name: checkout code uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: setup go