-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rg
and query
modes add new option: --include-role-assignment
& …
…`query` mode add new option `--include-resource-group` (#468)
- Loading branch information
Showing
8 changed files
with
128 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package meta | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/magodo/azlist/azlist" | ||
) | ||
|
||
type extBuilder struct { | ||
includeRoleAssignment bool | ||
} | ||
|
||
func (b extBuilder) Build() []azlist.ExtensionResource { | ||
var el []azlist.ExtensionResource | ||
if b.includeRoleAssignment { | ||
el = append(el, azlist.ExtensionResource{ | ||
Type: "Microsoft.Authorization/roleAssignments", | ||
Filter: func(res, extensionRes map[string]interface{}) bool { | ||
idRaw, ok := res["id"] | ||
if !ok { | ||
return false | ||
} | ||
id := idRaw.(string) | ||
|
||
propsRaw, ok := extensionRes["properties"] | ||
if !ok { | ||
return false | ||
} | ||
scopeRaw, ok := propsRaw.(map[string]interface{})["scope"] | ||
if !ok { | ||
return false | ||
} | ||
scope := scopeRaw.(string) | ||
|
||
return strings.EqualFold(id, scope) | ||
}, | ||
}) | ||
} | ||
|
||
return el | ||
} |
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