-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): Output v2 integration state details (#505)
Issue: https://lacework.atlassian.net/browse/ALLY-586 - Fetch state details from V2 api. - Register AlertChannels, CloudAccounts & ContainerRegistries services in Schema Services - Map Schema to Integrations in IntegrationsTypes map Usage ``` ❯ lacework int show <guid> INTEGRATION GUID NAME TYPE STATUS STATE -----------------------------------------------------------+----------------+---------+---------+-------- GUID_11111111111111111111111111111111111111111111111111 project-id-123 GCP_CFG Enabled Ok INTEGRATION DETAILS ----------------------------------------------------------------------------------------------------------- LEVEL PROJECT ORG/PROJECT ID project-id-123 CLIENT ID 111111111111111111111111111 CLIENT EMAIL [email protected] PRIVATE KEY ID 111111111111111111111111111 UPDATED AT 2021-Jun-01 18:03:19 UTC UPDATED BY [email protected] STATE UPDATED AT 2021-Aug-05 13:32:20 UTC LAST SUCCESSFUL STATE 2021-Aug-05 13:32:20 UTC STATE DETAILS { "projectErrors": { "project-id-123": { "opsDeniedAccess": [] } } } ``` Signed-off-by: Darren Murray <[email protected]>
- Loading branch information
1 parent
f5eaf36
commit e2cc6f1
Showing
10 changed files
with
160 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Author:: Darren Murray (<[email protected]>) | ||
// Copyright:: Copyright 2021, Lacework Inc. | ||
// License:: Apache License, Version 2.0 | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package api | ||
|
||
// SchemaService is the service that retrieves schemas for v2 | ||
type SchemasService struct { | ||
client *Client | ||
Services map[integrationSchema]V2Service | ||
} | ||
|
||
type integrationSchema int | ||
|
||
const ( | ||
None integrationSchema = iota | ||
AlertChannels | ||
ContainerRegistries | ||
CloudAccounts | ||
) | ||
|
||
func (svc *SchemasService) GetService(schemaName integrationSchema) V2Service { | ||
return svc.Services[schemaName] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters