Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #88 from asecurityteam/update-runhttp
Browse files Browse the repository at this point in the history
Update runhttp to v0.6.0
  • Loading branch information
willyjfarrell authored Apr 21, 2023
2 parents 1305dd2 + 87e1675 commit e273069
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 52 deletions.
29 changes: 8 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
TAG := $(shell git rev-parse --short HEAD)
DIR := $(shell pwd -L)
SDCLI=asecurityteam/sdcli:v1.2.3
SDCLI_VERSION := v1.4.0
SDCLI=docker run --rm -v "$(DIR):$(DIR)" -w "$(DIR)" asecurityteam/sdcli:$(SDCLI_VERSION)


dep:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
$(SDCLI) go dep
$(SDCLI) go dep

lint:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
$(SDCLI) go lint
$(SDCLI) go lint

test:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
$(SDCLI) go test
$(SDCLI) go test

integration:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
$(SDCLI) go integration
$(SDCLI) go integration

coverage:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
$(SDCLI) go coverage
$(SDCLI) go coverage

doc: ;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"io"
"os"

transportd "github.com/asecurityteam/transportd/pkg"
Expand Down
20 changes: 12 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
module github.com/asecurityteam/transportd

go 1.17
go 1.19

require (
bitbucket.org/atlassian/go-asap v0.0.0-20190921160616-bb88d6193af9
github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2
github.com/asecurityteam/httpstats v0.0.0-20200806153718-d71ff7ed1047
github.com/asecurityteam/logevent v1.6.1
github.com/asecurityteam/runhttp v0.4.2
github.com/asecurityteam/settings v0.4.0
github.com/asecurityteam/runhttp v0.6.0
github.com/asecurityteam/settings v0.7.0
github.com/asecurityteam/transport v1.6.7
github.com/getkin/kin-openapi v0.69.0
github.com/golang/mock v1.6.0
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.2
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb
)

