Skip to content

Commit

Permalink
feat: extract validation service
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff committed Jun 29, 2022
1 parent 1947051 commit 956bfb3
Show file tree
Hide file tree
Showing 15 changed files with 1,075 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ updates:
directory: "/backend/pki-service" # Location of package manifests
schedule:
interval: "daily"

- package-ecosystem: "gomod"
directory: "/backend/validation-service" # Location of package manifests
schedule:
interval: "daily"

1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- pki-service
- dns-service
- eab-rest-interface
- validation-interface
- domain-rest-interface
env:
# Use docker.io for Docker Hub if empty
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- backend/dns-service
- backend/domain-rest-interface
- backend/eab-rest-interface
- backend/validation-service
- backend/common
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- backend/dns-service
- backend/domain-rest-interface
- backend/eab-rest-interface
- backend/validation-service
- backend/common
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ backend/domain-rest-interface/domain-rest-interface
backend/pki-service/pki-service
backend/dns-service/dns-service
backend/eab-rest-interface/eab-rest-interface
backend/validation-service/validation-service
**/.idea
**/.env
**/__debug_bin
Expand Down
15 changes: 0 additions & 15 deletions backend/pki-service/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@
"debug"
],
"program": "${workspaceFolder}"
},
{
"name": "Launch Validator",
"type": "go",
"request": "launch",
"mode": "auto",
"args": [
"validate",
"--level",
"debug",
"--dns_service",
"localhost:8081",
"--force"
],
"program": "${workspaceFolder}"
}
]
}
23 changes: 23 additions & 0 deletions backend/validation-service/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Validator",
"type": "go",
"request": "launch",
"mode": "auto",
"args": [
"validate",
"--level",
"debug",
"--dns_service",
"localhost:8081",
"--force"
],
"program": "${workspaceFolder}"
}
]
}
23 changes: 23 additions & 0 deletions backend/validation-service/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import (
"os"

"github.com/spf13/cobra"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "validation-service",
Short: "A microservice for certificate management",
Long: ``,
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"net/http"

"github.com/hm-edu/pki-service/pkg/cfg"
"github.com/hm-edu/pki-service/pkg/worker"
pb "github.com/hm-edu/portal-apis"
"github.com/hm-edu/portal-common/api"
"github.com/hm-edu/portal-common/tracing"
"github.com/hm-edu/sectigo-client/sectigo"
"github.com/hm-edu/validation-service/pkg/cfg"
"github.com/hm-edu/validation-service/pkg/worker"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
Expand All @@ -30,7 +30,7 @@ var validateCmd = &cobra.Command{
logger.Panic("config unmarshal failed", zap.Error(err))
}

tp := tracing.InitTracer(logger, "pki-service")
tp := tracing.InitTracer(logger, "validation-service")

defer func() {
if err := tp.Shutdown(context.Background()); err != nil {
Expand Down
96 changes: 96 additions & 0 deletions backend/validation-service/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
module github.com/hm-edu/validation-service

go 1.18

require (
github.com/hm-edu/sectigo-client v0.0.0-20220629060716-68ec3d6475bb
github.com/spf13/cobra v1.5.0
go.uber.org/zap v1.21.0
)

require (
cloud.google.com/go/compute v1.5.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/getkin/kin-openapi v0.97.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/spec v0.20.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/labstack/echo/v4 v4.7.2 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/ory/viper v1.7.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/stretchr/testify v1.7.5 // indirect
github.com/swaggo/swag v1.8.3 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.30.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.30.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.1.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hm-edu/portal-apis v0.0.0-20220603062428-bf1306b32398
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/sdk v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)

require (
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hm-edu/portal-common v0.0.0-20220628080438-194705149f95
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect
google.golang.org/grpc v1.47.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

require (
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/joho/godotenv v1.4.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opentelemetry.io/otel/metric v0.30.0 // indirect
)

replace github.com/hm-edu/portal-common => ../common
Loading

0 comments on commit 956bfb3

Please sign in to comment.