-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract policy body types for better documentation
Signed-off-by: Andrew Haines <haines@cerbos.dev>
- Loading branch information
Showing
41 changed files
with
512 additions
and
146 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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [DerivedRolesBody](./core.derivedrolesbody.md) > [definitions](./core.derivedrolesbody.definitions.md) | ||
|
||
## DerivedRolesBody.definitions property | ||
|
||
The definitions of the derived roles. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
definitions: DerivedRoleDefinition[]; | ||
``` |
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,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [DerivedRolesBody](./core.derivedrolesbody.md) | ||
|
||
## DerivedRolesBody interface | ||
|
||
A set of [derived roles](https://docs.cerbos.dev/cerbos/latest/policies/derived_roles.html) to augment static RBAC roles with contextual data to provide more fine-grained control at runtime. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface DerivedRolesBody | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [definitions](./core.derivedrolesbody.definitions.md) | | [DerivedRoleDefinition](./core.derivedroledefinition.md)<!-- -->\[\] | The definitions of the derived roles. | | ||
| [name](./core.derivedrolesbody.name.md) | | string | The name to use when importing the set of derived roles. | | ||
| [variables?](./core.derivedrolesbody.variables.md) | | [Variables](./core.variables.md) \| undefined | _(Optional)_ [Variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html) defined for use in conditions. | | ||
|
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) > [DerivedRolesBody](./core.derivedrolesbody.md) > [name](./core.derivedrolesbody.name.md) | ||
|
||
## DerivedRolesBody.name property | ||
|
||
The name to use when importing the set of derived roles. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
name: 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,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [DerivedRolesBody](./core.derivedrolesbody.md) > [variables](./core.derivedrolesbody.variables.md) | ||
|
||
## DerivedRolesBody.variables property | ||
|
||
[Variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html) defined for use in conditions. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
variables?: Variables | undefined; | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.29. | ||
|
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [ExportVariablesBody](./core.exportvariablesbody.md) > [definitions](./core.exportvariablesbody.definitions.md) | ||
|
||
## ExportVariablesBody.definitions property | ||
|
||
Variable expressions. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
definitions: Record<string, 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,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [ExportVariablesBody](./core.exportvariablesbody.md) | ||
|
||
## ExportVariablesBody interface | ||
|
||
A set of [exported variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html#export) to be reused in other policies. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface ExportVariablesBody | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.29. | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [definitions](./core.exportvariablesbody.definitions.md) | | Record<string, string> | Variable expressions. | | ||
| [name](./core.exportvariablesbody.name.md) | | string | The name to use when importing the set of variables. | | ||
|
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) > [ExportVariablesBody](./core.exportvariablesbody.md) > [name](./core.exportvariablesbody.name.md) | ||
|
||
## ExportVariablesBody.name property | ||
|
||
The name to use when importing the set of variables. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
name: 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
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
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,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [PrincipalPolicyBody](./core.principalpolicybody.md) | ||
|
||
## PrincipalPolicyBody interface | ||
|
||
A [policy](https://docs.cerbos.dev/cerbos/latest/policies/principal_policies.html) defining overrides for a specific user. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface PrincipalPolicyBody | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [principal](./core.principalpolicybody.principal.md) | | string | The ID of the principal to whom the policy applies. | | ||
| [rules](./core.principalpolicybody.rules.md) | | [PrincipalRule](./core.principalrule.md)<!-- -->\[\] | Rules defining the overrides that apply to the principal. | | ||
| [scope?](./core.principalpolicybody.scope.md) | | string | _(Optional)_ [Scope](https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html) of the policy. | | ||
| [variables?](./core.principalpolicybody.variables.md) | | [Variables](./core.variables.md) \| undefined | _(Optional)_ [Variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html) defined for use in conditions. | | ||
| [version](./core.principalpolicybody.version.md) | | string | The version of the policy. | | ||
|
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) > [PrincipalPolicyBody](./core.principalpolicybody.md) > [principal](./core.principalpolicybody.principal.md) | ||
|
||
## PrincipalPolicyBody.principal property | ||
|
||
The ID of the principal to whom the policy applies. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
principal: 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) > [PrincipalPolicyBody](./core.principalpolicybody.md) > [rules](./core.principalpolicybody.rules.md) | ||
|
||
## PrincipalPolicyBody.rules property | ||
|
||
Rules defining the overrides that apply to the principal. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
rules: PrincipalRule[]; | ||
``` |
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) > [PrincipalPolicyBody](./core.principalpolicybody.md) > [scope](./core.principalpolicybody.scope.md) | ||
|
||
## PrincipalPolicyBody.scope property | ||
|
||
[Scope](https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html) of the policy. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
scope?: 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,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [PrincipalPolicyBody](./core.principalpolicybody.md) > [variables](./core.principalpolicybody.variables.md) | ||
|
||
## PrincipalPolicyBody.variables property | ||
|
||
[Variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html) defined for use in conditions. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
variables?: Variables | undefined; | ||
``` | ||
|
||
## Remarks | ||
|
||
Requires the Cerbos policy decision point server to be at least v0.29. | ||
|
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) > [PrincipalPolicyBody](./core.principalpolicybody.md) > [version](./core.principalpolicybody.version.md) | ||
|
||
## PrincipalPolicyBody.version property | ||
|
||
The version of the policy. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
version: string; | ||
``` | ||
|
||
## Remarks | ||
|
||
Policies are uniquely identified by the principal name and version pair. You can have multiple policy versions for the same principal (e.g. production vs. staging). The version value `default` is special as it is the default fallback when no version is specified in the request. | ||
|
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [ResourcePolicyBody](./core.resourcepolicybody.md) > [importDerivedRoles](./core.resourcepolicybody.importderivedroles.md) | ||
|
||
## ResourcePolicyBody.importDerivedRoles property | ||
|
||
Name of a set of [derived roles](https://docs.cerbos.dev/cerbos/latest/policies/derived_roles.html) to import. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
importDerivedRoles?: 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,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@cerbos/core](./core.md) > [ResourcePolicyBody](./core.resourcepolicybody.md) | ||
|
||
## ResourcePolicyBody interface | ||
|
||
A [policy](https://docs.cerbos.dev/cerbos/latest/policies/resource_policies.html) defining rules for actions that can be performed on a given resource. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface ResourcePolicyBody | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [importDerivedRoles?](./core.resourcepolicybody.importderivedroles.md) | | string\[\] | _(Optional)_ Name of a set of [derived roles](https://docs.cerbos.dev/cerbos/latest/policies/derived_roles.html) to import. | | ||
| [resource](./core.resourcepolicybody.resource.md) | | string | The name of the resource to which the policy applies. | | ||
| [rules](./core.resourcepolicybody.rules.md) | | [ResourceRule](./core.resourcerule.md)<!-- -->\[\] | Rules defining the actions that can be performed on the resource. | | ||
| [schemas?](./core.resourcepolicybody.schemas.md) | | [SchemaRefs](./core.schemarefs.md) \| undefined | _(Optional)_ [Schemas](https://docs.cerbos.dev/cerbos/latest/policies/schemas.html) for principal and resource attributes. | | ||
| [scope?](./core.resourcepolicybody.scope.md) | | string | _(Optional)_ [Scope](https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html) of the policy. | | ||
| [variables?](./core.resourcepolicybody.variables.md) | | [Variables](./core.variables.md) \| undefined | _(Optional)_ [Variables](https://docs.cerbos.dev/cerbos/prerelease/policies/variables.html) defined for use in conditions. | | ||
| [version](./core.resourcepolicybody.version.md) | | string | The version of the policy. | | ||
|
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) > [ResourcePolicyBody](./core.resourcepolicybody.md) > [resource](./core.resourcepolicybody.resource.md) | ||
|
||
## ResourcePolicyBody.resource property | ||
|
||
The name of the resource to which the policy applies. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
resource: string; | ||
``` |
Oops, something went wrong.