Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Access): Add isolation_required flag to access policies #1258

Merged
merged 1 commit into from
Apr 3, 2023
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
3 changes: 3 additions & 0 deletions .changelog/1258.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
access: Add `isolation_required` flag to Access policies
```
1 change: 1 addition & 0 deletions access_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type AccessPolicy struct {
UpdatedAt *time.Time `json:"updated_at"`
Name string `json:"name"`

IsolationRequired *bool `json:"isolation_required,omitempty"`
PurposeJustificationRequired *bool `json:"purpose_justification_required,omitempty"`
PurposeJustificationPrompt *string `json:"purpose_justification_prompt,omitempty"`
ApprovalRequired *bool `json:"approval_required,omitempty"`
Expand Down
6 changes: 6 additions & 0 deletions access_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
updatedAt, _ = time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")
expiresAt, _ = time.Parse(time.RFC3339, "2015-01-01T05:20:00.12345Z")

isolationRequired = true
purposeJustificationRequired = true
purposeJustificationPrompt = "Please provide a business reason for your need to access before continuing."
approvalRequired = true
Expand All @@ -39,6 +40,7 @@ var (
Require: []interface{}{
map[string]interface{}{"email": map[string]interface{}{"email": "[email protected]"}},
},
IsolationRequired: &isolationRequired,
PurposeJustificationRequired: &purposeJustificationRequired,
ApprovalRequired: &approvalRequired,
PurposeJustificationPrompt: &purposeJustificationPrompt,
Expand Down Expand Up @@ -95,6 +97,7 @@ func TestAccessPolicies(t *testing.T) {
}
}
],
"isolation_required": true,
"purpose_justification_required": true,
"purpose_justification_prompt": "Please provide a business reason for your need to access before continuing.",
"approval_required": true,
Expand Down Expand Up @@ -176,6 +179,7 @@ func TestAccessPolicy(t *testing.T) {
}
}
],
"isolation_required": true,
"purpose_justification_required": true,
"purpose_justification_prompt": "Please provide a business reason for your need to access before continuing.",
"approval_required": true,
Expand Down Expand Up @@ -250,6 +254,7 @@ func TestCreateAccessPolicy(t *testing.T) {
}
}
],
"isolation_required": true,
"purpose_justification_required": true,
"purpose_justification_prompt": "Please provide a business reason for your need to access before continuing.",
"approval_required": true,
Expand Down Expand Up @@ -356,6 +361,7 @@ func TestUpdateAccessPolicy(t *testing.T) {
}
}
],
"isolation_required": true,
"purpose_justification_required": true,
"purpose_justification_prompt": "Please provide a business reason for your need to access before continuing.",
"approval_required": true,
Expand Down