Skip to content

Commit

Permalink
Merge pull request #1258 from jroyal/jroyal/auth-4939
Browse files Browse the repository at this point in the history
feat(Access): Add isolation_required flag to access policies
  • Loading branch information
jacobbednarz authored Apr 3, 2023
2 parents 6e57beb + 1ee8ee9 commit e17395e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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": "test@example.com"}},
},
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

0 comments on commit e17395e

Please sign in to comment.