Skip to content

Commit

Permalink
Add condition to RoleRule
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Haines <[email protected]>
  • Loading branch information
haines committed Jan 20, 2025
1 parent e32163b commit 63130ae
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/core.rolerule.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ string\[\]
**_(ALPHA)_**


</td></tr>
<tr><td>

[condition?](./core.rolerule.condition.md)


</td><td>


</td><td>

[Condition](./core.condition.md) \| undefined


</td><td>

**_(ALPHA)_** _(Optional)_


</td></tr>
<tr><td>

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/convert/toProtobuf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,12 @@ function rolePolicyToProtobuf({
function roleRuleToProtobuf({
resource,
allowActions,
condition,
}: RoleRule): RoleRuleProtobuf {
return {
resource,
allowActions,
condition: condition && conditionToProtobuf(condition),
};
}

Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/types/external/RoleRule.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import type { Condition } from "./Condition";

/** @alpha */
export interface RoleRule {
/** @alpha */
resource: string;

/** @alpha */
allowActions: string[];

/** @alpha */
condition?: Condition | undefined;
}

0 comments on commit 63130ae

Please sign in to comment.