Skip to content

Commit

Permalink
feat(Access): Add isolation_required flag to access policies
Browse files Browse the repository at this point in the history
  • Loading branch information
jroyal committed Apr 3, 2023
1 parent 6e57beb commit 7dd7ee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 7dd7ee8

Please sign in to comment.