Skip to content

Commit 8ffd0d0

Browse files
initial commit
Code copied from nais/teams-backend
0 parents  commit 8ffd0d0

29 files changed

+3157
-0
lines changed

.configs/mockery.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
with-expecter: true
2+
disable-version-string: true
3+
inpackage: true
4+
dir: "{{.InterfaceDir}}"
5+
filename: "mock_{{.InterfaceNameSnake}}.go"
6+
packages:
7+
github.com/nais/api-reconcilers/internal/auditlogger:
8+
interfaces:
9+
AuditLogger:
10+
github.com/nais/api-reconcilers/internal/authn:
11+
interfaces:
12+
Handler:
13+
github.com/nais/api-reconcilers/internal/azureclient:
14+
interfaces:
15+
Client:
16+
github.com/nais/api-reconcilers/internal/db:
17+
interfaces:
18+
AuthenticatedUser:
19+
Database:
20+
github.com/nais/api-reconcilers/internal/logger:
21+
interfaces:
22+
Logger:
23+
github.com/nais/api-reconcilers/internal/reconcilers:
24+
interfaces:
25+
Reconciler:
26+
github.com/nais/api-reconcilers/internal/reconcilers/dependencytrack:
27+
interfaces:
28+
Client:
29+
github.com/nais/api-reconcilers/internal/reconcilers/github/team:
30+
interfaces:
31+
TeamsService:
32+
GraphClient:
33+
github.com/nais/api-reconcilers/internal/teamsync:
34+
interfaces:
35+
Queue:
36+
Handler:

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
/bin
8+
9+
# Test binary, built with `go test -c`
10+
*.test
11+
12+
# Output of the go coverage tool, specifically when used with LiteIDE
13+
*.out
14+
15+
# Dependency directories (remove the comment below to include it)
16+
# vendor/
17+
18+
# IDE
19+
.idea
20+
.vscode
21+
.env
22+
/local/
23+
.envrc

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.21.5

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License
2+
3+
Copyright 2023 NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the "Software"),
7+
to deal in the Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom the
10+
Software is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21+
USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: all
2+
3+
all: generate test check fmt build
4+
5+
generate: generate-mocks
6+
7+
generate-mocks:
8+
go run github.com/vektra/mockery/v2 --config ./.configs/mockery.yaml
9+
find internal -type f -name "mock_*.go" -exec go run mvdan.cc/gofumpt -w {} \;
10+
11+
build:
12+
go build -o bin/api-reconcilers ./cmd/api-reconcilers
13+
14+
local:
15+
go run ./cmd/api-reconcilers
16+
17+
test:
18+
go test ./...
19+
20+
check: staticcheck vulncheck deadcode
21+
22+
staticcheck:
23+
go run honnef.co/go/tools/cmd/staticcheck@latest ./...
24+
25+
vulncheck:
26+
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
27+
28+
deadcode:
29+
go run golang.org/x/tools/cmd/deadcode@latest -test ./...
30+
31+
fmt:
32+
go run mvdan.cc/gofumpt@latest -w ./

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# NAIS API reconcilers
2+
3+
More to come.

cmd/api-reconcilers/main.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"context"
5+
6+
"github.com/nais/api-reconcilers/internal/cmd/reconciler"
7+
)
8+
9+
func main() {
10+
ctx := context.Background()
11+
reconciler.Run(ctx)
12+
}

go.mod

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
module github.com/nais/api-reconcilers
2+
3+
go 1.21
4+
5+
toolchain go1.21.5
6+
7+
require (
8+
github.com/go-chi/chi/v5 v5.0.11
9+
github.com/google/uuid v1.5.0
10+
github.com/joho/godotenv v1.5.1
11+
github.com/kelseyhightower/envconfig v1.4.0
12+
github.com/prometheus/client_golang v1.18.0
13+
github.com/sethvargo/go-envconfig v1.0.0
14+
github.com/sirupsen/logrus v1.9.3
15+
github.com/stretchr/testify v1.8.4
16+
github.com/vektra/mockery/v2 v2.32.4
17+
golang.org/x/oauth2 v0.16.0
18+
golang.org/x/sync v0.6.0
19+
google.golang.org/api v0.157.0
20+
mvdan.cc/gofumpt v0.5.0
21+
)
22+
23+
require (
24+
cloud.google.com/go/compute v1.23.3 // indirect
25+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
26+
github.com/beorn7/perks v1.0.1 // indirect
27+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
28+
github.com/chigopher/pathlib v0.15.0 // indirect
29+
github.com/davecgh/go-spew v1.1.1 // indirect
30+
github.com/felixge/httpsnoop v1.0.4 // indirect
31+
github.com/fsnotify/fsnotify v1.6.0 // indirect
32+
github.com/go-logr/logr v1.4.1 // indirect
33+
github.com/go-logr/stdr v1.2.2 // indirect
34+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
35+
github.com/golang/protobuf v1.5.3 // indirect
36+
github.com/google/go-cmp v0.6.0 // indirect
37+
github.com/google/s2a-go v0.1.7 // indirect
38+
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
39+
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
40+
github.com/hashicorp/hcl v1.0.0 // indirect
41+
github.com/iancoleman/strcase v0.3.0 // indirect
42+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
43+
github.com/jinzhu/copier v0.3.5 // indirect
44+
github.com/magiconair/properties v1.8.7 // indirect
45+
github.com/mattn/go-colorable v0.1.13 // indirect
46+
github.com/mattn/go-isatty v0.0.19 // indirect
47+
github.com/mitchellh/go-homedir v1.1.0 // indirect
48+
github.com/mitchellh/mapstructure v1.5.0 // indirect
49+
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
50+
github.com/pmezard/go-difflib v1.0.0 // indirect
51+
github.com/prometheus/client_model v0.5.0 // indirect
52+
github.com/prometheus/common v0.46.0 // indirect
53+
github.com/prometheus/procfs v0.12.0 // indirect
54+
github.com/rs/zerolog v1.30.0 // indirect
55+
github.com/spf13/afero v1.9.5 // indirect
56+
github.com/spf13/cast v1.5.1 // indirect
57+
github.com/spf13/cobra v1.7.0 // indirect
58+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
59+
github.com/spf13/pflag v1.0.5 // indirect
60+
github.com/spf13/viper v1.16.0 // indirect
61+
github.com/stretchr/objx v0.5.1 // indirect
62+
github.com/subosito/gotenv v1.6.0 // indirect
63+
go.opencensus.io v0.24.0 // indirect
64+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
65+
go.opentelemetry.io/otel v1.22.0 // indirect
66+
go.opentelemetry.io/otel/metric v1.22.0 // indirect
67+
go.opentelemetry.io/otel/trace v1.22.0 // indirect
68+
golang.org/x/crypto v0.18.0 // indirect
69+
golang.org/x/mod v0.12.0 // indirect
70+
golang.org/x/net v0.20.0 // indirect
71+
golang.org/x/sys v0.16.0 // indirect
72+
golang.org/x/term v0.16.0 // indirect
73+
golang.org/x/text v0.14.0 // indirect
74+
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 // indirect
75+
google.golang.org/appengine v1.6.8 // indirect
76+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
77+
google.golang.org/grpc v1.60.1 // indirect
78+
google.golang.org/protobuf v1.32.0 // indirect
79+
gopkg.in/ini.v1 v1.67.0 // indirect
80+
gopkg.in/yaml.v2 v2.4.0 // indirect
81+
gopkg.in/yaml.v3 v3.0.1 // indirect
82+
)

0 commit comments

Comments
 (0)