Skip to content

Commit

Permalink
Change groupTypes to an array.
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <preslav@mondoo.com>
  • Loading branch information
preslavgerchev committed May 15, 2024
1 parent 78d3b0c commit 1b38ea7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions providers/ms365/resources/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package resources
import (
"context"
"errors"
"strings"

"github.com/microsoftgraph/msgraph-sdk-go/groups"
"github.com/microsoftgraph/msgraph-sdk-go/models"

"go.mondoo.com/cnquery/v11/llx"
"go.mondoo.com/cnquery/v11/providers/ms365/connection"
"go.mondoo.com/cnquery/v11/types"
)

func (m *mqlMicrosoftGroup) id() (string, error) {
Expand Down Expand Up @@ -47,7 +47,6 @@ func (a *mqlMicrosoft) groups() ([]interface{}, error) {
}
res := []interface{}{}
for _, grp := range grps {
joinedGroupTypes := strings.Join(grp.GetGroupTypes(), ", ")
graphGrp, err := CreateResource(a.MqlRuntime, "microsoft.group",
map[string]*llx.RawData{
"id": llx.StringDataPtr(grp.GetId()),
Expand All @@ -57,8 +56,7 @@ func (a *mqlMicrosoft) groups() ([]interface{}, error) {
"mailNickname": llx.StringDataPtr(grp.GetMailNickname()),
"securityEnabled": llx.BoolDataPtr(grp.GetSecurityEnabled()),
"visibility": llx.StringDataPtr(grp.GetVisibility()),
// "groupTypes": llx.ArrayData(groupTypes, types.String), This cannot be used
"groupTypes": llx.StringDataPtr(&joinedGroupTypes),
"groupTypes": llx.ArrayData(llx.TArr2Raw(grp.GetGroupTypes()), types.String),
})
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion providers/ms365/resources/ms365.lr
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private microsoft.group @defaults("id displayName") {
// List of group members
members() []microsoft.user
// Group types indicating the membership and classification of the group
groupTypes string
groupTypes []string
}

// Microsoft domain
Expand Down
8 changes: 4 additions & 4 deletions providers/ms365/resources/ms365.lr.go

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

0 comments on commit 1b38ea7

Please sign in to comment.