1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
Commit graph

68 commits

Author SHA1 Message Date
dreamjz
08d098d262
feat(jmespath):time_parse() support epoch time (#9173)
Signed-off-by: dreamjz <25699818+dreamjz@users.noreply.github.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-30 07:47:02 +00:00
kanha gupta
f7a962fd11
support for SHA256 jmespath function (#9144)
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-01-05 10:44:26 +00:00
Jim Bugwadia
296578a456
create interpreter once and reuse across searches (#8299)
* create interpreter once and reuse across searches

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix excessive logs

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* refactor(jmespath): reuse fCall instead of intr

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* refactor(jmespath): use new api

Use the new JMESPath API to decouple Interpreter from FunctionCaller

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore: bump go-jmespath

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(jmespath): test case using older API

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: Khaled Emara <KhaledEmaraDev@gmail.com>
2023-11-30 16:59:11 +01:00
UgOrange
0079ca1e39
feat: Add external_url_check custom JMESPath function (#8614)
Signed-off-by: lichanghao.orange <lichanghao.orange@bytedance.com>
Signed-off-by: UgOrange <lichanghao.orange@bytedance.com>
2023-11-21 04:17:26 +00:00
Charles-Edouard Brétéché
c96199dee1
chore: move utils/wildcard in ext (#8772)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-10-29 23:59:53 +00:00
Mariam Fahmy
c5dbb572c2
remove duplicated log messages (#8673)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-10-17 16:08:44 +00:00
Charles-Edouard Brétéché
6d9d3b7f4c
fix: remove jmespath replace directive (#7726)
* fix: remove jmespath replace directive

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* master

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-07-07 10:22:26 +00:00
SukhveerS
998a14c660
[Feature] round() JMESPath function (#7489)
* adding roundoff

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* removing unnecessary

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* adding test

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* adding edge case

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* fixing error

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* updating function call

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* updating function jpRound

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* error handling negative

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* fix

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>

* fix linter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* parsing

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Rexbeast2 <ssukhveer514@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-07-03 19:31:54 +00:00
Andreas Brehmer
a1ae86cdbe
Add JMESPath function for dynamic object/array lookup (#7136)
* Fix JMESPath functions error message

JMESPath functions `parse_yaml`, `items` and `object_from_lists` use
wrong format string arguments for an error message and count the
argument from 0 instead of 1.

Fix the format string args and add 1 to the argument index.

Also improve the error message itself.

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>

* Add JMESPath function `lookup`

`lookup` allows for dynamic lookups of objects and arrays, i.e. where
the key/index to look up is determined during the JMESPath query and
thus cannot be injected upfront.

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>

---------

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-06-19 13:45:13 +00:00
Vishal Choudhary
77bb5aca12
Added Support for CSR in x509_decode() (#6744)
* fixes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* err fix

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added kuttl tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated files for test

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* NIT

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* Update test/conformance/kuttl/validate/clusterpolicy/standard/enforce/csr/01-policy.yaml

Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* updated kuttl tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated readme

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added requested changes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* refactor

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* refactor

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* changes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* refactor

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-14 09:36:38 +00:00
Charles-Edouard Brétéché
dbbdc1b96c
feat: add image_normalize filter (#6911)
* feat: add image_normalize filter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-13 16:13:40 +00:00
Charles-Edouard Brétéché
544fe04508
refactor: introduce jmespath interface (#6882)
* refactor: introduce jmespath interface

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-13 11:29:40 +00:00
Ved Ratan
367156f60b
[Chore] Bump to Go 1.20 (#6683)
* changed go version 1.19->1.20

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* updated go version in actions

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* bumped golangci-lint

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix conflicts

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* possible fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* small fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Signed-off-by: Ved Ratan <82467006+VedRatan@users.noreply.github.com>
2023-04-03 11:40:47 +00:00
Charles-Edouard Brétéché
6f65b4416e
fix: filter name in add/sum error (#6657)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-23 08:11:56 -04:00
Ved Ratan
893c22b96b
[Feature] The ability to sum quantities (#6552)
* implemented array sum functionality

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* provided tests and fixed some bugs

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added sum functionality

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed sonatype liftbot issue

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* restructured the code implementation

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added helper errors

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* removed commented codes

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* modified error message

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* applied requested changes

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* removed some more comments

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added more tests

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-23 08:59:05 +00:00
Abhishek Sawan
8be4460668
Added JMESPath filter to_boolean() (#6292)
* added to_boolean in JMESPath Filter

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* updated to_boolean JMESPath filter

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* updated to_boolean JMESPath filter with function registration

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* fixed to_boolean JMESPath filter with function registration

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* Update pkg/engine/jmespath/functions.go

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-16 12:52:26 +00:00
Brian Dunnigan
d33e616d69
#6055 Add JMESPath support to imageExtractors (#6183)
Signed-off-by: Brian Dunnigan <bdunnigan@clarityinnovates.com>
Co-authored-by: bdunnigan <bdunnigan@clarityinnovates.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2023-02-08 11:54:59 +00:00
Charles-Edouard Brétéché
00387f1015
fix: add tests for jp arithmetic funcs (#6240)
* fix: error management in jp functions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: add tests for jp arithmetic funcs

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-06 15:01:39 +00:00
Charles-Edouard Brétéché
dd35ae201b
fix: error management in jp functions (#6239)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-06 14:13:44 +00:00
Charles-Edouard Brétéché
d79d4a514f
fix: add more jp unit tests and check for out of bounds argument (#6230)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-06 11:39:53 +00:00
Charles-Edouard Brétéché
83c188dd5e
fix: jp divide quantities (#6229)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-06 10:21:30 +00:00
Charles-Edouard Brétéché
417b2a9eba
chore: add a few unit tests for jp functions (#6219)
* chore: add a few unit tests for jp functions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-02-06 06:27:27 +00:00
Charles-Edouard Brétéché
376378fd09
test: add a couple unit tests (#6202)
* test: add a couple unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-03 05:37:31 +00:00
Charles-Edouard Brétéché
8f2f263694
fix: jp items function (#6196)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-02-02 13:19:35 +00:00
Charles-Edouard Brétéché
7540daa906
feat: support arrays in jp items() function (#6180) 2023-02-01 05:43:58 +00:00
Charles-Edouard Brétéché
91f2622384
feat: add more time jmespath filters (#5950)
* feat: add more time jmespath filters

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* add time_utc and time_now_utc

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* add time_diff

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more time filters

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* Update pkg/engine/jmespath/functions.go

Signed-off-by: shuting <shutting06@gmail.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: shuting <shutting06@gmail.com>
Co-authored-by: shuting <shutting06@gmail.com>
2023-01-10 04:40:46 +00:00
Vishal Choudhary
837f474969
Fixes time_now failing (#5928)
* fixes time_now

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* testing

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* simplified

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
2023-01-09 15:16:43 +01:00
Vishal Choudhary
bb6005a7a3
Added a time_add() filter to add duration and absolute time (#5817)
* time_add

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* output is RFC3339 only now

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* added note to timeadd

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* added time_convert

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* removed blank string timezone

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* renamed to time_parse

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2023-01-06 16:48:13 +00:00
Vishal Choudhary
e9d2c00c16
Adds JMESPath filter for returning cron expression for absolute time (#5814)
* time_to_cron

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* tests

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* Update pkg/engine/jmespath/functions.go

Signed-off-by: shuting <shutting06@gmail.com>

* fix linter

Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
Signed-off-by: shuting <shutting06@gmail.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: shuting <shutting06@gmail.com>
2023-01-06 07:27:57 +00:00
Vishal Choudhary
8572d53cc9
Adds JMESPath filter for returning current time (#5813)
* time_current

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* name change

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* added note

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2023-01-02 15:35:01 +01:00
Vishal Choudhary
6516e921fc
Adds notes to functions (#5824)
* added notes

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* changes stated in chart.yaml

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

* undo

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
2023-01-02 09:00:25 +01:00
Jim Bugwadia
9d3b176def
Nested foreach (#5589)
* updated foreach logic and added tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* uncomment tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix vars and unit tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix vars and unit tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix some tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix more tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* format

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* make codegen

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* linter

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* cleanup

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix linter issue

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* revert local launch

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* propagate context

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* uncomment tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix propagation of registry client

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-12-12 15:20:20 +00:00
Charles-Edouard Brétéché
d9272d9b93
refactor: jmespath arithmetic operations (#5544)
* refactor: add and subtract jmespath operations

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix multiply

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* divide

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* modulo

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-12-05 11:15:32 +00:00
Vishal Choudhary
44763cf61b
Fix: Typo in x509_decode JMESPath function's note (#4773)
* changed 'json' to 'an object'

* changed 'json' to 'an object'

sign: Vishal Choudhary <contactvishaltech@gmail.com>

* changed 'json' to 'an object'

* changed 'json' to 'an object'

sign: Vishal Choudhary <contactvishaltech@gmail.com>

Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-10-03 08:26:19 +00:00
Abhinav Sinha
a1182859ad
Added x509_decode JMESPath function (#4664)
* Added `x509_decode` JMESPath function

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Use `crypto/x509` stdlib

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Return result as `map[string]interface{}`

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Made minor fixes

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Fixed error with unmarshalling decoded certificate

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Added e2e test for decoding X.509 certs

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Reverted to using `smallstep/zcrypto` for X.509

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Minor fix

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Addressed reviews

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

* Removed redundant dependency on `pkg/errors`

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-09-28 18:15:39 +00:00
Charles-Edouard Brétéché
6a8085522a
fix: jmespath random error handling (#4697)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-09-26 13:33:52 +00:00
Anurag
cadf577e4b
enhance jmespath random-filter (#4591)
Signed-off-by: Anurag <contact.anurag7@gmail.com>

Signed-off-by: Anurag <contact.anurag7@gmail.com>
2022-09-14 06:27:32 +00:00
Anurag
560cec329e
add random filter (#4527)
* add random filter

Signed-off-by: Anurag <contact.anurag7@gmail.com>

* update go.mod file

Signed-off-by: Anurag <contact.anurag7@gmail.com>

* update go.sum

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* linter fix

Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: Anurag <contact.anurag7@gmail.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2022-09-07 16:22:30 +00:00
Charles-Edouard Brétéché
fc1a4601a7
refactor: introduce wildcard utils package (#4406)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-08-25 05:23:01 +00:00
Charles-Edouard Brétéché
0099ef54ad
chore: enable gofmt and gofumpt linters (#3931)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 06:19:03 +00:00
Anurag
e8b1e1275a
fix: return type changed to bool in jpfCompare fn (#3924)
* return type changed to bool in jpfCompare fn

Signed-off-by: Anurag <contact.anurag7@gmail.com>

* update functions.go

Signed-off-by: Anurag <contact.anurag7@gmail.com>

* updated the commit

Signed-off-by: Anurag <contact.anurag7@gmail.com>

Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-05-16 21:11:43 +00:00
Charles-Edouard Brétéché
97e5e64fd4
chore: enable whitespace linter (#3864)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-05-10 17:01:29 +00:00
Sambhav Kothari
c3604c1170
Add an object_from_lists function (#3824) 2022-05-07 12:05:04 +00:00
gsweene2
af51ceb4ff
Add JMESPath Function items (#3777)
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
Co-authored-by: Sambhav Kothari <skothari44@bloomberg.net>
2022-05-04 10:33:24 +00:00
Soumya Singh
84aa2e3fbb
Add returnType for regexMatch in kyverno jp output (#3575)
Signed-off-by: tend2infinity <somu12.ss@gmail.coom>

Co-authored-by: tend2infinity <somu12.ss@gmail.coom>
2022-04-11 08:34:14 +01:00
shuting
d1bf3d4742
clean up dependencies (#3469)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-03-25 08:40:25 +00:00
Sambhav Kothari
4445780c7c
Add a kyverno jp command to test jmespath expressions (#3169)
* Add a kyverno jp command to test jmespath expressions

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

* Auto-generate custom function docs

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-02-04 05:23:12 +00:00
Abhinav Sinha
7a55d26d89
Fixed kyverno panic at JMESPath zero division (#3137)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-31 17:45:20 +00:00
Kumar Mallikarjuna
4124e0f682
Update division for same units (#3038)
Signed-off-by: Kumar Mallikarjuna <kumar@nirmata.com>

Co-authored-by: shuting <shutting06@gmail.com>
2022-01-21 11:06:08 +00:00
Sambhav Kothari
f5e00ee034
Add a parse_yaml function (#2999)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

Co-authored-by: shuting <shutting06@gmail.com>
2022-01-17 13:41:08 +00:00