Skip to content

Commit 33a5b85

Browse files
committed
feat: init swagger
1 parent 6ab9c0a commit 33a5b85

9 files changed

Lines changed: 204 additions & 4 deletions

File tree

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PROD_COMPOSE := $(shell test -f "docker-compose.test.prod.yml" && echo "docker-c
1616

1717
.DEFAULT_GOAL := binary
1818

19-
.PHONY: deps clean-data clean-webui webui binary binary-linux-amd64 binary-linux-arm64 test vet test-race dev dev-infisical prod prod-infisical sql generate docker docker-distroless
19+
.PHONY: deps clean-data clean-webui webui binary binary-linux-amd64 binary-linux-arm64 test vet test-race dev dev-infisical prod prod-infisical sql generate docker docker-distroless swagger
2020

2121
# Deps
2222
deps:
@@ -102,3 +102,7 @@ docker:
102102
# Docker image distroless
103103
docker-distroless:
104104
docker buildx build -t tinyauthapp/tinyauth:dev-distroless --build-arg=VERSION=$(TAG_NAME) --build-arg=COMMIT_HASH=$(COMMIT_HASH) --build-arg=BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) -f Dockerfile.distroless .
105+
106+
# Swagger
107+
swagger:
108+
swag init -d ./internal/bootstrap -g router_bootstrap.go -o ./internal/swagger

frontend/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export default defineConfig({
6262
changeOrigin: true,
6363
rewrite: (path) => path.replace(/^\/authorize/, ""),
6464
},
65+
"/swagger": {
66+
target: "http://tinyauth-backend:3000/swagger",
67+
changeOrigin: true,
68+
rewrite: (path) => path.replace(/^\/swagger/, ""),
69+
}
6570
},
6671
allowedHosts: true,
6772
},

go.mod

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.26.4
44

55
require (
66
charm.land/huh/v2 v2.0.3
7+
charm.land/lipgloss/v2 v2.0.1
78
github.com/cenkalti/backoff/v5 v5.0.3
89
github.com/docker/docker v28.5.2+incompatible
910
github.com/gin-gonic/gin v1.12.0
@@ -19,12 +20,14 @@ require (
1920
github.com/rs/zerolog v1.35.1
2021
github.com/steveiliop56/ding v0.2.0
2122
github.com/stretchr/testify v1.11.1
23+
github.com/swaggo/swag v1.16.6
2224
github.com/tinyauthapp/paerser v0.0.0-20260410140347-85c3740d6298
2325
github.com/weppos/publicsuffix-go v0.50.3
2426
go.uber.org/dig v1.19.0
2527
golang.org/x/crypto v0.53.0
2628
golang.org/x/oauth2 v0.36.0
2729
golang.org/x/tools v0.47.0
30+
gopkg.in/yaml.v3 v3.0.1
2831
k8s.io/apimachinery v0.36.2
2932
k8s.io/client-go v0.36.2
3033
modernc.org/sqlite v1.53.0
@@ -34,11 +37,11 @@ require (
3437
require (
3538
charm.land/bubbles/v2 v2.0.0 // indirect
3639
charm.land/bubbletea/v2 v2.0.2 // indirect
37-
charm.land/lipgloss/v2 v2.0.1 // indirect
3840
dario.cat/mergo v1.0.1 // indirect
3941
filippo.io/edwards25519 v1.2.0 // indirect
4042
github.com/Azure/go-ntlmssp v0.1.1 // indirect
4143
github.com/BurntSushi/toml v1.6.0 // indirect
44+
github.com/KyleBanks/depth v1.2.1 // indirect
4245
github.com/Masterminds/goutils v1.1.1 // indirect
4346
github.com/Masterminds/semver/v3 v3.4.0 // indirect
4447
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
@@ -82,6 +85,10 @@ require (
8285
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 // indirect
8386
github.com/go-logr/logr v1.4.3 // indirect
8487
github.com/go-logr/stdr v1.2.2 // indirect
88+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
89+
github.com/go-openapi/jsonreference v0.20.4 // indirect
90+
github.com/go-openapi/spec v0.20.4 // indirect
91+
github.com/go-openapi/swag v0.23.0 // indirect
8592
github.com/go-playground/locales v0.14.1 // indirect
8693
github.com/go-playground/universal-translator v0.18.1 // indirect
8794
github.com/go-playground/validator/v10 v10.30.1 // indirect
@@ -98,12 +105,14 @@ require (
98105
github.com/jackc/pgpassfile v1.0.0 // indirect
99106
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
100107
github.com/jackc/puddle/v2 v2.2.2 // indirect
108+
github.com/josharian/intern v1.0.0 // indirect
101109
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
102110
github.com/json-iterator/go v1.1.12 // indirect
103111
github.com/klauspost/compress v1.18.5 // indirect
104112
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
105113
github.com/leodido/go-urn v1.4.0 // indirect
106114
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
115+
github.com/mailru/easyjson v0.7.7 // indirect
107116
github.com/mattn/go-colorable v0.1.14 // indirect
108117
github.com/mattn/go-isatty v0.0.20 // indirect
109118
github.com/mattn/go-runewidth v0.0.20 // indirect
@@ -134,6 +143,8 @@ require (
134143
github.com/safchain/ethtool v0.3.0 // indirect
135144
github.com/shopspring/decimal v1.4.0 // indirect
136145
github.com/spf13/cast v1.10.0 // indirect
146+
github.com/swaggo/files v1.0.1 // indirect
147+
github.com/swaggo/gin-swagger v1.6.1 // indirect
137148
github.com/tailscale/certstore v0.1.1-0.20260409135935-3638fb84b77d // indirect
138149
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
139150
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd // indirect
@@ -169,7 +180,6 @@ require (
169180
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
170181
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
171182
gopkg.in/inf.v0 v0.9.1 // indirect
172-
gopkg.in/yaml.v3 v3.0.1 // indirect
173183
gotest.tools/v3 v3.5.2 // indirect
174184
gvisor.dev/gvisor v0.0.0-20260224225140-573d5e7127a8 // indirect
175185
k8s.io/klog/v2 v2.140.0 // indirect

0 commit comments

Comments
 (0)