You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(ec2): add security related unit tests (#5778)
## Problem
We want unit tests to ensure certain security measures are maintained in
the code. Properties tested in this PR include:
1. create inline policy with minimal actions necessary to perform
desired action
2. prompt user to confirm attached role and allow cancellation.
3. test run the ssh agent before using it for remote connections.
## Solution
For each test we do the following:
1. assert that the actions we are adding to the policy remains as the
core 6.
2. use `getTestWindow()` to ensure user's are able to see policies
added, and cancel the process.
3. spy on `tryRun` to ensure it is used before returning the ssh path.
As part of (3), we refactor the pathfinding code to be contained in its
own class. This makes the code easier to test since we can now use
`sinon.spy` and `sinon.stub`. It also allows us to move some of the
shared logic into one place.
---
<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->
License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
---------
Co-authored-by: Justin M. Keyes <[email protected]>
0 commit comments