Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ on:

env:
GO_MODULE: github.com/finleap-connect/monoskope
GO_VERSION: 1.19.x
GO_VERSION: 1.24.x
GINKGO_VERSION: v1.16.5
GO_CI_LINT_VERSION: v1.48.0
GO_CI_LINT_VERSION: v1.64.8

jobs:
lint:
Expand Down
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
issues:
exclude-rules:
- path: 'internal/eventstore/backup/s3/.*\.go'
linters:
- staticcheck
text: 'SA1019:'
- path: 'pkg/util/crypto\.go|internal/gateway/auth_server\.go'
linters:
- staticcheck
text: 'SA1019:'
4 changes: 2 additions & 2 deletions build/package/go.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.19-buster AS builder
FROM golang:1.24-bullseye AS builder

ARG VERSION
ARG GO_MODULE
Expand All @@ -22,7 +22,7 @@ ARG NAME

WORKDIR /workdir

ENV GRPC_HEALTH_PROBE_VERSION=v0.3.5
ENV GRPC_HEALTH_PROBE_VERSION=v0.3.44
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
Expand Down
31 changes: 9 additions & 22 deletions cmd/commandhandler/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
es "github.com/finleap-connect/monoskope/pkg/eventsourcing"
"github.com/google/uuid"
"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/renderer"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -49,31 +50,17 @@ func NewReportCommands() *cobra.Command {
})
}

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Command", "Aggregate"})

var opts []tablewriter.Option
if formatMarkdown {
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetAutoMergeCellsByColumnIndex([]int{0})
table.SetCenterSeparator("|")
} else {
table.SetAutoWrapText(false)
table.SetAutoFormatHeaders(true)
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
table.SetAlignment(tablewriter.ALIGN_LEFT)
table.SetCenterSeparator("")
table.SetColumnSeparator("")
table.SetRowSeparator("")
table.SetHeaderLine(false)
table.SetBorder(false)
table.SetTablePadding("\t") // pad with tabs
table.SetNoWhiteSpace(true)
opts = append(opts, tablewriter.WithRenderer(renderer.NewMarkdown()))
}
table := tablewriter.NewTable(os.Stdout, opts...)
table.Header([]string{"Command", "Aggregate"})

table.AppendBulk(data) // Add Bulk Data
table.Render()

return nil
if err := table.Bulk(data); err != nil {
return err
}
return table.Render()
},
}

Expand Down
33 changes: 28 additions & 5 deletions cmd/scimserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,25 @@ var serveCmd = &cobra.Command{

// Create CommandHandler client
log.Info("Connecting command handler...", "commandHandlerAddr", commandHandlerAddr)
conn, commandHandlerClient, err := grpcUtil.NewClientWithAuthForward(ctx, commandHandlerAddr, false, commandHandlerApi.NewCommandHandlerClient)
conn, commandHandlerClient, err := grpcUtil.NewClientWithAuthForward(
ctx,
commandHandlerAddr,
false,
commandHandlerApi.NewCommandHandlerClient,
)
if err != nil {
return err
}
defer util.PanicOnErrorFunc(conn.Close)

// Create User client
log.Info("Connecting queryhandler...", "queryHandlerAddr", queryHandlerAddr)
conn, userClient, err := grpcUtil.NewClientWithAuthForward(ctx, queryHandlerAddr, false, domainApi.NewUserClient)
conn, userClient, err := grpcUtil.NewClientWithAuthForward(
ctx,
queryHandlerAddr,
false,
domainApi.NewUserClient,
)
if err != nil {
return err
}
Expand Down Expand Up @@ -99,7 +109,10 @@ var serveCmd = &cobra.Command{
providerConfig := scimserver.NewProvierConfig()
userHandler := scimserver.NewUserHandler(commandHandlerClient, userClient)
groupHandler := scimserver.NewGroupHandler(commandHandlerClient, userClient)
scimServer := scimserver.NewServer(providerConfig, userHandler, groupHandler)
scimServer, err := scimserver.NewServer(&providerConfig, userHandler, groupHandler)
if err != nil {
return err
}

// Start routine waiting for signals
shutdown.RegisterSignalHandler(func() {
Expand Down Expand Up @@ -139,6 +152,16 @@ func init() {
flags := serveCmd.Flags()
flags.StringVar(&httpApiAddr, "http-api-addr", ":8081", "Address the HTTP service will listen on")
flags.StringVar(&healthApiAddr, "health-api-addr", ":8082", "Address the health check HTTP service will listen on")
flags.StringVar(&commandHandlerAddr, "command-handler-api-addr", ":8081", "Address the command handler gRPC service is listening on")
flags.StringVar(&queryHandlerAddr, "query-handler-api-addr", ":8082", "Address the query handler gRPC service is listening on")
flags.StringVar(
&commandHandlerAddr,
"command-handler-api-addr",
":8081",
"Address the command handler gRPC service is listening on",
)
flags.StringVar(
&queryHandlerAddr,
"query-handler-api-addr",
":8082",
"Address the query handler gRPC service is listening on",
)
}
Loading
Loading