forked from cerbos/cerbos-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for user-defined policy rule outputs
cerbos/cerbos#1594 Signed-off-by: Andrew Haines <haines@cerbos.dev>
- Loading branch information
Showing
54 changed files
with
718 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [CheckResourcesResult](./core.checkresourcesresult.md) > [output](./core.checkresourcesresult.output.md) | ||
|
||
## CheckResourcesResult.output() method | ||
|
||
Find the value of the user-defined output for a particular policy rule. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
output(source: string): Value | undefined; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| source | string | the identifier of the policy rule that produced the output. | | ||
|
||
**Returns:** | ||
|
||
[Value](./core.value.md) \| undefined | ||
|
||
`undefined` if the result does not include an output for the source. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [CheckResourcesResult](./core.checkresourcesresult.md) > [outputs](./core.checkresourcesresult.outputs.md) | ||
|
||
## CheckResourcesResult.outputs property | ||
|
||
User-defined outputs from policy rule evaluations. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
outputs: OutputResult[]; | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.27. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [Output](./core.output.md) > [expr](./core.output.expr.md) | ||
|
||
## Output.expr property | ||
|
||
A [Common Expression Language](https://docs.cerbos.dev/cerbos/latest/policies/conditions.html) expression to evaluate. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
expr: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [Output](./core.output.md) | ||
|
||
## Output interface | ||
|
||
User-defined output to be produced when evaluating a policy rule. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface Output | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [expr](./core.output.expr.md) | | string | A [Common Expression Language](https://docs.cerbos.dev/cerbos/latest/policies/conditions.html) expression to evaluate. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [OutputResult](./core.outputresult.md) | ||
|
||
## OutputResult interface | ||
|
||
User-defined output from a policy rule evaluation. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface OutputResult | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [source](./core.outputresult.source.md) | | string | The identifier of the policy rule that produced the output. | | ||
| [value](./core.outputresult.value.md) | | [Value](./core.value.md) \| undefined | The result of evaluating the output expression. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [OutputResult](./core.outputresult.md) > [source](./core.outputresult.source.md) | ||
|
||
## OutputResult.source property | ||
|
||
The identifier of the policy rule that produced the output. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
source: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [OutputResult](./core.outputresult.md) > [value](./core.outputresult.value.md) | ||
|
||
## OutputResult.value property | ||
|
||
The result of evaluating the output expression. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
value: Value | undefined; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [PrincipalRuleAction](./core.principalruleaction.md) > [output](./core.principalruleaction.output.md) | ||
|
||
## PrincipalRuleAction.output property | ||
|
||
User-defined output to be produced when evaluating the rule. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
output?: Output | undefined; | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.27. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [ResourceRule](./core.resourcerule.md) > [output](./core.resourcerule.output.md) | ||
|
||
## ResourceRule.output property | ||
|
||
User-defined output to be produced when evaluating the rule. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
output?: Output | undefined; | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.27. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.