Commit Graph

128 Commits

Author SHA1 Message Date
Johan Fylling 64a3625d33 Release v1.17.0 (#8710)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-05-28 16:48:35 +02:00
Sebastian Spaink 5e04b0f93b Enable pattern validation in json.verify_schema and json.match_schema (#8686)
resolve: https://github.com/open-policy-agent/opa/issues/6089

As a side effect of #4429 `json.match_schema` and `json.verify_schema`
have been silently ignoring the "pattern" keyword.

Updated the internal/gojsonschema project to have pattern validation be
optional to keep it disabled for type checking but enabled for the
builtins. Patterns that RE2 can't compile will fail.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-05-21 18:36:14 +02:00
Johan Fylling e80a469ecd Integrate 1.16.2 patch release
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-05-13 10:46:11 +02:00
Johan Fylling 9bfc806ec2 Integrate 1.16.1 patch release
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-05-04 11:23:20 +02:00
Johan Fylling f3adf61f72 Release v1.16.0 (#8581)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-04-30 16:29:23 +02:00
Charlie Egan 343ddf583f builtins: Add uri.parse and uri.is_valid built in functions (#8578)
Examples of things this is useful for:
- Implementing policy around AI coding tool calls (permitted domains
etc)
- Validating SPIFFE IDs

Fixes https://github.com/open-policy-agent/opa/issues/8263

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-04-29 13:08:15 +00:00
Sebastian Spaink 1de861f2d6 Add support for days, weeks and years in parse_duration_ns (#8463)
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-04-13 20:20:51 +00:00
Sebastian Spaink fa913dd5d3 Integrate 1.15.1 patch release (#8462)
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-03-31 10:05:45 -05:00
Sebastian Spaink f9e7302d69 Prepare v1.15.0 release (#8446)
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-03-26 16:11:06 -05:00
Stephan Renatus 777af8b069 Integrate patch release 1.14.1
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2026-03-09 10:40:10 +01:00
Johan Fylling acf81e85d6 Release v1.14.0 (#8379) 2026-02-26 16:21:02 +01:00
Stephan Renatus 5e989f85aa Integrate release 1.13.2
For GO-2026-4337, see https://github.com/open-policy-agent/opa/releases/tag/v1.13.2

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2026-02-18 10:36:30 +01:00
Sebastian Spaink 1c78f93507 Integrate patch and notes for v1.13.1 (#8275)
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-01-30 09:14:54 -06:00
Anders Eknert 881d1f279a docs: fix json.patch target description (#8271)
This built-in can patch any composite type, which the documentation
for the first argument didn't mention.

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
2026-01-29 21:18:58 +01:00
Johan Fylling a232916c93 Prepare v1.13.0 release (#8268)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-01-29 18:00:38 +01:00
Anders Eknert d0350b326e Add array.flatten built-in function (#8232)
Originally meant to be `array.concat_n`, but this name is better
as the behavior of this function differs from `array.concat` —
namely that `array.flatten` accepts any type of valued in the
input array. Only arrays are however flattened, and the rest
are appended directly to the flattened output.

Note that this function only flattens at the topmost level of
the input array — not recursively! A cursory look
at a few other languages suggest a single level is the common case.
But if others feel we should flstten more, I'm happy to make an update.

The C code for a Wasm implementstion here is cowboy coded, and
I did not manage to run the tests on my machine due to some
`docker` <-> `container` differences. I mostly just imitated
the existing code in the array category. I doubt it'll work
on the first try, but only CI can judge me.

Also:
- Remove `opa fmt` step from the Rego CI step, as this is done by
  Regal anyway a little later in the list of tasks.
- Replace some hard-coded `docker` names in the `Makefile` with `$(DOCKER)`
- Added name of built-in function missing to the unsupportedBuiltinErr
  error, as it has happened a few times now that I've used `:=` in a
  query, and had no clue what built-in it referred to.

Fixes #8226

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
2026-01-27 21:46:11 +00:00
Sebastian Spaink 4afcfb992b Integrate patch and notes v1.12.3 (#8218)
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
Co-authored-by: Johan Fylling <johan.dev@fylling.se>
2026-01-15 11:33:47 +01:00
Stephan Renatus b6af19fcf1 Integrate patch and notes v1.12.1
Extra integration tests will follow.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2025-12-19 08:21:37 +01:00
Johan Fylling d61ac383f8 Prepare v1.12.0 release (#8144)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-12-18 13:44:46 +01:00
Stephan Renatus c9656457b3 CHANGELOG+metadata: Integrate v1.11.1
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2025-12-16 22:24:53 +01:00
Johan Fylling 8e410b830a String interpolation (#8109)
Adding string interpolation support to the Rego language.

An interpolated string is composed of a template-string that can contain zero or more template-expressions that interpolates values into the string generated at eval-time.

Requires the `template_strings` capability feature and `internal.template_string` built-in function.

Implements: #4733
2025-12-16 11:47:04 +01:00
Johan Fylling 45cbfa1d83 Prepare v1.11.0 release (#8076)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-11-26 14:01:54 +01:00
Johan Fylling e6865c4c9f Prepare v1.10.0 release (#8002)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-10-31 14:15:30 +01:00
Johan Fylling c49e670294 Prepare v1.9.0 release (#7940)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-09-26 10:53:51 +02:00
Johan Fylling 78328267fb Prepare v1.8.0 release (#7866)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-08-28 16:49:47 +02:00
Charlie Egan 636b83a3d3 ast/builtins: Remove space from count desc (#7836)
https://github.com/StyraInc/regal/pull/1654#discussion_r2272530343

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-08-13 15:53:26 +00:00
Johan Fylling 5faa4e2e67 Adding EdDSA support for io.jwt built-ins (#7824)
Introducing the `io.jwt.verify_eddsa` built-in, and adding support to the following built-ins:

* `io.jwt.decode_verify`
* `io.jwt.encode_sign`
* `io.jwt.encode_sign_raw`

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-08-12 18:52:47 +02:00
Johan Fylling 45b6eb6639 Prepare v1.7.0 release (#7809)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-07-31 15:09:28 +02:00
Johan Fylling 710b5a6278 Prepare v1.6.0 release (#7732)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-06-30 10:57:36 +02:00
Johan Fylling 046dca2f6e Integrating patch release v1.5.1 (#7659)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-06-04 12:05:50 +02:00
Johan Fylling b7d0a13145 Prepare v1.5.0 release (#7642)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-05-29 16:21:03 +02:00
Sebastian Spaink 03da822be9 Patch release v1.4.2 (#7546)
Signed-off-by: sspaink <sspaink@styra.com>
2025-05-02 13:30:51 -05:00
Johan Fylling 8b0720247e Prepare v1.4.0 release (#7541)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-05-01 17:01:50 +02:00
Johan Fylling 89f4835395 Prepare v1.3.0 release (#7467)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-03-27 15:19:05 +01:00
Johan Fylling d537788722 Release v1.2.0 (#7403)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-02-28 15:17:35 +01:00
Johan Fylling a6fcabbba6 cmd+tester: Parameterized tests (#7366)
Adding the ability to parameterize Rego `test_*` rules, effectively declaring multiple "test cases" within the rule, which is then individually reported (grouped under their parent rule) when running `opa test`.

Fixes: #2176

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-02-17 22:08:27 +01:00
Johan Fylling de28510b97 Prepare v1.1.0 release
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-01-27 16:44:49 +01:00
Ashutosh Narkar d5cbd16545 Integrate patch release v1.0.1
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2025-01-22 10:06:15 +01:00
Johan Fylling 563321d26b Rego v1 capabilities and keywords update (#7216)
* Separating v0- and v1 keywords
* Adding `rego_v1` capability feature

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-12-17 11:50:11 +01:00
Anders Eknert a60ef72799 Even less allocs (#7190)
**main**
```
BenchmarkLintAllEnabled-10    1	2640715625 ns/op	6385110200 B/op	116296633 allocs/op
```

**pr**
```
BenchmarkLintAllEnabled-10    1	2597179708 ns/op	6183614112 B/op	108421141 allocs/op
```

(I renamed the benchmark, but this is the same as "regal linting itself"
used in the past)

Another 8 million allocations cut off from `regal lint bundle`,
and a whopping 10% improvements to wall clock time!

The most significant improvement is the Equal implementation for
refs, since that is called all over the place. But there are many
other fixes here, and they all contribute something substantial
(and fixes that only have had marginal impact have been left out).

Signed-off-by: Anders Eknert <anders@styra.com>
2024-11-24 11:24:29 +01:00
berdanA 26e2db328d topdown: improve scientific notation parsing in extractNumAndUnit
- Updated extractNumAndUnit to recognize and correctly parse scientific notation, including cases with 'e' or 'E' followed by an exponent (e.g., "1e10", "3.2E4").
- Ensures that 'e' or 'E' is treated as part of the number if followed by digits, enhancing compatibility with scientific notation inputs.
- Scientific notation with units now also parses correctly (e.g., "1e10GB" extracts "1e10" as the number and "GB" as the unit).
- Maintains behavior for cases without units, allowing either the number or unit portion to be empty, while improving overall string parsing logic.
- Added tests for scientific notation parsing in `units.parse_bytes`, including both SI and binary units (e.g., KB, MiB, GiB, KiB).
- Included cases for uppercase, lowercase, and mixed case formats with scientific notation.
- Added validation for numbers without units defaulting to bytes.

Fixes #7142

Signed-off-by: bakar <berdan.akar@rise-world.com>
2024-11-08 12:48:02 -08:00
Anders Eknert 60ea2e7429 Add description to all built-in function args and return values (#7153)
Fixes #7151

Signed-off-by: Anders Eknert <anders@styra.com>
2024-11-04 14:00:23 +01:00
Ashutosh Narkar 2ea031ea04 Prepare v0.70.0 release
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-10-31 12:39:52 -07:00
Ashutosh Narkar 4a3fd1a715 Prepare v0.69.0 release (#7076)
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-09-30 15:09:00 +02:00
Johan Fylling db53d77c48 Prepare v0.68.0 release (#6976)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-08-29 17:23:19 +02:00
Michael Sorens 07c7bb8e16 typos and clarification on signing commits (#6940)
* cosmetic: fix typos
* Add missing piece to the PR template

Signed-off-by: Michael Sorens <msorens@styra.com>
2024-08-19 13:47:31 +02:00
Ashutosh Narkar 0f12a96d65 Integrate patch release v0.67.1 (#6914)
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-08-05 13:17:06 -04:00
Ashutosh Narkar b62ae6bfed Prepare v0.67.0 release
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-07-25 14:34:02 -07:00
Manish Giri c70544045b Implement a built-in function for String count
Fixes #6827

Signed-off-by: Manish Giri <manish.giri.me@gmail.com>
2024-07-03 15:50:34 -07:00
Johan Fylling 91348a8ccc Prepare v0.66.0 release (#6834)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-06-27 16:16:32 +02:00