Commit Graph

42 Commits

Author SHA1 Message Date
Anthony Martin
0c789ba125 Add C# test examples 2025-04-16 18:28:25 +00:00
Anand Krishnamoorthi
757edcc8fb build: Python binding portability (#388)
- Specify compatibility = linux in pyproject.toml to ensure
  manylinux compatibility.
- Use abi-py310 pyo3 feature to ensure compatibility with python
  3.10 and later.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-04-07 13:18:01 -07:00
Anand Krishnamoorthi
c28bde3f56 build: Check-in Cargo.lock files and lockdown .net (#384)
Use frozen and locked builds

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-03-31 07:55:47 -07:00
Anand Krishnamoorthi
2858b63cd4 feat: Regorus nuget package (#383)
Organize C# binding example into separate Regorus nuget package and
a test app.

The nuget package targets netstandard 2.0 and 2.1.
The test app is tested for netframework 8.0.

Implement IDisposable for Engine cleanup.

Also remove net40 example. Can be added back later if needed.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-03-25 11:31:13 -07:00
Anand Krishnamoorthi
4a2df93ae2 fix!: Remove sha1 dependency (#379)
Removed cryptographically insecure sha1. This existed only for OPA
compatibility.

Also exclude bindings from main workspace

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-03-13 12:34:11 -07:00
thedavemarshall
a07beca983 Update ruby binding deps, ruby gem version 0.2.3 (#374)
* Update ruby binding deps, ruby gem version 0.2.3

* and gem version to 0.2.3

* specify bunlder and rubygems version for CI
2025-03-07 16:24:29 -08:00
Anand Krishnamoorthi
a1777fb7d3 build(deps): update rand requirement from 0.8.5 to 0.9.0 (#370)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-03-04 07:06:43 -08:00
Anand Krishnamoorthi
7565ec3ecf feat: or keyword (#315)
Add `or` operator to Rego languages. Available via `rego-extensions`
Cargo feature.

If the evaluated lhs value is not false, null or undefined it is returned.
Otherwise rhs is evaluated and returned.

or operator has least precedence, and is left-associative.

closes #314
2024-09-13 16:39:19 -07:00
Anand Krishnamoorthi
b6935d1add fix: Update readme with correct path to example policy (#312)
Also add test to lock down example policy path.
Also Fix clippy warning by using unwrap_or_default

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-09-10 11:47:46 -07:00
Anand Krishnamoorthi
20eece58ed Update binding versions (#287)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-07-28 12:32:39 +05:30
Jie Yang
fb5151e0e4 add extension_list example (#281)
- Created an example of extension policy
- Added C# binding support of .NET framework 4.0 and created a Nuget
  spec for it.
- Added a pytest in python bindings to test the extension policy and the
  python binding
- Restructured the example and Csharp binding directories due to above
  changes.
- Added copyrights.
- Added a Windows workflow for .NET 4.0 build and test.
2024-07-16 11:08:37 +05:30
Anand Krishnamoorthi
4a2a724a80 Fix c,cpp,no-std binding examples (#272)
- Use regorus_ffi in target_link_libraries instead of regorus-ffi.
  Something seems to have changed in corrosion-rs to need this.
- Workaround for cmake issue where FFI header may not be generated in time

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-06-19 16:01:29 -07:00
Anand Krishnamoorthi
536c6ede5c Fix release-plz hash (#256)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-05-30 05:12:24 -07:00
Anand Krishnamoorthi
d09c445add Update bindings to include newer APIs (#250)
- c, cpp
- csharp
- ffi
- go
- Java
- Python
- WASM

`arc` feature is turned on for all bindings
Use pretty string instead of colored string.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-05-25 10:24:06 -07:00
Anand Krishnamoorthi
9894f00829 Fix bindings and add CI tests (#247)
Also update version numbers of binding Rust projects to match Regorus

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-05-22 08:15:42 -07:00
thedavemarshall
495e91c75a Add test-ruby CI for github actions (#244)
https://github.com/oxidize-rb/actions/blob/main/setup-ruby-and-rust/readme.md
2024-05-20 15:53:36 -07:00
Anand Krishnamoorthi
e86b590f91 no_std support (#232)
- Disable default features in dependencies
- Use anyhow::Error::msg to map errors. Note: anyhow will itself be removed later.
- lazy_static/spin_no_std used in no_std environments
- ensure_no_std binary is built to target  thumbv7m-none-eabi to ensure that
  there are no std dependencies.  thumbv7m-none-eabi target has no std support.
- The opa-no-std feature enables only those Regorus features that work with no_std.
- Enable tests with no_std
- Update sizes of regorus binary in  README.md
- Ensure that regorus example can be built with only std
- Ensure that regorus example can be built with no_std

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-05-13 06:42:35 -07:00
Anand Krishnamoorthi
01fc234a33 add std feature (#231)
- `std` feature is enabled by default
- By default enable #![no_std] compilation
- Import std create if `std` feature is enabled or if testing
- Use core, alloc types
- Make it clear where std types are being used
- In no std, use BTreeMap in place of HashMap.
   HashMap is not available in no std due to lack of a
   secure random number generator

Note: The project does not yet compile without std feature being specified.
But it's really close to being able to do so.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-05-09 11:28:42 -07:00
Anand Krishnamoorthi
c6fb8cf044 Add tests for kata containers policies (#221)
closes #220

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-04-27 06:31:09 -07:00
Anand Krishnamoorthi
05e91da06e Do not enable serde_json/arbitrary_precision by default (#203)
The feature does not interoperate well with other serde_json features like untagged enums.

Fixes #199

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-04-11 06:23:14 -07:00
Burak
a8c0588426 bindings/java: Link Linux libraries against glibc 2.17 using cargo-zigbuild (#158) 2024-02-23 10:25:32 -08:00
Burak
22047287b4 Java publishing (#151)
* bindings/java: Add prefix to native methods

* bindings/java: Add javadocs and missing methods to Engine

* Setup publishing uber-JAR via GitHub workflow

* bindings/java: Update README

* bindings/java: Improve native library loading from JAR

* bindings/java: Fix usage of `working-directory`

* bindings/java: Pass required `distribution` parameter to `actions/setup-java@v4`

* bindings/java: Use Corretto distribution

This is because Microsoft doesn't provide JDK8,
see https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-8.

* bindings/java: Install GCC toolchain for `aarch64-unknown-linux-gnu`

* bindings/java: Upload artifacts with different names from each step

* bindings/java: Upload built JARs to GitHub
2024-02-22 15:00:07 -08:00
Anand Krishnamoorthi
d3d5367fd4 Policy Coverage (#149)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-02-19 19:10:13 -08:00
Anand Krishnamoorthi
f3d9652a73 Initial implementation of policy coverage (#146)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-02-18 22:16:53 -08:00
Anand Krishnamoorthi
7d32bd9377 Create rust-clippy.yml (#143) 2024-02-14 19:31:35 -08:00
Anand Krishnamoorthi
3b2e639918 io.jwt.decode (#140)
* io.jwt.decode

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

* Update README

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

* Install musl-tools to compile ring crate

ring crate is a dependency of jsonwebtoken

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

---------

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-02-09 23:36:16 -08:00
Anand Krishnamoorthi
5044d54d18 Scripting tweaks (#138)
- No need to build with coverage by default on linux platforms
- Will add coverage formally in CI later
- Rename rust.yml to pr.yml

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-02-08 16:24:40 -08:00
Anand Krishnamoorthi
5fd826d79a Update docs (#136)
* Add `time` to opa.passing. Disable WASM from rust.yml

Bindings will be tested using a separate workflow.
Also remove scripts that are no longer useful

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

* Remove alpha tag from version

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

---------

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-02-08 06:56:14 -08:00
Anand Krishnamoorthi
5799a3e6c4 Update publish-python.yml 2024-01-28 23:55:15 -08:00
Anand Krishnamoorthi
ca91c0ea20 Publish python packages (#117)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-01-28 23:12:06 -08:00
Anand Krishnamoorthi
bf75813c43 Publish wasm (#116)
* Create jekyll-gh-pages.yml

* Fix publish-wasm

- --release instead of -r
- set working directory
- use v4

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>

---------

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-01-28 16:45:52 -08:00
Anand Krishnamoorthi
35ec9c03ad Set working-directory for wasm-pack 2024-01-28 15:30:41 -08:00
Anand Krishnamoorthi
8ca863c661 Python bindings (#115)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-01-28 14:39:59 -08:00
Anand Krishnamoorthi
055bdd295f WASM binding (#114)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-01-27 22:14:29 -08:00
Anand Krishnamoorthi
6eca85b497 Improve crate documentation (#111)
- Document QueryResults
- Delete snippets folder
- Document Value

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-01-19 14:51:14 -08:00
Anand Krishnamoorthi
f3884e87e5 Try out manual trigger for release-plz (#110) 2024-01-16 10:49:39 -08:00
Burak
c3b1e27536 Release preparation (#105)
* Update `Cargo.toml`

* Add Release-plz GitHub workflow file

* Run `release-plz update --repo-url=https://github.com/microsoft/regorus`
2024-01-13 10:28:37 -08:00
Anand Krishnamoorthi
4db2270dcf More library functions (#51)
- units.parse, units.parse_bytes
- json.is_valid, json.marshal, json.unmarshal
- yaml.is_valid, yaml.marshal, yaml.unmarshal
- object.subset
- set_diff

* Also print number of errors due to each missing function
* Also lock down fully passing OPA suites

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-11-22 14:19:23 -08:00
Anand Krishnamoorthi
e93b33ea05 Support build on non Linux platforms
cargo config
1. MUSL is no longer the default target. This allows building on Mac and Windows.
2. On Linux, code coverage compiler options are supplied by default.

pre-commit, pre-push
- Coverage is turned on only on Linux
- clippy is run on all platforms

github
- MUSL build is tested to ensure that stand alone executables can be created

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-03-01 15:45:44 +05:30
Anand Krishnamoorthi
c92707433e Improvements to github workflow (#4)
- format check
- clippy checks
- build tests separately before running

Also fix clippy warnings

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-02-10 11:16:09 +05:30
Ming-Wei Shih
4c3df24a09 Update rust.yml 2023-02-09 14:41:00 -08:00
Ming-Wei Shih
db0a4607a9 Add simple git action 2023-02-09 14:37:22 -08:00