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

Release 1.6 rc.2 #1315

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 13 additions & 12 deletions internal/audit/gql_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hasura/go-graphql-client"
"github.com/sirupsen/logrus"

remoteapi "github.com/kubeshop/botkube/internal/remote"
gqlmodel "github.com/kubeshop/botkube/internal/remote/graphql"
)

var _ AuditReporter = (*GraphQLAuditReporter)(nil)
Expand Down Expand Up @@ -39,16 +39,17 @@ func (r *GraphQLAuditReporter) ReportExecutorAuditEvent(ctx context.Context, e E
} `graphql:"createAuditEvent(input: $input)"`
}
variables := map[string]interface{}{
"input": remoteapi.AuditEventCreateInput{
"input": gqlmodel.AuditEventCreateInput{
CreatedAt: e.CreatedAt,
PluginName: e.PluginName,
DeploymentID: r.gql.DeploymentID(),
Type: remoteapi.AuditEventTypeCommandExecuted,
CommandExecuted: &remoteapi.AuditEventCommandCreateInput{
PlatformUser: e.PlatformUser,
BotPlatform: e.BotPlatform,
Command: e.Command,
Channel: e.Channel,
Type: gqlmodel.AuditEventTypeCommandExecuted,
CommandExecuted: &gqlmodel.AuditEventCommandCreateInput{
PlatformUser: e.PlatformUser,
BotPlatform: e.BotPlatform,
Command: e.Command,
Channel: e.Channel,
AdditionalCreateContext: e.AdditionalCreateContext,
},
},
}
Expand All @@ -65,14 +66,14 @@ func (r *GraphQLAuditReporter) ReportSourceAuditEvent(ctx context.Context, e Sou
} `graphql:"createAuditEvent(input: $input)"`
}
variables := map[string]interface{}{
"input": remoteapi.AuditEventCreateInput{
"input": gqlmodel.AuditEventCreateInput{
CreatedAt: e.CreatedAt,
PluginName: e.PluginName,
DeploymentID: r.gql.DeploymentID(),
Type: remoteapi.AuditEventTypeSourceEventEmitted,
SourceEventEmitted: &remoteapi.AuditEventSourceCreateInput{
Type: gqlmodel.AuditEventTypeSourceEventEmitted,
SourceEventEmitted: &gqlmodel.AuditEventSourceCreateInput{
Event: e.Event,
Source: remoteapi.AuditEventSourceDetailsInput{
Source: &gqlmodel.AuditEventSourceDetailsInput{
Name: e.Source.Name,
DisplayName: e.Source.DisplayName,
},
Expand Down
15 changes: 8 additions & 7 deletions internal/audit/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/sirupsen/logrus"

remoteapi "github.com/kubeshop/botkube/internal/remote"
"github.com/kubeshop/botkube/internal/remote/graphql"
)

// AuditReporter defines interface for reporting audit events
Expand All @@ -16,12 +16,13 @@ type AuditReporter interface {

// ExecutorAuditEvent contains audit event data
type ExecutorAuditEvent struct {
CreatedAt string
PluginName string
PlatformUser string
BotPlatform *remoteapi.BotPlatform
Command string
Channel string
CreatedAt string
PluginName string
PlatformUser string
BotPlatform *graphql.BotPlatform
Command string
Channel string
AdditionalCreateContext map[string]interface{}
}

// SourceAuditEvent contains audit event data
Expand Down
119 changes: 0 additions & 119 deletions internal/remote/api.go

This file was deleted.

20 changes: 20 additions & 0 deletions internal/remote/graphql/connected_platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,24 @@ type OrganizationConnectedPlatforms struct {
OrganizationID string `graphql:"-"`
Slacks []*SlackWorkspace `json:"slacks"`
Slack *SlackWorkspace `json:"slack"`

TeamsOrganizations []*TeamsOrganization `json:"teamsOrganizations"`
TeamsOrganization *TeamsOrganization `json:"teamsOrganization"`
}

type TeamsOrganization struct {
ID string `json:"id"`
TenantID string `json:"tenantId"`
ConsentGiven bool `json:"consentGiven"`
IsReConsentingRequired bool `json:"isReConsentingRequired"`

// All internal, ignored fields are removed
}

type TeamsOrganizationTeam struct {
ID string `json:"id"`
AADGroupID string `json:"aadGroupId"`
DefaultConversationID string `json:"defaultConversationId"`

// All internal, ignored fields are removed
}
Loading
Loading