From 502cea885bb5c6d0cb18ebc0a950812f46f15b29 Mon Sep 17 00:00:00 2001 From: SupportSDM Date: Wed, 12 Feb 2025 21:21:27 +0000 Subject: [PATCH] 12.10.0 --- access_rules.go | 62 +++++++++++++++++ client.go | 2 +- internal/v1/account_grants.pb.go | 111 +++++++++++++++++-------------- models.go | 2 + plumbing.go | 6 ++ 5 files changed, 132 insertions(+), 51 deletions(-) diff --git a/access_rules.go b/access_rules.go index 5ab3b63..21e9505 100644 --- a/access_rules.go +++ b/access_rules.go @@ -47,6 +47,27 @@ type AccessRule struct { // You can also use it in conjunction with the Type field to further narrow // down the scope of Resources granted. Tags Tags `json:"tags,omitempty"` + + // Privileges specify different privilege levels one can utilize with a set + // of resources. + Privileges Privileges `json:"privileges,omitempty"` +} + +// Privileges specify different privilege levels one can utilize with a +// set of resources. +type Privileges struct { + // K8s specifies a collection of privileges + // for any resource defined in an access rule that is of the + // kubernetes type. + K8s K8sPrivileges `json:"k8s,omitempty"` +} + +// K8sPrivileges specifies different privilege level constructs +// for kubernetes resources. +type K8sPrivileges struct { + // Groups are the list of RBAC groups one will impersonate into + // when attempting a connection to a k8s cluster. + Groups []string `json:"groups,omitempty"` } // AccessRules define which Resources can be accessed by members of a Role. @@ -58,6 +79,9 @@ func convertAccessRulesToPorcelain(rules string) (AccessRules, error) { } result := AccessRules{} decoder := json.NewDecoder(strings.NewReader(rules)) + // We want to disallow unknown fields because if we just drop them + // it could change the nature of an access rule if the client just + // sends it back to the server. decoder.DisallowUnknownFields() if err := decoder.Decode(&result); err != nil { return nil, err @@ -77,9 +101,47 @@ func convertAccessRulesToPlumbing(rules AccessRules) string { func ParseAccessRulesJSON(data string) (AccessRules, error) { result := AccessRules{} decoder := json.NewDecoder(strings.NewReader(data)) + // We want to disallow unknown fields because if we just drop them + // it could change the nature of an access rule if the client just + // sends it back to the server. decoder.DisallowUnknownFields() if err := decoder.Decode(&result); err != nil { return nil, err } return result, nil } + +func convertAccessRuleToPorcelain(rule string) (AccessRule, error) { + if rule == "" { + return AccessRule{}, nil + } + result := AccessRule{} + decoder := json.NewDecoder(strings.NewReader(rule)) + // We want to disallow unknown fields because if we just drop them + // it could change the nature of an access rule if the client just + // sends it back to the server. + decoder.DisallowUnknownFields() + if err := decoder.Decode(&result); err != nil { + return AccessRule{}, err + } + return result, nil +} + +func convertAccessRuleToPlumbing(rule AccessRule) string { + result, _ := json.Marshal(rule) + return string(result) +} + +// ParseAccessRuleJSON parses the given access rule JSON string. +func ParseAccessRuleJSON(data string) (AccessRule, error) { + result := AccessRule{} + decoder := json.NewDecoder(strings.NewReader(data)) + // We want to disallow unknown fields because if we just drop them + // it could change the nature of an access rule if the client just + // sends it back to the server. + decoder.DisallowUnknownFields() + if err := decoder.Decode(&result); err != nil { + return AccessRule{}, err + } + return result, nil +} diff --git a/client.go b/client.go index c566ef1..bfed7d5 100644 --- a/client.go +++ b/client.go @@ -43,7 +43,7 @@ import ( const ( defaultAPIHost = "api.strongdm.com:443" apiVersion = "2024-03-28" - defaultUserAgent = "strongdm-sdk-go/12.9.3" + defaultUserAgent = "strongdm-sdk-go/12.10.0" defaultPageLimit = 50 ) diff --git a/internal/v1/account_grants.pb.go b/internal/v1/account_grants.pb.go index df77885..e72d18c 100644 --- a/internal/v1/account_grants.pb.go +++ b/internal/v1/account_grants.pb.go @@ -718,7 +718,7 @@ var file_account_grants_proto_rawDesc = []byte{ 0xf3, 0xb3, 0x07, 0x01, 0xf2, 0xf8, 0xb3, 0x07, 0x06, 0xb2, 0xf4, 0xb3, 0x07, 0x01, 0x2a, 0xf2, 0xf8, 0xb3, 0x07, 0x12, 0xb2, 0xf4, 0xb3, 0x07, 0x0d, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x22, 0x87, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, + 0x74, 0x22, 0xba, 0x04, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xf2, 0xf8, 0xb3, 0x07, 0x05, 0xb0, 0xf3, 0xb3, 0x07, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, @@ -736,55 +736,66 @@ var file_account_grants_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0a, 0xf2, 0xf8, 0xb3, 0x07, 0x05, 0xb0, 0xf3, 0xb3, 0x07, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, - 0x12, 0x3f, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xf2, 0xf8, 0xb3, 0x07, 0x05, 0xb0, 0xf3, 0xb3, 0x07, - 0x01, 0xf2, 0xf8, 0xb3, 0x07, 0x0f, 0xb2, 0xf4, 0xb3, 0x07, 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, - 0x65, 0x3a, 0x28, 0xfa, 0xf8, 0xb3, 0x07, 0x23, 0xa8, 0xf3, 0xb3, 0x07, 0x01, 0xd2, 0xf3, 0xb3, - 0x07, 0x01, 0x2a, 0xd2, 0xf3, 0xb3, 0x07, 0x13, 0x21, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, 0x6f, - 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x32, 0xab, 0x04, 0x0a, 0x0d, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x73, 0x0a, - 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xf9, 0xb3, 0x07, 0x09, 0xa2, 0xf3, 0xb3, - 0x07, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x82, 0xf9, 0xb3, 0x07, 0x17, 0xaa, 0xf3, 0xb3, 0x07, 0x12, - 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x12, 0x6e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xf9, 0xb3, 0x07, 0x08, 0xa2, 0xf3, 0xb3, 0x07, 0x03, 0x67, 0x65, - 0x74, 0x82, 0xf9, 0xb3, 0x07, 0x1c, 0xaa, 0xf3, 0xb3, 0x07, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xf9, 0xb3, - 0x07, 0x0b, 0xa2, 0xf3, 0xb3, 0x07, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x82, 0xf9, 0xb3, - 0x07, 0x1c, 0xaa, 0xf3, 0xb3, 0x07, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6c, - 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x29, 0x82, 0xf9, 0xb3, 0x07, 0x08, 0xa2, 0xf3, 0xb3, 0x07, 0x03, 0x67, 0x65, 0x74, - 0x82, 0xf9, 0xb3, 0x07, 0x17, 0xaa, 0xf3, 0xb3, 0x07, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x1a, 0x4b, 0xca, 0xf9, - 0xb3, 0x07, 0x11, 0xc2, 0xf9, 0xb3, 0x07, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0xca, 0xf9, 0xb3, 0x07, 0x08, 0xd2, 0xf9, 0xb3, 0x07, 0x03, 0x61, 0x67, - 0x2d, 0xca, 0xf9, 0xb3, 0x07, 0x06, 0xca, 0xf9, 0xb3, 0x07, 0x01, 0x2a, 0xca, 0xf9, 0xb3, 0x07, - 0x18, 0xca, 0xf9, 0xb3, 0x07, 0x13, 0x21, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, 0x6f, 0x72, 0x6d, - 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x42, 0x69, 0x0a, 0x19, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x64, 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x6c, - 0x75, 0x6d, 0x62, 0x69, 0x6e, 0x67, 0x42, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x6d, 0x62, 0x69, 0x6e, 0x67, 0x5a, 0x35, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, - 0x64, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x64, 0x6d, 0x2d, 0x73, 0x64, 0x6b, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x76, - 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0xf1, 0x01, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0xcf, 0x01, 0xf2, 0xf8, 0xb3, 0x07, 0xc9, 0x01, 0xb0, + 0xf3, 0xb3, 0x07, 0x01, 0xca, 0xf3, 0xb3, 0x07, 0x9e, 0x01, 0xea, 0xf3, 0xb3, 0x07, 0x0b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0xf2, 0xf3, 0xb3, 0x07, 0x10, 0x0a, + 0x02, 0x67, 0x6f, 0x12, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, 0x65, 0xf2, + 0xf3, 0xb3, 0x07, 0x18, 0x0a, 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x12, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, 0x65, 0xf2, 0xf3, 0xb3, 0x07, + 0x1a, 0x0a, 0x0c, 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, 0x6f, 0x72, 0x6d, 0x12, + 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, 0x65, 0xf2, 0xf3, 0xb3, 0x07, 0x12, + 0x0a, 0x04, 0x6a, 0x61, 0x76, 0x61, 0x12, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, + 0x6c, 0x65, 0xf2, 0xf3, 0xb3, 0x07, 0x21, 0x0a, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, 0x65, 0xba, 0xf4, 0xb3, 0x07, 0x16, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x44, 0x69, 0x66, 0x66, 0x53, 0x75, 0x70, 0x70, 0x72, + 0x65, 0x73, 0x73, 0xd0, 0xf4, 0xb3, 0x07, 0x01, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x52, 0x75, 0x6c, 0x65, 0x3a, 0x28, 0xfa, 0xf8, 0xb3, 0x07, 0x23, 0xa8, 0xf3, 0xb3, 0x07, 0x01, + 0xd2, 0xf3, 0xb3, 0x07, 0x01, 0x2a, 0xd2, 0xf3, 0xb3, 0x07, 0x13, 0x21, 0x74, 0x65, 0x72, 0x72, + 0x61, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x32, 0xab, + 0x04, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x12, 0x73, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xf9, 0xb3, 0x07, 0x09, + 0xa2, 0xf3, 0xb3, 0x07, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x82, 0xf9, 0xb3, 0x07, 0x17, 0xaa, 0xf3, + 0xb3, 0x07, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x6e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xf9, 0xb3, 0x07, 0x08, 0xa2, 0xf3, 0xb3, 0x07, + 0x03, 0x67, 0x65, 0x74, 0x82, 0xf9, 0xb3, 0x07, 0x1c, 0xaa, 0xf3, 0xb3, 0x07, 0x17, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, + 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x82, 0xf9, 0xb3, 0x07, 0x0b, 0xa2, 0xf3, 0xb3, 0x07, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x82, 0xf9, 0xb3, 0x07, 0x1c, 0xaa, 0xf3, 0xb3, 0x07, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x6c, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xf9, 0xb3, 0x07, 0x08, 0xa2, 0xf3, 0xb3, 0x07, 0x03, + 0x67, 0x65, 0x74, 0x82, 0xf9, 0xb3, 0x07, 0x17, 0xaa, 0xf3, 0xb3, 0x07, 0x12, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x1a, + 0x4b, 0xca, 0xf9, 0xb3, 0x07, 0x11, 0xc2, 0xf9, 0xb3, 0x07, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0xca, 0xf9, 0xb3, 0x07, 0x08, 0xd2, 0xf9, 0xb3, 0x07, + 0x03, 0x61, 0x67, 0x2d, 0xca, 0xf9, 0xb3, 0x07, 0x06, 0xca, 0xf9, 0xb3, 0x07, 0x01, 0x2a, 0xca, + 0xf9, 0xb3, 0x07, 0x18, 0xca, 0xf9, 0xb3, 0x07, 0x13, 0x21, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, + 0x6f, 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x42, 0x69, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x64, 0x6d, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x6c, 0x75, 0x6d, 0x62, 0x69, 0x6e, 0x67, 0x42, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x6d, 0x62, 0x69, 0x6e, 0x67, + 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, + 0x6f, 0x6e, 0x67, 0x64, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x64, 0x6d, 0x2d, 0x73, + 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/models.go b/models.go index 6f3c2b6..f8c9c03 100644 --- a/models.go +++ b/models.go @@ -676,6 +676,8 @@ type AccountGetResponse struct { // AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource. type AccountGrant struct { + // The access rule associated with this AccountGrant. + AccessRule AccessRule `json:"accessRule"` // The account ID of this AccountGrant. AccountID string `json:"accountId"` // Unique identifier of the AccountGrant. diff --git a/plumbing.go b/plumbing.go index 8bfa04f..d717d05 100644 --- a/plumbing.go +++ b/plumbing.go @@ -1774,6 +1774,11 @@ func convertAccountGrantToPorcelain(plumbing *proto.AccountGrant) (*AccountGrant return nil, nil } porcelain := &AccountGrant{} + if v, err := convertAccessRuleToPorcelain(plumbing.AccessRule); err != nil { + return nil, fmt.Errorf("error converting field AccessRule: %v", err) + } else { + porcelain.AccessRule = v + } porcelain.AccountID = plumbing.AccountId porcelain.ID = plumbing.Id porcelain.ResourceID = plumbing.ResourceId @@ -1795,6 +1800,7 @@ func convertAccountGrantToPlumbing(porcelain *AccountGrant) *proto.AccountGrant return nil } plumbing := &proto.AccountGrant{} + plumbing.AccessRule = convertAccessRuleToPlumbing(porcelain.AccessRule) plumbing.AccountId = (porcelain.AccountID) plumbing.Id = (porcelain.ID) plumbing.ResourceId = (porcelain.ResourceID)