Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix column access_control inconsistent state in table azure_logic_app_workflow closes #484 #486

Merged
merged 4 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
select name, id, type
from azure.azure_logic_app_workflow
where name = '{{ resourceName }}';
where id = '{{ output.resource_id.value }}';
21 changes: 20 additions & 1 deletion azure/table_azure_logic_app_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func tableAzureLogicAppWorkflow(_ context.Context) *plugin.Table {
Name: "access_control",
Description: "The access control configuration.",
Type: proto.ColumnType_JSON,
Transform: transform.FromField("WorkflowProperties.AccessControl"),
Transform: transform.From(getAccessControl),
},
{
Name: "definition",
Expand Down Expand Up @@ -282,3 +282,22 @@ func listLogicAppWorkflowDiagnosticSettings(ctx context.Context, d *plugin.Query
}
return diagnosticSettings, nil
}

//// TRANSFORM FUNCTION

// Access Control configuration for Any IP is comming as "{}" instead of nill if wea re not providing any IP in configuration
ParthaI marked this conversation as resolved.
Show resolved Hide resolved
func getAccessControl(ctx context.Context, d *transform.TransformData) (interface{}, error) {
data := d.HydrateItem.(logic.Workflow)
if data.WorkflowProperties != nil {
if data.WorkflowProperties.AccessControl == nil {
return nil, nil
} else {
if data.WorkflowProperties.AccessControl.Actions != nil || data.WorkflowProperties.AccessControl.Contents != nil || data.WorkflowProperties.AccessControl.Triggers != nil || data.WorkflowProperties.AccessControl.WorkflowManagement != nil {
return data.WorkflowProperties.AccessControl, nil
} else {
return nil, nil
}
}
}
return data.AccessControl, nil
}