Skip to content

Commit

Permalink
Reverted the env and main.go files
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed May 7, 2024
1 parent a783c1b commit 6a57f3a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const (
svcName = "http_adapter"
envPrefixHTTP = "MG_HTTP_ADAPTER_"
envPrefix = "MG_HTTP_ADAPTER_"
envPrefixAuthz = "MG_THINGS_AUTH_GRPC_"
defSvcHTTPPort = "80"
targetHTTPPort = "81"
Expand Down Expand Up @@ -79,7 +79,7 @@ func main() {
}

httpServerConfig := server.Config{Port: defSvcHTTPPort}
if err := env.ParseWithOptions(&httpServerConfig, env.Options{Prefix: envPrefixHTTP}); err != nil {
if err := env.ParseWithOptions(&httpServerConfig, env.Options{Prefix: envPrefix}); err != nil {
logger.Error(fmt.Sprintf("failed to load %s HTTP server configuration : %s", svcName, err))
exitCode = 1
return
Expand Down Expand Up @@ -161,7 +161,7 @@ func newService(pub messaging.Publisher, tc magistrala.AuthzServiceClient, logge
}

func proxyHTTP(ctx context.Context, cfg server.Config, logger *slog.Logger, sessionHandler session.Handler) error {
httpConfig, err := mproxy.NewConfig(env.Options{Prefix: envPrefixHTTP})
httpConfig, err := mproxy.NewConfig(env.Options{Prefix: envPrefix})
if err != nil {
return (err)
}
Expand Down
2 changes: 0 additions & 2 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ MG_THINGS_AUTH_GRPC_PORT=7000
MG_THINGS_AUTH_GRPC_SERVER_CERT=${GRPC_MTLS:+./ssl/certs/things-grpc-server.crt}${GRPC_TLS:+./ssl/certs/things-grpc-server.crt}
MG_THINGS_AUTH_GRPC_SERVER_KEY=${GRPC_MTLS:+./ssl/certs/things-grpc-server.key}${GRPC_TLS:+./ssl/certs/things-grpc-server.key}
MG_THINGS_AUTH_GRPC_SERVER_CA_CERTS=${GRPC_MTLS:+./ssl/certs/ca.crt}${GRPC_TLS:+./ssl/certs/ca.crt}
MG_THINGS_AUTH_GRPC_ADDRESS=test:7000
MG_THINGS_AUTH_GRPC_PREFIX=test
MG_THINGS_CACHE_URL=redis://things-redis:${MG_REDIS_TCP_PORT}/0
MG_THINGS_DB_HOST=things-db
MG_THINGS_DB_PORT=5432
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.2
require (
github.com/0x6flab/namegenerator v1.3.1
github.com/absmach/callhome v0.14.0
github.com/absmach/mproxy v0.4.3-0.20240430090627-27dad4c91c6c
github.com/absmach/mproxy v0.4.3-0.20240506153527-d8b18368068d
github.com/absmach/senml v1.0.5
github.com/authzed/authzed-go v0.11.1
github.com/authzed/grpcutil v0.0.0-20240123194739-2ea1e3d2d98b
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/absmach/callhome v0.14.0 h1:zB4tIZJ1YUmZ1VGHFPfMA/Lo6/Mv19y2dvoOiXj2B
github.com/absmach/callhome v0.14.0/go.mod h1:l12UJOfibK4Muvg/AbupHuquNV9qSz/ROdTEPg7f2Vk=
github.com/absmach/mproxy v0.4.3-0.20240430090627-27dad4c91c6c h1:wGtfVk3knDUsrUoyOxfyDPK3lJB6Yc6BMePf62UaTOo=
github.com/absmach/mproxy v0.4.3-0.20240430090627-27dad4c91c6c/go.mod h1:Nevip6o8u5Zx7l3LTtN8BwlCI5h5KpsnI9YnAxF5RT8=
github.com/absmach/mproxy v0.4.3-0.20240506153527-d8b18368068d h1:Y88FgK//LNFyVp5ZSdg16W+msMtOxAz45lQGeKGDSbU=
github.com/absmach/mproxy v0.4.3-0.20240506153527-d8b18368068d/go.mod h1:Nevip6o8u5Zx7l3LTtN8BwlCI5h5KpsnI9YnAxF5RT8=
github.com/absmach/senml v1.0.5 h1:zNPRYpGr2Wsb8brAusz8DIfFqemy1a2dNbmMnegY3GE=
github.com/absmach/senml v1.0.5/go.mod h1:NDEjk3O4V4YYu9Bs2/+t/AZ/F+0wu05ikgecp+/FsSU=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
Expand Down

0 comments on commit 6a57f3a

Please sign in to comment.