udondan/iam-floyd

View on GitHub
CHANGELOG/v0.58.0.md

Summary

Maintainability
Test Coverage
:warning: **Breaking changes:**

- The functionality of the method `allActions` now has been split into multiple methods:
  - `allActions`: No longer takes parameters. This method indeed adds all actions to the statement
  - `allMatchingActions`: Takes regular expressions and adds all matching actions to the statement
  - To work with access levels, use on of the new methods:
    - `allListActions`
    - `allReadActions`
    - `allWriteActions`
    - `allPermissionManagementActions`
    - `allTaggingActions`

  This change was partially forced by JSII limitations. The `All` class would have a conflicting `allActions` signature as it didn't take parameters, which isn't allowed by JSII. It also raised confusion as it was hard to explain why it differed. Splitting the functionality into multiple methods was the better choice.

  Since we now have distinct methods for adding all actions per access level the ENUM `AccessLevel` no longer is exported.

  This changes requires you to modify your code if you have used regular expressions and/or access levels. Example

  ```typescript
  new statement.Ec2()
    .allow()
    .allReadActions()
  ```

```typescript
  new statement.Ec2()
    .deny()
    .allMatchingActions(`/vpn/i`)
  ```

Other changes:

- Removes global condition overrides in statement providers. This is required since [JSII does simply not allow to override methods of parent classes while at the same time returning `this` from those methods](https://github.com/aws/jsii/issues/1935). Unfortunately this removes the specific method description with related resource type and actions.

- Default operator for global conditions, which support ARNs, now is `ArnLike` instead of `ArnEquals`. Because `ArnLike` behaves the same as `ArnEquals` if it doesn't contain wildcards. And if you provide an ARN with wildcards you wanted `ArnLike` anyway.

- Fixes description for many global conditions. Default operator is `StringLike` instead of `StringEquals`.