Skip to content

Commit

Permalink
Merge pull request #24962 from hashicorp/cm/gosdkandsecurityinsights
Browse files Browse the repository at this point in the history
dependencies: updating to v0.20240221.1115631 of `github.com/hashicorp/go-azure-sdk`
  • Loading branch information
tombuildsstuff authored Feb 21, 2024
2 parents 2a9f190 + a1555d3 commit 9c484e4
Show file tree
Hide file tree
Showing 66 changed files with 2,198 additions and 2,448 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/hashicorp/go-azure-helpers v0.66.2
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240215.1143935
github.com/hashicorp/go-azure-sdk/sdk v0.20240215.1143935
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240221.1115631
github.com/hashicorp/go-azure-sdk/sdk v0.20240221.1115631
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8=
github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240215.1143935 h1:rufxR7o/AnJQucLw47oqtdw0UbNnpWdjcsroJsN8V9I=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240215.1143935/go.mod h1:saOOXx1YASVFR5DfKM4n68uZ/uwPiBplUQ12OWHTnbo=
github.com/hashicorp/go-azure-sdk/sdk v0.20240215.1143935 h1:OIW0aLPuhNqPyJ6tI4DDBQQ3KNr1WbOFsK37yA9xvAU=
github.com/hashicorp/go-azure-sdk/sdk v0.20240215.1143935/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240221.1115631 h1:nM+0h0memx/mqxIIgVmYkdK8/VDZNwvrCxppidYy//4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240221.1115631/go.mod h1:UgGZbK/8d+Sqmfl9nSvCmkMXbMk+frFFgDVoXb4fxDU=
github.com/hashicorp/go-azure-sdk/sdk v0.20240221.1115631 h1:IqPkXzVt3wRFmsPRUWBOZTik23iyE5N2d5wRLbyuOIU=
github.com/hashicorp/go-azure-sdk/sdk v0.20240221.1115631/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
return fmt.Errorf("building clients for Search: %+v", err)
}
client.SecurityCenter = securityCenter.NewClient(o)
client.Sentinel = sentinel.NewClient(o)
if client.Sentinel, err = sentinel.NewClient(o); err != nil {
return fmt.Errorf("building clients for Sentinel: %+v", err)
}
if client.ServiceBus, err = serviceBus.NewClient(o); err != nil {
return fmt.Errorf("building clients for ServiceBus: %+v", err)
}
Expand Down
60 changes: 40 additions & 20 deletions internal/services/sentinel/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package client

import (
"fmt"

alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck
"github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/alertrules"
"github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/automationrules"
Expand All @@ -28,47 +30,65 @@ type Client struct {
MetadataClient *metadata.MetadataClient
}

func NewClient(o *common.ClientOptions) *Client {
alertRulesClient := alertrules.NewAlertRulesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&alertRulesClient.Client, o.ResourceManagerAuthorizer)
func NewClient(o *common.ClientOptions) (*Client, error) {
alertRulesClient, err := alertrules.NewAlertRulesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Alert Rules Client: %+v", err)
}
o.Configure(alertRulesClient.Client, o.Authorizers.ResourceManager)

alertRuleTemplatesClient := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&alertRuleTemplatesClient.Client, o.ResourceManagerAuthorizer)

automationRulesClient := automationrules.NewAutomationRulesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&automationRulesClient.Client, o.ResourceManagerAuthorizer)
automationRulesClient, err := automationrules.NewAutomationRulesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Automation Rules Client: %+v", err)
}
o.Configure(automationRulesClient.Client, o.Authorizers.ResourceManager)

dataConnectorsClient := securityinsight.NewDataConnectorsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&dataConnectorsClient.Client, o.ResourceManagerAuthorizer)

watchListsClient := watchlists.NewWatchlistsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&watchListsClient.Client, o.ResourceManagerAuthorizer)
watchListsClient, err := watchlists.NewWatchlistsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Watch Lists Client: %+v", err)
}
o.Configure(watchListsClient.Client, o.Authorizers.ResourceManager)

watchListItemsClient := watchlistitems.NewWatchlistItemsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&watchListItemsClient.Client, o.ResourceManagerAuthorizer)
watchListItemsClient, err := watchlistitems.NewWatchlistItemsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Watch Lists Items Client: %+v", err)
}
o.Configure(watchListItemsClient.Client, o.Authorizers.ResourceManager)

onboardingStatesClient := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&onboardingStatesClient.Client, o.ResourceManagerAuthorizer)
onboardingStatesClient, err := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Onboarding States Client: %+v", err)
}
o.Configure(onboardingStatesClient.Client, o.Authorizers.ResourceManager)

analyticsSettingsClient := securityinsight.NewSecurityMLAnalyticsSettingsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&analyticsSettingsClient.Client, o.ResourceManagerAuthorizer)

threatIntelligenceClient := securityinsight.NewThreatIntelligenceIndicatorClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&threatIntelligenceClient.Client, o.ResourceManagerAuthorizer)

metadataClient := metadata.NewMetadataClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&metadataClient.Client, o.ResourceManagerAuthorizer)
metadataClient, err := metadata.NewMetadataClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Metadata Client: %+v", err)
}
o.Configure(metadataClient.Client, o.Authorizers.ResourceManager)

return &Client{
AlertRulesClient: &alertRulesClient,
AlertRulesClient: alertRulesClient,
AlertRuleTemplatesClient: &alertRuleTemplatesClient,
AutomationRulesClient: &automationRulesClient,
AutomationRulesClient: automationRulesClient,
DataConnectorsClient: &dataConnectorsClient,
WatchlistsClient: &watchListsClient,
WatchlistItemsClient: &watchListItemsClient,
OnboardingStatesClient: &onboardingStatesClient,
WatchlistsClient: watchListsClient,
WatchlistItemsClient: watchListItemsClient,
OnboardingStatesClient: onboardingStatesClient,
AnalyticsSettingsClient: &analyticsSettingsClient,
ThreatIntelligenceClient: &threatIntelligenceClient,
MetadataClient: &metadataClient,
}
MetadataClient: metadataClient,
}, nil
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c484e4

Please sign in to comment.