From cacba3ee393412b3f03535539ac650a061ceab85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 08:21:17 +0000 Subject: [PATCH] build(deps): bump github.com/CiscoM31/godata from 1.0.10 to 1.0.11 Bumps [github.com/CiscoM31/godata](https://github.com/CiscoM31/godata) from 1.0.10 to 1.0.11. - [Release notes](https://github.com/CiscoM31/godata/releases) - [Commits](https://github.com/CiscoM31/godata/compare/v1.0.10...v1.0.11) --- updated-dependencies: - dependency-name: github.com/CiscoM31/godata dependency-version: 1.0.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../CiscoM31/godata/expression_parser.go | 24 +++++++++---------- .../CiscoM31/godata/filter_parser.go | 3 +-- vendor/modules.txt | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index b4b515f7f..2fa18a142 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.24.1 require ( dario.cat/mergo v1.0.1 - github.com/CiscoM31/godata v1.0.10 + github.com/CiscoM31/godata v1.0.11 github.com/KimMachineGun/automemlimit v0.7.2 github.com/Masterminds/semver v1.5.0 github.com/MicahParks/keyfunc/v2 v2.1.0 diff --git a/go.sum b/go.sum index 92dc9dfa1..0c5b71303 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CiscoM31/godata v1.0.10 h1:DZdJ6M8QNh4HquvDDOqNLu6h77Wl86KGK7Qlbmb90sk= -github.com/CiscoM31/godata v1.0.10/go.mod h1:ZMiT6JuD3Rm83HEtiTx4JEChsd25YCrxchKGag/sdTc= +github.com/CiscoM31/godata v1.0.11 h1:w7y8twuW02LdH6mak3/GJ5i0GrCv2IoZUJVqa/g5Yeo= +github.com/CiscoM31/godata v1.0.11/go.mod h1:ZMiT6JuD3Rm83HEtiTx4JEChsd25YCrxchKGag/sdTc= github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c h1:ocsNvQ2tNHme4v/lTs17HROamc7mFzZfzWcg4m+UXN0= github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40= github.com/KimMachineGun/automemlimit v0.7.2 h1:DyfHI7zLWmZPn2Wqdy2AgTiUvrGPmnYWgwhHXtAegX4= diff --git a/vendor/github.com/CiscoM31/godata/expression_parser.go b/vendor/github.com/CiscoM31/godata/expression_parser.go index c634e1451..9d74a77a0 100644 --- a/vendor/github.com/CiscoM31/godata/expression_parser.go +++ b/vendor/github.com/CiscoM31/godata/expression_parser.go @@ -58,8 +58,9 @@ const ( ExpressionTokenDuration // duration = [ "duration" ] SQUOTE durationValue SQUOTE ExpressionTokenGuid // [25] A 128-bit GUID ExpressionTokenAssignement // The '=' assignement for function arguments. - ExpressionTokenGeographyPolygon // - ExpressionTokenGeometryPolygon // + ExpressionTokenGeographyPolygon // A polygon with geodetic (ie spherical) coordinates. Parsed Token.Value is ' , ...' + ExpressionTokenGeometryPolygon // A polygon with planar (ie cartesian) coordinates. Parsed Token.Value is ' , ...' + ExpressionTokenGeographyPoint // A geodetic coordinate point. Parsed Token.Value is ' ' expressionTokenLast ) @@ -94,6 +95,7 @@ func (e ExpressionTokenType) String() string { "ExpressionTokenAssignement", "ExpressionTokenGeographyPolygon", "ExpressionTokenGeometryPolygon", + "ExpressionTokenGeographyPoint", "expressionTokenLast", }[e] } @@ -178,15 +180,11 @@ func NewExpressionTokenizer() *Tokenizer { // E.g. ABNF for 'geo.distance': // distanceMethodCallExpr = "geo.distance" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS CLOSE t.Add("(?i)^(?P(geo.distance|geo.intersects|geo.length))[\\s(]", ExpressionTokenFunc) - // geographyPolygon = geographyPrefix SQUOTE fullPolygonLiteral SQUOTE - // fullPolygonLiteral = sridLiteral polygonLiteral - // sridLiteral = "SRID" EQ 1*5DIGIT SEMI - // polygonLiteral = "Polygon" polygonData - // polygonData = OPEN ringLiteral *( COMMA ringLiteral ) CLOSE - // Example: geography'SRID=0;Polygon((-122.031577 47.578581, -122.031577 47.678581, -122.131577 47.678581))' - t.Add(`^geography'SRID=[0-9]{1,5};Polygon\(\((-?[0-9]+\.[0-9]+\s+-?[0-9]+\.[0-9]+)(,\s-?[0-9]+\.[0-9]+\s+-?[0-9]+\.[0-9]+)*\)\)'`, ExpressionTokenGeographyPolygon) - // geometryPolygon = geometryPrefix SQUOTE fullPolygonLiteral SQUOTE - t.Add(`^geometry'SRID=[0-9]{1,5};Polygon\(\((-?[0-9]+\.[0-9]+\s+-?[0-9]+\.[0-9]+)(,\s-?[0-9]+\.[0-9]+\s+-?[0-9]+\.[0-9]+)*\)\)'`, ExpressionTokenGeometryPolygon) + // Example: geography'POLYGON((-122.031577 47.578581, -122.031577 47.678581, -122.131577 47.678581))' + t.Add(`(?i)^geography'(?:SRID=(\d{1,5});)?POLYGON\s*\(\(\s*(?P-?\d+(\.\d+)?\s+-?\d+(\.\d+)?(?:\s*,\s*-?\d+(\.\d+)?\s+-?\d+(\.\d+)?)*?)\s*\)\)'`, ExpressionTokenGeographyPolygon) + t.Add(`(?i)^geometry'(?:SRID=(\d{1,5});)?POLYGON\s*\(\(\s*(?P-?\d+(\.\d+)?\s+-?\d+(\.\d+)?(?:\s*,\s*-?\d+(\.\d+)?\s+-?\d+(\.\d+)?)*?)\s*\)\)'`, ExpressionTokenGeometryPolygon) + // Example: geography'POINT(-122.131577 47.678581)' + t.Add(`(?i)^geography'POINT\s*\(\s*(?P-?\d+(\.\d+)?\s+-?\d+(\.\d+)?)\s*\)'`, ExpressionTokenGeographyPoint) // According to ODATA ABNF notation, functions must be followed by a open parenthesis with no space // between the function name and the open parenthesis. // However, we are leniently allowing space characters between the function and the open parenthesis. @@ -315,7 +313,7 @@ func NewExpressionParser() *ExpressionParser { // Edm.Boolean geo.intersects(Edm.GeometryPoint,Edm.GeometryPolygon) // The geo.intersects function returns true if the specified point lies within the interior // or on the boundary of the specified polygon, otherwise it returns false. - parser.DefineFunction("geo.intersects", []int{2}, false) + parser.DefineFunction("geo.intersects", []int{2}, true) // The geo.length function has the following signatures: // Edm.Double geo.length(Edm.GeographyLineString) // Edm.Double geo.length(Edm.GeometryLineString) @@ -329,7 +327,7 @@ func NewExpressionParser() *ExpressionParser { parser.DefineFunction("all", []int{2}, true) // Define 'case' as a function accepting 1-10 arguments. Each argument is a pair of expressions separated by a colon. // See https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_case - parser.DefineFunction("case", []int{1,2,3,4,5,6,7,8,9,10}, true) + parser.DefineFunction("case", []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, true) return parser } diff --git a/vendor/github.com/CiscoM31/godata/filter_parser.go b/vendor/github.com/CiscoM31/godata/filter_parser.go index 40ea099fe..4d087e488 100644 --- a/vendor/github.com/CiscoM31/godata/filter_parser.go +++ b/vendor/github.com/CiscoM31/godata/filter_parser.go @@ -21,8 +21,7 @@ func ParseFilterString(ctx context.Context, filter string) (*GoDataFilterQuery, if err != nil { return nil, err } - if tree == nil || tree.Token == nil || - (len(tree.Children) == 0 && tree.Token.Type != ExpressionTokenBoolean) { + if tree == nil || tree.Token == nil || !GlobalFilterParser.isBooleanExpression(tree.Token) { return nil, BadRequestError("Value must be a boolean expression") } return &GoDataFilterQuery{tree, filter}, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 7a19809ca..6686df228 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -15,7 +15,7 @@ github.com/Azure/go-ntlmssp ## explicit; go 1.18 github.com/BurntSushi/toml github.com/BurntSushi/toml/internal -# github.com/CiscoM31/godata v1.0.10 +# github.com/CiscoM31/godata v1.0.11 ## explicit; go 1.19 github.com/CiscoM31/godata # github.com/KimMachineGun/automemlimit v0.7.2