From c6d6aa7751238d4a359c7d0352e2a94e9e4495a2 Mon Sep 17 00:00:00 2001 From: SupportSDM Date: Wed, 8 Jan 2025 17:15:06 +0000 Subject: [PATCH] 11.23.0 --- client.go | 2 +- internal/v1/workflows.pb.go | 73 ++++++++++++++++++++++++++++--------- models.go | 6 +++ plumbing.go | 12 ++++++ 4 files changed, 75 insertions(+), 18 deletions(-) diff --git a/client.go b/client.go index f915f1e..16e5acf 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/11.22.0" + defaultUserAgent = "strongdm-sdk-go/11.23.0" defaultPageLimit = 50 ) diff --git a/internal/v1/workflows.pb.go b/internal/v1/workflows.pb.go index d81d988..eddd045 100644 --- a/internal/v1/workflows.pb.go +++ b/internal/v1/workflows.pb.go @@ -23,6 +23,7 @@ package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" ) @@ -691,6 +692,12 @@ type Workflow struct { // Optional requires reason setting to specify whether or not a request requires the requester // to provide a reason with the access request. Defaults to false. RequiresReason bool `protobuf:"varint,7,opt,name=requires_reason,json=requiresReason,proto3" json:"requires_reason,omitempty"` + // Maximum Duration of access requests bound to this workflow. If max duration is provided, fixed duration must be empty. + // If neither max nor fixed duration are provided, requests that bind to this workflow will use the organization-level settings. + AccessRequestMaxDuration *durationpb.Duration `protobuf:"bytes,10,opt,name=access_request_max_duration,json=accessRequestMaxDuration,proto3" json:"access_request_max_duration,omitempty"` + // Fixed Duration of access requests bound to this workflow. If fixed duration is provided, max duration must be empty. + // If neither max nor fixed duration are provided, requests that bind to this workflow will use the organization-level settings. + AccessRequestFixedDuration *durationpb.Duration `protobuf:"bytes,11,opt,name=access_request_fixed_duration,json=accessRequestFixedDuration,proto3" json:"access_request_fixed_duration,omitempty"` // AccessRules is a list of access rules defining the resources this Workflow provides access to. AccessRules string `protobuf:"bytes,8,opt,name=access_rules,json=accessRules,proto3" json:"access_rules,omitempty"` // Optional approval flow ID identifies an approval flow that linked to the workflow @@ -778,6 +785,20 @@ func (x *Workflow) GetRequiresReason() bool { return false } +func (x *Workflow) GetAccessRequestMaxDuration() *durationpb.Duration { + if x != nil { + return x.AccessRequestMaxDuration + } + return nil +} + +func (x *Workflow) GetAccessRequestFixedDuration() *durationpb.Duration { + if x != nil { + return x.AccessRequestFixedDuration + } + return nil +} + func (x *Workflow) GetAccessRules() string { if x != nil { return x.AccessRules @@ -796,7 +817,9 @@ var File_workflows_proto protoreflect.FileDescriptor var file_workflows_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x76, 0x31, 0x1a, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x6f, 0x12, 0x02, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x65, 0x74, @@ -906,7 +929,7 @@ var file_workflows_proto_rawDesc = []byte{ 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, 0x3a, 0x0a, 0xfa, 0xf8, 0xb3, 0x07, 0x05, - 0xa8, 0xf3, 0xb3, 0x07, 0x01, 0x22, 0xd5, 0x05, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0xa8, 0xf3, 0xb3, 0x07, 0x01, 0x22, 0xa5, 0x07, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 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, 0x23, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0xf2, 0xf8, @@ -926,6 +949,19 @@ var file_workflows_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x08, 0x42, 0x19, 0xf2, 0xf8, 0xb3, 0x07, 0x14, 0xb0, 0xf3, 0xb3, 0x07, 0x01, 0xb2, 0xf4, 0xb3, 0x07, 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, + 0x64, 0x0a, 0x1b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x0a, 0xf2, 0xf8, 0xb3, 0x07, 0x05, 0xb0, 0xf3, 0xb3, 0x07, 0x01, 0x52, 0x18, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x78, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x1d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0xf2, 0xf8, 0xb3, 0x07, 0x05, 0xb0, 0xf3, + 0xb3, 0x07, 0x01, 0x52, 0x1a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xff, 0x01, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0xdb, 0x01, 0xf2, 0xf8, 0xb3, 0x07, 0xd5, 0x01, 0xb0, 0xf3, 0xb3, 0x07, 0x01, 0xca, 0xf3, 0xb3, 0x07, 0xa9, 0x01, 0xea, 0xf3, 0xb3, 0x07, 0x0c, 0x61, @@ -1033,6 +1069,7 @@ var file_workflows_proto_goTypes = []interface{}{ (*DeleteResponseMetadata)(nil), // 19: v1.DeleteResponseMetadata (*ListRequestMetadata)(nil), // 20: v1.ListRequestMetadata (*ListResponseMetadata)(nil), // 21: v1.ListResponseMetadata + (*durationpb.Duration)(nil), // 22: google.protobuf.Duration } var file_workflows_proto_depIdxs = []int32{ 11, // 0: v1.WorkflowCreateRequest.meta:type_name -> v1.CreateRequestMetadata @@ -1056,21 +1093,23 @@ var file_workflows_proto_depIdxs = []int32{ 21, // 18: v1.WorkflowListResponse.meta:type_name -> v1.ListResponseMetadata 10, // 19: v1.WorkflowListResponse.workflows:type_name -> v1.Workflow 13, // 20: v1.WorkflowListResponse.rate_limit:type_name -> v1.RateLimitMetadata - 0, // 21: v1.Workflows.Create:input_type -> v1.WorkflowCreateRequest - 2, // 22: v1.Workflows.Get:input_type -> v1.WorkflowGetRequest - 6, // 23: v1.Workflows.Delete:input_type -> v1.WorkflowDeleteRequest - 4, // 24: v1.Workflows.Update:input_type -> v1.WorkflowUpdateRequest - 8, // 25: v1.Workflows.List:input_type -> v1.WorkflowListRequest - 1, // 26: v1.Workflows.Create:output_type -> v1.WorkflowCreateResponse - 3, // 27: v1.Workflows.Get:output_type -> v1.WorkflowGetResponse - 7, // 28: v1.Workflows.Delete:output_type -> v1.WorkflowDeleteResponse - 5, // 29: v1.Workflows.Update:output_type -> v1.WorkflowUpdateResponse - 9, // 30: v1.Workflows.List:output_type -> v1.WorkflowListResponse - 26, // [26:31] is the sub-list for method output_type - 21, // [21:26] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 22, // 21: v1.Workflow.access_request_max_duration:type_name -> google.protobuf.Duration + 22, // 22: v1.Workflow.access_request_fixed_duration:type_name -> google.protobuf.Duration + 0, // 23: v1.Workflows.Create:input_type -> v1.WorkflowCreateRequest + 2, // 24: v1.Workflows.Get:input_type -> v1.WorkflowGetRequest + 6, // 25: v1.Workflows.Delete:input_type -> v1.WorkflowDeleteRequest + 4, // 26: v1.Workflows.Update:input_type -> v1.WorkflowUpdateRequest + 8, // 27: v1.Workflows.List:input_type -> v1.WorkflowListRequest + 1, // 28: v1.Workflows.Create:output_type -> v1.WorkflowCreateResponse + 3, // 29: v1.Workflows.Get:output_type -> v1.WorkflowGetResponse + 7, // 30: v1.Workflows.Delete:output_type -> v1.WorkflowDeleteResponse + 5, // 31: v1.Workflows.Update:output_type -> v1.WorkflowUpdateResponse + 9, // 32: v1.Workflows.List:output_type -> v1.WorkflowListResponse + 28, // [28:33] is the sub-list for method output_type + 23, // [23:28] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_workflows_proto_init() } diff --git a/models.go b/models.go index 928d826..b316943 100644 --- a/models.go +++ b/models.go @@ -11173,6 +11173,12 @@ type VaultTokenStore struct { // the users that can request that access, and the mechanism for approving those requests which can either // but automatic approval or a set of users authorized to approve the requests. type Workflow struct { + // Fixed Duration of access requests bound to this workflow. If fixed duration is provided, max duration must be empty. + // If neither max nor fixed duration are provided, requests that bind to this workflow will use the organization-level settings. + AccessRequestFixedDuration time.Duration `json:"accessRequestFixedDuration"` + // Maximum Duration of access requests bound to this workflow. If max duration is provided, fixed duration must be empty. + // If neither max nor fixed duration are provided, requests that bind to this workflow will use the organization-level settings. + AccessRequestMaxDuration time.Duration `json:"accessRequestMaxDuration"` // AccessRules is a list of access rules defining the resources this Workflow provides access to. AccessRules AccessRules `json:"accessRules"` // Optional approval flow ID identifies an approval flow that linked to the workflow diff --git a/plumbing.go b/plumbing.go index 1405220..0b9223b 100644 --- a/plumbing.go +++ b/plumbing.go @@ -17081,6 +17081,16 @@ func convertWorkflowToPorcelain(plumbing *proto.Workflow) (*Workflow, error) { return nil, nil } porcelain := &Workflow{} + if v, err := convertDurationToPorcelain(plumbing.AccessRequestFixedDuration); err != nil { + return nil, fmt.Errorf("error converting field AccessRequestFixedDuration: %v", err) + } else { + porcelain.AccessRequestFixedDuration = v + } + if v, err := convertDurationToPorcelain(plumbing.AccessRequestMaxDuration); err != nil { + return nil, fmt.Errorf("error converting field AccessRequestMaxDuration: %v", err) + } else { + porcelain.AccessRequestMaxDuration = v + } if v, err := convertAccessRulesToPorcelain(plumbing.AccessRules); err != nil { return nil, fmt.Errorf("error converting field AccessRules: %v", err) } else { @@ -17101,6 +17111,8 @@ func convertWorkflowToPlumbing(porcelain *Workflow) *proto.Workflow { return nil } plumbing := &proto.Workflow{} + plumbing.AccessRequestFixedDuration = convertDurationToPlumbing(porcelain.AccessRequestFixedDuration) + plumbing.AccessRequestMaxDuration = convertDurationToPlumbing(porcelain.AccessRequestMaxDuration) plumbing.AccessRules = convertAccessRulesToPlumbing(porcelain.AccessRules) plumbing.ApprovalFlowId = (porcelain.ApprovalFlowID) plumbing.AutoGrant = (porcelain.AutoGrant)