Skip to content

Commit

Permalink
base path swagger configuration based on tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-cronus committed Aug 30, 2024
1 parent f73ec73 commit 404695b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmd/eskimo-hut:
host: localhost:1443
version: local
defaultEndpointTimeout: 120s
tenant: sunwaves
#tenant: sunwaves
httpServer:
port: 1443
certPath: cmd/eskimo-hut/.testdata/localhost.crt
Expand Down
7 changes: 4 additions & 3 deletions cmd/eskimo-hut/eskimo_hut.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ func main() {
if cfg.APIKey == "" {
log.Panic("'api-key' is missing")
}
swaggerRoot := swaggerRootSuffix
nginxPrefix := ""
if cfg.Tenant != "" {
swaggerRoot = "/" + cfg.Tenant + swaggerRootSuffix
nginxPrefix = "/" + cfg.Tenant
api.SwaggerInfo.BasePath = nginxPrefix
}
server.New(new(service), applicationYamlKey, swaggerRoot).ListenAndServe(ctx, cancel)
server.New(new(service), applicationYamlKey, swaggerRootSuffix, nginxPrefix).ListenAndServe(ctx, cancel)

Check failure on line 48 in cmd/eskimo-hut/eskimo_hut.go

View workflow job for this annotation

GitHub Actions / Lint

too many arguments in call to server.New

Check failure on line 48 in cmd/eskimo-hut/eskimo_hut.go

View workflow job for this annotation

GitHub Actions / Build

too many arguments in call to server.New
}

func (s *service) RegisterRoutes(router *server.Router) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw=
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down

0 comments on commit 404695b

Please sign in to comment.