Skip to content
Open
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
43 changes: 43 additions & 0 deletions test/iam/platform-access-approval/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: platform-access-approval
spec:
description: |
Verify that a User's registrationApproval starts as Pending and becomes Approved
after creating a PlatformAccessApproval.
steps:
- name: approval-flow
description: Create a User, confirm Pending, then approve and expect Approved
try:
- apply:
file: resources/user-approval.yaml
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-approval-test-user
timeout: 2m
for:
condition:
name: Ready
value: 'True'
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-approval-test-user
timeout: 1m
for:
jsonPath:
path: '{.status.registrationApproval}'
value: Pending
- apply:
file: resources/approval.yaml
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-approval-test-user
timeout: 2m
for:
jsonPath:
path: '{.status.registrationApproval}'
value: Approved
8 changes: 8 additions & 0 deletions test/iam/platform-access-approval/resources/approval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: PlatformAccessApproval
metadata:
name: access-approval-for-test-user
spec:
subjectRef:
userRef:
name: access-approval-test-user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: User
metadata:
name: access-approval-test-user
spec:
email: [email protected]
givenName: Approval
familyName: User
45 changes: 45 additions & 0 deletions test/iam/platform-access-rejection/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: platform-access-rejection
spec:
description: |
Verify that a User's registrationApproval starts as Pending and becomes Rejected
after creating a PlatformAccessRejection.
steps:
- name: rejection-flow
description: Create a User, confirm Pending, then reject and expect Rejected
try:
- apply:
file: resources/user-rejection.yaml
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-rejection-test-user
timeout: 2m
for:
condition:
name: Ready
value: 'True'
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-rejection-test-user
timeout: 1m
for:
jsonPath:
path: '{.status.registrationApproval}'
value: Pending
- apply:
file: resources/rejection.yaml
- wait:
apiVersion: iam.miloapis.com/v1alpha1
kind: User
name: access-rejection-test-user
timeout: 2m
for:
jsonPath:
path: '{.status.registrationApproval}'
value: Rejected


8 changes: 8 additions & 0 deletions test/iam/platform-access-rejection/resources/rejection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: PlatformAccessRejection
metadata:
name: access-rejection-for-test-user
spec:
subjectRef:
name: access-rejection-test-user
reason: Not eligible for platform access
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: User
metadata:
name: access-rejection-test-user
spec:
email: [email protected]
givenName: Rejection
familyName: User
Loading