Skip to content

Commit 928ab93

Browse files
feat: Sentinel UDR migration (#955)
* add sentinel docs to develop * re-run prebuild binaries * add labeling
1 parent 1383499 commit 928ab93

File tree

1,659 files changed

+224767
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,659 files changed

+224767
-27
lines changed

.github/labeler.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: BUSL-1.1
3+
14
# Add a Terraform label to changes under the related folders:
25
#
36
# Folder | Labels
@@ -92,4 +95,17 @@ WAF:
9295
- changed-files:
9396
- any-glob-to-any-file: [
9497
'content/well-architected-framework/**'
98+
]
99+
100+
# Add 'Sentinel' label to changes under 'content/sentinel'
101+
#
102+
# Label | Rule
103+
# --------------- | ------------------------------------------------------------
104+
# Sentinel | Default; applies to all doc updates
105+
106+
Sentinel:
107+
- any:
108+
- changed-files:
109+
- any-glob-to-any-file: [
110+
'content/sentinel/**'
95111
]
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
---
2+
page_title: Sentinel Runtime Release Notes
3+
sidebar_title: Release Notes
4+
sidebar_current: docs-changelog
5+
description: >-
6+
This are the public release notes for the Sentinel runtime. See this document
7+
for the latest updates.
8+
layout: docs
9+
---
10+
11+
# Sentinel Runtime Release Notes
12+
13+
These are the release notes for the Sentinel runtime.
14+
15+
Each version of the runtime is released with a corresponding version of
16+
[Sentinel CLI](/sentinel/commands). To download the CLI, see the [downloads
17+
page](/sentinel/downloads).
18+
19+
Sentinel integrations and embedded runtimes may not always have the latest
20+
version installed, depending on the product's individual release cycle. For more
21+
information, contact the support team for your specific integration.
22+
23+
<!-- BEGIN GENERATED CONTENT -->
24+
25+
## 0.12.1 (Unreleased)
26+
27+
## 0.12.0 (October 7, 2019)
28+
29+
LANGUAGE CHANGES:
30+
31+
- **New `case` statement**. This statement is a selection control mechanism to
32+
conditionally execute a branch based on expression equality, allowing
33+
simplification of complex conditional chains that may otherwise need to be
34+
written with `else if`. See the [Case
35+
Statements](https://docs.hashicorp.com/sentinel/language/spec#case-statements)
36+
section of the Sentinel language specification for more details.
37+
38+
IMPROVEMENTS:
39+
40+
- `lang/semantic`: Added a semantic check to ensure usage of append is not using
41+
a return value.
42+
43+
BUG FIXES:
44+
45+
- `runtime/eval`: Corrected an issue where calling a method on an import object
46+
value that was the result of a method call on another import object value
47+
would have erroneously tried to call an import of the name of the "parent"
48+
import object value. Example: in `a = subject.new(); b = a.call(); c = b.call()`, `b.call()` would attempt to call a method named `call` on the root
49+
namespace for an import named `a`. This has now been corrected so that
50+
`b.call()` will now correctly call the `call` method for the respective object
51+
namespace residing in the import named `subject`.
52+
- `imports`: Some standard imports may have been returning null for some unknown
53+
keys in objects when they should have been returning undefined. This was due
54+
to an SDK issue which was corrected in SDK version 0.3.2, which has now been
55+
corrected.
56+
- `cmd/test`: `sentinel test` will now correctly fail a policy if it encounters
57+
an error.
58+
- `cmd/test`: `sentinel test` will now correctly display errors and other output
59+
that were missing due to a formatting issue.
60+
- `runtime/eval`: The `append` builtin now correctly returns undefined for all
61+
calls, as called for by the Specification. Note that in most cases, the
62+
semantic check outlined above will trigger an error if the return value is
63+
used.
64+
65+
## 0.11.0 (September 5, 2019)
66+
67+
LANGUAGE CHANGES:
68+
69+
- **New builtin function:** `range()`. This function existed in the spec in
70+
earlier versions but was removed as it lacked an implementation. This has now
71+
been implemented and re-added to the spec. See the
72+
[Range](https://docs.hashicorp.com/sentinel/language/spec#range) section of
73+
the Sentinel Specification for more details.
74+
- Lists are now comparable. Lists are equal if their corresponding elements are
75+
comparable and equal.
76+
- Method calls on values returned by imports are now supported. See the
77+
[Imports](https://docs.hashicorp.com/sentinel/language/spec#imports) section
78+
of the Sentinel Specification for more details.
79+
80+
FEATURES:
81+
82+
- `imports/decimal`: This is a new import designed to do exact precision
83+
mathematical calculations.
84+
- `runtime/eval`: Compound call expressions that refer to imports (example:
85+
foo.bar().baz() when `foo` is a loaded import) will now function as expected.
86+
Previously, this was only supported up to the first call (example:
87+
`foo.bar()`).
88+
- `imports/time`: Timespaces returned by calls such as `time.now` are now
89+
callable. Example: `t = time.now; t.after(some_previous_time)` will now
90+
function.
91+
92+
IMPROVEMENTS:
93+
94+
- `runtime/eval`: The implementation of comparison of non-comparable types has
95+
now changed. Rather than triggering a runtime error, non-comparable types will
96+
now return false when attempting to compare.
97+
98+
## 0.10.4 (August 15, 2019)
99+
100+
BUG FIXES:
101+
102+
- `runtime/encoding`: Fixed an issue with conversion of null values that could
103+
lead to crashes in imports.
104+
105+
## 0.10.3 (July 15, 2019)
106+
107+
BUG FIXES:
108+
109+
- `command/config`: Parsing a configuration file where malformed data is
110+
encountered after apparently properly-formed data will now report an error. An
111+
example would be a situation where misplaced braces would cause a JSON object
112+
to only parse part of the configuration file.
113+
114+
## 0.10.2 (June 25, 2019)
115+
116+
BUG FIXES:
117+
118+
- `lang/parser`: Corrected an issue where parsing certain compound binary
119+
expressions where the negation predicate (`not`) was in use would cause the
120+
negation to have no effect. Example: `foo else "bar" not in "baz"` would have
121+
been parsed and evaluated as `foo else "bar" in "baz"`, effectively producing
122+
the opposite result.
123+
124+
## 0.10.1 (May 9, 2019)
125+
126+
BUG FIXES:
127+
128+
- `command/test`: `sentinel test` now displays policies without
129+
tests as an unknown result with [no test files], instead of the somewhat
130+
erroneous behavior of displaying it as a PASS. A full test run with a mixture
131+
of passing tests and no tests still results in an overall successful result.
132+
133+
## 0.10.0 (April 18, 2019)
134+
135+
LANGUAGE CHANGES:
136+
137+
- Mixed-number arithmetic operations are now allowed. Addition (`+`),
138+
subtraction (`-`), multiplication (`*`), division (`/`), and remainder
139+
operations (`%`) are no longer restricted to number values of the same
140+
type, and can mix integer and floating point. The result of these operations
141+
is always a floating-point number.
142+
- Remainder (modulo, `%`) operations are now allowed on floating-point numbers.
143+
144+
BUG FIXES:
145+
146+
- `lang/parser`: Fixed a bug that affected the use of `not` with `contains`,
147+
`matches`, or `in` in a compound expression.
148+
- `runtime/eval`: Fixed error messages on evaluation errors with `contains` and
149+
`in` to indicate that strings are an allowed type along with lists and maps.
150+
151+
## 0.9.2 (March 15, 2019)
152+
153+
This is a dependency update related to the changes mentioned in 0.9.1. No other
154+
changes have been made.
155+
156+
## 0.9.1 (March 14, 2019)
157+
158+
This is a patch release that is required to integrate with the latest versions
159+
of the [Sentinel SDK](https://github.com/hashicorp/sentinel-sdk). No other
160+
changes have been made.
161+
162+
## 0.9.0 (January 28, 2019)
163+
164+
FEATURES:
165+
166+
- `imports/strings`: Added a `join` function to the `strings` import. This can
167+
be used to join a list into a string with a specific separator.
168+
Multi-dimensional lists and all Sentinel primitives are supported.
169+
170+
## 0.8.1 (January 17, 2019)
171+
172+
BUG FIXES:
173+
174+
- `lang/eval`: Fixed a bug that prevents the effective use of `return`
175+
statements in `for` loops.
176+
177+
## 0.8.0 (January 14, 2019)
178+
179+
FEATURES:
180+
181+
- Mocks can now be represented by Sentinel code. This allows for the mocking of
182+
functions and other complex data structures that cannot be represented in
183+
JSON. For more information on using this feature via mocks, click
184+
[here](https://docs.hashicorp.com/sentinel/commands/config#mocking-with-sentinel-code).
185+
186+
IMPROVEMENTS:
187+
188+
- Import validation has now been moved to the semantic checking phase. This
189+
should result in better reporting of validation errors. In addition, import
190+
validation will now enforce the use of an `as` identifier when an import path
191+
is not a valid identifier on its own (example: `import "foo/bar"`).
192+
193+
## 0.7.0 (December 12, 2018)
194+
195+
BUG FIXES:
196+
197+
- There have been changes to the runtime in how scope is handled over multiple
198+
policy executions. Scope is now correctly unique per single policy execution,
199+
and values set or builtins that are overridden in one policy will no longer
200+
affect those values within another.
201+
202+
## 0.6.0 (November 30, 2018)
203+
204+
FEATURES:
205+
206+
- `imports/runtime`: This new import allows for one to check various aspects of
207+
the Sentinel runtime as it may be embedded in the simulator or a specific
208+
implementation. For now, it allows the version to be checked.
209+
210+
## 0.5.1 (November 28, 2018)
211+
212+
IMPROVEMENTS:
213+
214+
- `imports/time`: Added the `zone` and `zone_string` attributes to assist with
215+
validation of a timespace's zone.
216+
- `command/fmt`: Added a new -check flag. This option does not commit changes,
217+
but instead checks to see what files need formatting and outputs them on
218+
stdout.
219+
220+
BUG FIXES:
221+
222+
- `command/test`: Ensure that passing test results are correctly output one per
223+
line. Tests are also now run in a deterministic fashion based on
224+
lexicographical (alphabetical) order.
225+
- `imports/time`: `month_name` and `weekday_name` will now show up correctly in
226+
a returned timespace result.
227+
228+
## 0.5.0 (November 5, 2018)
229+
230+
IMPROVEMENTS:
231+
232+
- `spec`: Selectors can now contain any reserved word (example: `rule`) or
233+
keyword operator (example: `any`, `all`, `is`, `not`). This only works for the
234+
_selector_ part of the expression (after the first period) - the first primary
235+
expression (before the first period) still needs to be an identifier that does
236+
not conflict with reserved words.
237+
238+
BUG FIXES:
239+
240+
- The simulator should now display import function call names correctly in
241+
import errors.
242+
243+
## 0.4.0 (October 1, 2018)
244+
245+
FEATURES:
246+
247+
- `builtin`: Added the `bool` built-in type conversion function. Booleans will
248+
also now accepted as conversion into other values as well, with the full list
249+
of behaviors available in the spec.
250+
251+
## 0.3.2 (September 27, 2018)
252+
253+
FEATURES:
254+
255+
- `command/apply`: `sentinel apply` now prints out messages output by the
256+
`print()` function when a trace is output on policy failure, or when a trace
257+
is forced with `-trace`.
258+
- `imports/time`: Added the `month_name` and `weekday_name` keys to the
259+
timespace, which return full-English names for the month and day of the week.
260+
261+
BUG FIXES:
262+
263+
- `command/fmt`: `sentinel fmt -` Will no longer print out the filter status
264+
message on the output stream when `-write=false` Is not explicitly stated.
265+
This brings the behavior of the command in line with the help text.
266+
- `runtime`: Index operations on the right-hand-side that have negative indexes
267+
that go out of range (example: `length(list) * -1 - 1`) now correctly return
268+
`undefined`. left-hand-side index assignments with a out-of-range negative
269+
index still return runtime errors.
270+
271+
## 0.3.1 (August 3, 2018)
272+
273+
BUG FIXES:
274+
275+
- `runtime`: Basic index assignment has been implemented as per the spec.
276+
- `runtime`: Index expressions for lists with negative indexes will no longer panic if the
277+
list index is less than `length(list) * -1`.
278+
279+
## 0.3.0 (July 20, 2018)
280+
281+
FEATURES:
282+
283+
- **New standard import: `types`.** This can be used to dynamicaly detect the
284+
type of some value.
285+
286+
## 0.2.0 (April 11, 2018)
287+
288+
FEATURES:
289+
290+
- **New standard import: `json`.** Marshal and unmarshal JSON documents and
291+
access their contents as native Sentinel values.
292+
- **`break` and `continue`.** These are now both specified and implemented.
293+
`break` allows loop exiting and `continue` allows immediate execution of the
294+
next iteration.
295+
296+
IMPROVEMENTS:
297+
298+
- runtime: `print()` map values are now ordered alphabetically by keys.
299+
300+
BUG FIXES:
301+
302+
- command/test: If no `test` block exists, test behaves like it is asserting
303+
`main: true`.
304+
- runtime: default maximum stack depth to 500
305+
- runtime: `print()` map values now appear like more typical maps.
306+
- runtime: division by zero is an error, not a crash
307+
- runtime: plugins that send map values with `null` values now decode properly
308+
into native Sentinel values.
309+
310+
## 0.1.0 (September 19, 2017)
311+
312+
Initial release.
313+
314+
<!-- END GENERATED CONTENT -->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
page_title: 'Command: apply'
3+
sidebar_title: '<code>apply</code>'
4+
sidebar_current: docs-commands-apply
5+
description: >-
6+
The `sentinel apply` command is used to execute a policy locally for
7+
development purposes.
8+
layout: docs
9+
---
10+
11+
# Command: `apply`
12+
13+
The `sentinel apply` command is used to execute a policy locally for development
14+
purposes.
15+
16+
## Usage
17+
18+
Usage: `sentinel apply [options] POLICY`
19+
20+
This command executes the policy file at the path specified by POLICY.
21+
22+
Use the exit code of this command to determine the exact status of the policy
23+
evaluation. `0` is pass, `1` is fail, `2` is undefined (fail, but because the
24+
result was undefined), and `3` is a runtime error. Errors unrelated to the
25+
policy status itself are returned with an exit status of `9`.
26+
27+
To control the behavior of the `apply` command, create a [configuration
28+
file](/sentinel/commands/config). With this, you can define available
29+
[import plugins](/sentinel/concepts/imports), mock data, and global values.
30+
This can help you simulate a policy embedded within an application.
31+
32+
The command-line flags are all optional. The list of available flags are:
33+
34+
- `-config=path` - Path to a configuration file specifying available imports,
35+
mock data, globals, etc. The default is `sentinel.json`.
36+
37+
- `-global key=value` - Set global values. This is the same as setting `global`
38+
in the configuration file, and will override any of these respective values
39+
set in the configuration. The value is either a string, or a JSON number,
40+
array, or object. To force strings, use quotes.
41+
42+
- `-param key=value` - Set parameters, the same as setting `param` in the
43+
configuration file. Values are handled in the same way they are with the
44+
`-global` flag.
45+
46+
- `-trace` - Always show the execution trace. This shows intermediate
47+
boolean expression values. This always shows for failed policies.

0 commit comments

Comments
 (0)