require (
github.com/asecurityteam/component-connstate v0.2.0 // indirect
github.com/asecurityteam/component-expvar v0.2.0 // indirect
github.com/asecurityteam/component-log v0.2.1 // indirect
github.com/asecurityteam/component-shared v0.2.0 // indirect
github.com/asecurityteam/component-signals v0.2.0 // indirect
github.com/asecurityteam/component-stat v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -31,14 +32,17 @@ require (
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/xhandler v0.0.0-20170707052532-1eb70cf1520d // indirect
github.com/rs/xstats v0.0.0-20170813190920-c67367528e16 // indirect
github.com/rs/zerolog v1.15.0 // indirect
github.com/spf13/cast v1.3.0 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
github.com/rs/zerolog v1.29.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
36 changes: 36 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ github.com/asecurityteam/component-expvar v0.2.0 h1:2RItjd4HrWZqOPMHywIF81nCQb+G
github.com/asecurityteam/component-expvar v0.2.0/go.mod h1:yFqRIgLPUZTqKILKlBADrS+BSTw7176zzIJuy26wqz4=
github.com/asecurityteam/component-log v0.2.1 h1:VE/EDM7VXoHwg8PCzl/GQmua2E3hFCcL7qawdO2z74Y=
github.com/asecurityteam/component-log v0.2.1/go.mod h1:kmIPz6LkpDUsw56RxNEeIk3OoA4zPOY2w3a9zC6rRSk=
github.com/asecurityteam/component-shared v0.2.0 h1:HRWRrCyF2baXsuiQR3V15jx0VkEqfROyDsSHQI5K0UY=
github.com/asecurityteam/component-shared v0.2.0/go.mod h1:14QwheHuZeWiOtF8MLFNbvI/h+AnYMJBjLHPgowRwC4=
github.com/asecurityteam/component-signals v0.1.0/go.mod h1:WfBa3Yc5TSqqhDB4aaifDIGx33EGhKuKzhYlKe/aeMk=
github.com/asecurityteam/component-signals v0.2.0 h1:Q8UaEslR3417H4eKkjUJhwsqI3cM03oCO1PG7yevj+c=
github.com/asecurityteam/component-signals v0.2.0/go.mod h1:1x9vUrcFSkNrJv0SyJDRB6iv79snzofI1vVX0sbjGtI=
Expand All @@ -25,14 +27,19 @@ github.com/asecurityteam/logevent v1.6.1 h1:D/V11UxgZMBrktTgL3ugRO4hKdBWkz/xLBlp
github.com/asecurityteam/logevent v1.6.1/go.mod h1:wtopE0Pe+072poxy+lGBMah604Uu6/BVwFWRwKwF3TA=
github.com/asecurityteam/runhttp v0.4.2 h1:AxQkvOdske1Bb9ALsvCrrfWeXps/CZOgv/V1uq/a1vg=
github.com/asecurityteam/runhttp v0.4.2/go.mod h1:KPO2M4hcyURAx3hnfFswrWksV6/ixHD96a6OKQSp4E8=
github.com/asecurityteam/runhttp v0.6.0 h1:+1yByZZeiJBvNiEjKchX6JCGwqRfHTgQ17tHlashGaI=
github.com/asecurityteam/runhttp v0.6.0/go.mod h1:FjXUo4iIwJPGAhg8qEGVvnk/MVeo++gnh8ctTycPf88=
github.com/asecurityteam/settings v0.1.0/go.mod h1:Wb6bajm1AgHtjLP8ecv7RqUTCX1hvrIhgX4sF3Ras8c=
github.com/asecurityteam/settings v0.4.0 h1:L7fK4WqkvnvglBrfLBgp77LUDR2cxfSNWGFex7lrMK0=
github.com/asecurityteam/settings v0.4.0/go.mod h1:frhlF5kT7WvdiRX3eQlCOjSppbYUfxxjM9xKTvYjcGo=
github.com/asecurityteam/settings v0.7.0 h1:HsTjBjrWjj1FslfVhgQ9JYOTvA/8Xi6fpA3haw7yLIE=
github.com/asecurityteam/settings v0.7.0/go.mod h1:NPYY/raUkF0tDC1az7IpEu7KUt//RFPDUnyZ3QTpmvs=
github.com/asecurityteam/transport v1.6.5 h1:87W10yu/9k1ElLAGq0ieJUICY1ZDf6cnqBkU2p4xJ+A=
github.com/asecurityteam/transport v1.6.5/go.mod h1:d9ISBYCWrAcVrF+2P5lK7ZVDRtC1waoKG1R5HM+QlDA=
github.com/asecurityteam/transport v1.6.7 h1:gXe8ZnSrJRvC8cTQJEKSc0ZHCAs3+qGqPn6X4Cx/+1g=
github.com/asecurityteam/transport v1.6.7/go.mod h1:M/fUeYyqIQwDv9AV2v372IBnsumivy1uBF3/OAI5jbk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -50,6 +57,7 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/mock v0.0.0-20190508161146-9fa652df1129/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
Expand All @@ -69,7 +77,15 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
Expand All @@ -79,25 +95,36 @@ github.com/rs/xhandler v0.0.0-20170707052532-1eb70cf1520d h1:8Tt7DYYdFqLlOIuyiE0
github.com/rs/xhandler v0.0.0-20170707052532-1eb70cf1520d/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ=
github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/xlog v0.0.0-20171227185259-131980fab91b h1:65vbRzwfvVUk63GnEiBy1lsY40FLZQev13NK+LnyHAE=
github.com/rs/xlog v0.0.0-20171227185259-131980fab91b/go.mod h1:PJ0wmxt3GdhZAbIT0S8HQXsHuLt11tPiF8bUKXUV77w=
github.com/rs/xstats v0.0.0-20170813190920-c67367528e16 h1:m0aigb++JZXs+tzTO60LOOKSOXWyr7scDxlaSvU6HN8=
github.com/rs/xstats v0.0.0-20170813190920-c67367528e16/go.mod h1:5Cg6M3g+Dp4RSFNYBtjJxxjksZc00LbESra5Sz6fGSU=
github.com/rs/zerolog v1.15.0 h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb h1:lyL3z7vYwTWXf4/bI+A01+cCSnfhKIBhy+SQ46Z/ml8=
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand All @@ -114,13 +141,20 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -144,3 +178,5 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"os"

transportd "github.com/asecurityteam/transportd/pkg"
Expand Down Expand Up @@ -41,7 +40,7 @@ func main() {
}
var errRead error
if fileName != "" {
fileContent, errRead = ioutil.ReadFile(fileName)
fileContent, errRead = os.ReadFile(fileName)
if errRead != nil {
panic(errRead)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/components/accesslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"io"
"io/ioutil"
"net"
"net/http"
"strconv"
Expand Down Expand Up @@ -78,7 +77,7 @@ func (c *loggingTransport) RoundTrip(r *http.Request) (*http.Response, error) {
runhttp.LoggerFromContext(r.Context()).Error(err)
}
a.Message = string(respData)
resp.Body = ioutil.NopCloser(bytes.NewBuffer(respData))
resp.Body = io.NopCloser(bytes.NewBuffer(respData))
}
} else {
a.Status = transportd.ErrorToStatusCode(e)
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package components
import (
"bytes"
"encoding/json"
"io/ioutil"
"io"
"net/http"
)

Expand All @@ -26,6 +26,6 @@ func newError(code int, reason string) *http.Response {
Status: http.StatusText(code),
StatusCode: code,
Header: http.Header{"Content-Type": []string{"application/json"}},
Body: ioutil.NopCloser(bytes.NewReader(b)),
Body: io.NopCloser(bytes.NewReader(b)),
}
}
4 changes: 3 additions & 1 deletion pkg/components/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ func (*ResponseHeaderComponent) New(_ context.Context, conf *ResponseHeaderConfi
}

ch := make(transport.Chain, 0, length)
for headerName, headerValues := range conf.Headers {
var headerName string
var headerValues []string
for headerName, headerValues = range conf.Headers {
for _, headerValue := range headerValues {
ch = append(ch, makeResponseDecorator(headerName, headerValue))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package components
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -56,7 +56,7 @@ func TestResponseHeaderInjection(t *testing.T) {
"One": []string{"NOT A"},
"Four": []string{"d"},
},
Body: ioutil.NopCloser(bytes.NewReader([]byte(""))),
Body: io.NopCloser(bytes.NewReader([]byte(""))),
}

rt.EXPECT().RoundTrip(gomock.Any()).Return(mockResponse, nil)
Expand Down
7 changes: 3 additions & 4 deletions pkg/components/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"compress/gzip"
"context"
"io"
"io/ioutil"
"net/http"

transportd "github.com/asecurityteam/transportd/pkg"
Expand Down Expand Up @@ -76,11 +75,11 @@ func (r *outputValidatingTransport) RoundTrip(req *http.Request) (*http.Response
}
// restore the old path just in case something else modified it from the path in the specification
req.URL.Path = originalPath
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
resp.Body = ioutil.NopCloser(bytes.NewReader(body))
resp.Body = io.NopCloser(bytes.NewReader(body))

route := transportd.RouteFromContext(req.Context())
params := transportd.PathParamsFromContext(req.Context())
Expand All @@ -102,7 +101,7 @@ func (r *outputValidatingTransport) RoundTrip(req *http.Request) (*http.Response
}
defer reader.Close()
default:
reader = ioutil.NopCloser(bytes.NewReader(body))
reader = io.NopCloser(bytes.NewReader(body))
}
input := &openapi3filter.ResponseValidationInput{
RequestValidationInput: reqInput,
Expand Down
14 changes: 7 additions & 7 deletions pkg/components/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -140,7 +140,7 @@ func TestValidateResponse(t *testing.T) {
_, err := zw.Write([]byte(body))
assert.Nil(t, err)
assert.Nil(t, zw.Close())
compressedBody, err := ioutil.ReadAll(&buf)
compressedBody, err := io.ReadAll(&buf)
assert.Nil(t, err)

tests := []struct {
Expand All @@ -156,7 +156,7 @@ func TestValidateResponse(t *testing.T) {
StatusCode: http.StatusOK,
Status: "200 OK",
Header: http.Header{"Content-Type": []string{"application/json"}},
Body: ioutil.NopCloser(bytes.NewBufferString(body)),
Body: io.NopCloser(bytes.NewBufferString(body)),
},
responseErr: nil,
expectedErr: false,
Expand All @@ -167,7 +167,7 @@ func TestValidateResponse(t *testing.T) {
response: &http.Response{
StatusCode: http.StatusOK,
Status: "200 OK",
Body: ioutil.NopCloser(bytes.NewBufferString(body)),
Body: io.NopCloser(bytes.NewBufferString(body)),
},
responseErr: nil,
expectedErr: false,
Expand All @@ -182,7 +182,7 @@ func TestValidateResponse(t *testing.T) {
"Content-Type": []string{"application/json"},
"Content-Encoding": []string{"gzip"},
},
Body: ioutil.NopCloser(bytes.NewReader(compressedBody)),
Body: io.NopCloser(bytes.NewReader(compressedBody)),
},
responseErr: nil,
expectedErr: false,
Expand All @@ -196,7 +196,7 @@ func TestValidateResponse(t *testing.T) {
Header: http.Header{
"Content-Type": []string{"application/json"},
},
Body: ioutil.NopCloser(bytes.NewReader(compressedBody)),
Body: io.NopCloser(bytes.NewReader(compressedBody)),
},
responseErr: nil,
expectedErr: false,
Expand All @@ -211,7 +211,7 @@ func TestValidateResponse(t *testing.T) {
"Content-Type": []string{"application/json"},
"Content-Encoding": []string{"gzip"},
},
Body: ioutil.NopCloser(bytes.NewBufferString(body)),
Body: io.NopCloser(bytes.NewBufferString(body)),
},
responseErr: nil,
expectedErr: true,
Expand Down
Loading

0 comments on commit e273069

Please sign in to comment.