Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

Requires a policy decision point server running Cerbos 0.54+.

- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

### Changed

- Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition) ([#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.

### Removed

- Support for Node.js 20, which is now [end-of-life][nodejs-eol] ([#1454](https://github.com/cerbos/cerbos-sdk-javascript/pull/1454))
Expand Down
9 changes: 7 additions & 2 deletions packages/core/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ unreleased:

- summary: "[`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

- summary: "[`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

changed:
- summary: Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition)
details: Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.
pull: 1456

removed:
- summary: Support for Node.js 20, which is now [end-of-life][nodejs-eol]
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/convert/fromProtobuf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,17 +1172,23 @@ function resourceRuleFromProtobuf({

function rolePolicyFromProtobuf({
policyType,
version,
parentRoles,
scope,
constants,
variables,
rules,
}: RolePolicyProtobuf): RolePolicy {
requireOneOf("RolePolicy.policyType", policyType, "role");

return {
rolePolicy: {
role: policyType.value,
version,
parentRoles: parentRoles,
scope,
constants: constants && constantsFromProtobuf(constants),
variables: variables && variablesFromProtobuf(variables),
rules: rules.map(roleRuleFromProtobuf),
},
};
Expand All @@ -1191,10 +1197,16 @@ function rolePolicyFromProtobuf({
function roleRuleFromProtobuf({
resource,
allowActions,
condition,
name,
output,
}: RoleRuleProtobuf): RoleRule {
return {
resource,
allowActions,
condition: condition && conditionFromProtobuf(condition),
name,
output: output && outputFromProtobuf(output),
};
}

Expand Down
8 changes: 8 additions & 0 deletions packages/files/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

## [Unreleased]

### Added

- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

### Changed

- Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition) ([#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

- Bump dependency on [yaml] to 2.9.0 ([#1450](https://github.com/cerbos/cerbos-sdk-javascript/pull/1450), [#1453](https://github.com/cerbos/cerbos-sdk-javascript/pull/1453))

### Removed
Expand Down
11 changes: 11 additions & 0 deletions packages/files/changelog.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
unreleased:
type: minor

added:
- summary: "[`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties"
pulls: [1452, 1456]

- summary: "[`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties"
pulls: [1452, 1456]

changed:
- summary: Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition)
pull: 1456

bumped:
yaml:
to: 2.9.0
Expand Down
10 changes: 8 additions & 2 deletions packages/grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

Requires a policy decision point server running Cerbos 0.54+.

- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

### Changed

- Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition) ([#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.

### Removed

- Support for Node.js 20, which is now [end-of-life][nodejs-eol] ([#1454](https://github.com/cerbos/cerbos-sdk-javascript/pull/1454))
Expand Down
9 changes: 7 additions & 2 deletions packages/grpc/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ unreleased:

- summary: "[`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

- summary: "[`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

changed:
- summary: Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition)
details: Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.
pull: 1456

removed:
- summary: Support for Node.js 20, which is now [end-of-life][nodejs-eol]
Expand Down
10 changes: 8 additions & 2 deletions packages/http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

Requires a policy decision point server running Cerbos 0.54+.

- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452))
- [`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties ([#1452](https://github.com/cerbos/cerbos-sdk-javascript/pull/1452), [#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Requires a policy decision point server running Cerbos 0.54+.

### Changed

- Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition) ([#1456](https://github.com/cerbos/cerbos-sdk-javascript/pull/1456))

Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.

### Removed

- Support for Node.js 20, which is now [end-of-life][nodejs-eol] ([#1454](https://github.com/cerbos/cerbos-sdk-javascript/pull/1454))
Expand Down
9 changes: 7 additions & 2 deletions packages/http/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ unreleased:

- summary: "[`RolePolicyBody.constants`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#constants) and [`variables`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#variables) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

- summary: "[`RoleRule.name`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#name) and [`output`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#output) properties"
details: Requires a policy decision point server running Cerbos 0.54+.
pull: 1452
pulls: [1452, 1456]

changed:
- summary: Deserialize [`RolePolicyBody.version`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RolePolicyBody.html#version) and [`RoleRule.condition`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.RoleRule.html#condition)
details: Previously, these fields could be set in an [`AddOrUpdatePoliciesRequest`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.AddOrUpdatePoliciesRequest.html), but were omitted from [`GetPoliciesResponse`](https://cerbos.github.io/cerbos-sdk-javascript/interfaces/_cerbos_core.GetPoliciesResponse.html), so round-tripping role policies to and from the policy decision point server was lossy.
pull: 1456

removed:
- summary: Support for Node.js 20, which is now [end-of-life][nodejs-eol]
Expand Down