Skip to content

Commit 81308f4

Browse files
committed
identity: update format of custom policy statement
update role.policy.Statement.Resource to interafce{}, then the object can be compatible with cloud services and agencies.
1 parent 82d5668 commit 81308f4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

openstack/identity/v3.0/policies/requests.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func Get(client *golangsdk.ServiceClient, id string) (r GetResult) {
1414
return
1515
}
1616

17+
// List retrieves all custom policies.
1718
func List(client *golangsdk.ServiceClient) pagination.Pager {
1819
pager := pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
1920
return RolePage{pagination.LinkedPageBase{PageResult: r}}
@@ -29,16 +30,18 @@ type CreateOptsBuilder interface {
2930
ToPolicyCreateMap() (map[string]interface{}, error)
3031
}
3132

33+
// Policy contains the content of a custom policy.
3234
type Policy struct {
3335
Version string `json:"Version" required:"true"`
3436
Statement []Statement `json:"Statement" required:"true"`
3537
}
3638

39+
// Statement represents the Statement of a custom policy.
3740
type Statement struct {
38-
Action []string `json:"Action" required:"true"`
39-
Effect string `json:"Effect" required:"true"`
40-
Condition map[string]map[string][]string `json:"Condition,omitempty"`
41-
Resource []string `json:"Resource,omitempty"`
41+
Action []string `json:"Action" required:"true"`
42+
Effect string `json:"Effect" required:"true"`
43+
Condition map[string]interface{} `json:"Condition,omitempty"`
44+
Resource interface{} `json:"Resource,omitempty"`
4245
}
4346

4447
// CreateOpts provides options used to create a policy.

0 commit comments

Comments
 (0)