From 52cb93a1cab6426622c85f1f2c6f26f538baec17 Mon Sep 17 00:00:00 2001 From: Szabolcs Toth <54896607+tothszabi@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:41:34 +0100 Subject: [PATCH] Update go-xcode (#53) --- go.mod | 16 +-- go.sum | 47 +++---- .../go-steputils/v2/ruby/command.go | 7 + .../go-steputils/v2/ruby/environment.go | 107 +++++++++++---- .../go-steputils/v2/stepconf/stepconf.go | 21 ++- .../go-steputils/v2/stepconf/strings.go | 12 +- .../bitrise-io/go-utils/command/command.go | 4 +- .../go-utils/filedownloader/filedownloader.go | 5 + .../go-utils/parseutil/parseutil.go | 95 ------------- .../bitrise-io/go-utils/pointers/pointers.go | 98 -------------- .../bitrise-io/go-utils/v2/command/command.go | 98 ++++++++++++-- .../go-utils/v2/command/errorcollector.go | 18 +++ .../v2/log/colorstring/colorstring.go | 111 +++++++++++++++ .../bitrise-io/go-utils/v2/log/severity.go | 2 +- .../go-utils/v2/pathutil/pathutil.go | 127 ++++++++++++++++++ .../go-xcode/v2/autocodesign/autocodesign.go | 2 + .../v2/autocodesign/codesignasset/writer.go | 3 +- .../appstoreconnect/appstoreconnect.go | 3 +- .../appstoreconnectclient/auth.go | 15 +++ .../appstoreconnectclient/client.go | 2 + .../devportalclient/devportalclient.go | 10 +- .../devportalclient/spaceship/auth.go | 34 +++++ .../devportalclient/spaceship/certificates.go | 24 ++-- .../devportalclient/spaceship/devices.go | 14 +- .../devportalclient/spaceship/profiles.go | 49 +------ .../devportalclient/spaceship/spaceship.go | 92 ++++++++----- .../spaceship/spaceship/Gemfile.lock | 105 +++++++-------- .../spaceship/spaceship/main.rb | 80 ++++++----- .../spaceship/spaceship/portal/auth_client.rb | 14 +- .../localcodesignasset/profileconverter.go | 4 +- .../v2/autocodesign/mock_DevPortalClient.go | 107 ++++++++++----- .../projectmanager/projecthelper.go | 2 +- .../go-xcode/v2/codesign/codesign.go | 50 ++++--- .../xcodeproject/xcodeproj/schemes.go | 11 +- .../xcodeproject/xcworkspace/file_ref.go | 2 +- .../xcodeproject/xcworkspace/schemes.go | 16 +-- vendor/github.com/golang-jwt/jwt/v4/README.md | 47 ++++--- .../github.com/golang-jwt/jwt/v4/SECURITY.md | 19 +++ vendor/github.com/golang-jwt/jwt/v4/claims.go | 6 +- vendor/github.com/golang-jwt/jwt/v4/parser.go | 7 + .../github.com/golang-jwt/jwt/v4/rsa_pss.go | 1 + vendor/github.com/golang-jwt/jwt/v4/token.go | 21 ++- vendor/github.com/golang-jwt/jwt/v4/types.go | 20 ++- .../hashicorp/go-retryablehttp/CHANGELOG.md | 9 ++ .../hashicorp/go-retryablehttp/CODEOWNERS | 1 + .../hashicorp/go-retryablehttp/LICENSE | 2 + .../hashicorp/go-retryablehttp/README.md | 19 --- .../hashicorp/go-retryablehttp/client.go | 27 +++- .../go-retryablehttp/roundtripper.go | 3 + vendor/github.com/stretchr/objx/README.md | 8 +- vendor/github.com/stretchr/objx/Taskfile.yml | 3 - vendor/github.com/stretchr/objx/accessors.go | 24 ++-- .../github.com/stretchr/objx/conversions.go | 4 +- vendor/github.com/stretchr/objx/doc.go | 44 +++--- vendor/github.com/stretchr/objx/map.go | 9 +- vendor/modules.txt | 28 ++-- 56 files changed, 1053 insertions(+), 656 deletions(-) delete mode 100644 vendor/github.com/bitrise-io/go-utils/parseutil/parseutil.go delete mode 100644 vendor/github.com/bitrise-io/go-utils/pointers/pointers.go create mode 100644 vendor/github.com/bitrise-io/go-utils/v2/command/errorcollector.go create mode 100644 vendor/github.com/bitrise-io/go-utils/v2/log/colorstring/colorstring.go create mode 100644 vendor/github.com/bitrise-io/go-utils/v2/pathutil/pathutil.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/auth.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/auth.go create mode 100644 vendor/github.com/golang-jwt/jwt/v4/SECURITY.md create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS diff --git a/go.mod b/go.mod index 4c74265..9c2583d 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,11 @@ go 1.20 require ( github.com/bitrise-io/go-steputils v1.0.5 - github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2 - github.com/bitrise-io/go-utils v1.0.9 - github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11 - github.com/bitrise-io/go-xcode v1.0.16 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.25 + github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18 + github.com/bitrise-io/go-utils v1.0.12 + github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 + github.com/bitrise-io/go-xcode v1.0.18 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.43 howett.net/plist v1.0.0 ) @@ -21,15 +21,15 @@ require ( github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect - github.com/golang-jwt/jwt/v4 v4.4.1 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect + github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.1 // indirect github.com/stretchr/testify v1.8.4 golang.org/x/text v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index db0319c..8e32a99 100644 --- a/go.sum +++ b/go.sum @@ -2,35 +2,27 @@ github.com/bitrise-io/go-pkcs12 v0.0.0-20230815095624-feb898696e02 h1:DoXD85rP+d github.com/bitrise-io/go-pkcs12 v0.0.0-20230815095624-feb898696e02/go.mod h1:R3yKQBGvbDTB/B173ZV/MnRfn6AERDUVeWxH8ZtwXcY= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 h1:/2OyBFI7GjYKexBPcfTPvKFz8Ks7qYzkkz2SQ8aiJgc= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA= -github.com/bitrise-io/go-steputils v1.0.1/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= -github.com/bitrise-io/go-steputils v1.0.2/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= github.com/bitrise-io/go-steputils v1.0.5 h1:OBH7CPXeqIWFWJw6BOUMQnUb8guspwKr2RhYBhM9tfc= github.com/bitrise-io/go-steputils v1.0.5/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= -github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2 h1:WfhgPqLyg+VPNb6istzlJqalk81kb9Wt9IcQIQTOsxE= -github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2/go.mod h1:OC0mHpjD/bqmsHlhG+FWgTouBbcJvmyx896PDP3dRBs= +github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18 h1:43cs5DGgfTWEcaod3hZ7eqOQjhVnOL1QiY6TN3xDhhw= +github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18/go.mod h1:/ueNOKnsjcUrlt8Ck75WRNspL7E6nAAylvl9oGJtYio= github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.2/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.9 h1:wy7FewUpseNSTZr41BbGH0csfFqzptFt4zy2pOAEOg0= -github.com/bitrise-io/go-utils v1.0.9/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.1/go.mod h1:sy+Ir1X8P3tAAx/qU/r+hqDjHDcrMjIzDEvId1wqNc4= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11 h1:IacLMHL7hhgVcqtx15Bysq738P8FRCp6ckGk1NvioWo= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11/go.mod h1:SJqGxzwjIAx2LVQxNGS4taN7X//eDPJLrFxJ1MpOuyA= -github.com/bitrise-io/go-xcode v1.0.9/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY= -github.com/bitrise-io/go-xcode v1.0.16 h1:G1IItfD2dvPNm7MLIWXFQHNPcafMVnw83M1lqCUH5L4= -github.com/bitrise-io/go-xcode v1.0.16/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.25 h1:h01Qp6Mw3LiPg7A7g4pf5F5LcejrY/i9rL7PkBnlOBs= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.25/go.mod h1:8WBcRgrVXY8tzR7NcjE4fw6WguOIfB3YcC7ZTcQYUEY= -github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU= +github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0dn1dE= +github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= +github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 h1:55as5Iv0N4btuRP3YwRzN+BCMtKO210MnJ8mpxmeI7o= +github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ= +github.com/bitrise-io/go-xcode v1.0.18 h1:guFywV/AwcZuexqIQkL1ixc3QThpbJvA4voa9MqvPto= +github.com/bitrise-io/go-xcode v1.0.18/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.43 h1:zNQt4sgdgd2eJP7Kmz5pxgwv+xp6yRqkSCAwG1TO7Ww= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.43/go.mod h1:BFDhHF1ftPWpnZt4sjpPQ+H6QaQLkRoNwQZC2/xdcgg= 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= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -40,10 +32,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -52,7 +42,6 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -62,13 +51,15 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= 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.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/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -79,11 +70,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -92,11 +81,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= -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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/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= howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= diff --git a/vendor/github.com/bitrise-io/go-steputils/v2/ruby/command.go b/vendor/github.com/bitrise-io/go-steputils/v2/ruby/command.go index 6d7edd0..0752e80 100644 --- a/vendor/github.com/bitrise-io/go-steputils/v2/ruby/command.go +++ b/vendor/github.com/bitrise-io/go-steputils/v2/ruby/command.go @@ -35,6 +35,7 @@ func NewCommandFactory(cmdFactory command.Factory, cmdLocator env.CommandLocator }, nil } +// Create ... func (f commandFactory) Create(name string, args []string, opts *command.Opts) command.Command { s := append([]string{name}, args...) if sudoNeeded(f.installType, s...) { @@ -64,6 +65,9 @@ func (f commandFactory) CreateGemInstall(gem, version string, enablePrerelease, if f.installType == RbenvRuby { cmd := f.Create("rbenv", []string{"rehash"}, nil) cmds = append(cmds, cmd) + } else if f.installType == ASDFRuby { + cmd := f.Create("asdf", []string{"reshim", "ruby"}, nil) + cmds = append(cmds, cmd) } return cmds @@ -77,6 +81,9 @@ func (f commandFactory) CreateGemUpdate(gem string, opts *command.Opts) []comman if f.installType == RbenvRuby { cmd := f.Create("rbenv", []string{"rehash"}, nil) cmds = append(cmds, cmd) + } else if f.installType == ASDFRuby { + cmd := f.Create("asdf", []string{"reshim", "ruby"}, nil) + cmds = append(cmds, cmd) } return cmds diff --git a/vendor/github.com/bitrise-io/go-steputils/v2/ruby/environment.go b/vendor/github.com/bitrise-io/go-steputils/v2/ruby/environment.go index b4376d0..63d32f2 100644 --- a/vendor/github.com/bitrise-io/go-steputils/v2/ruby/environment.go +++ b/vendor/github.com/bitrise-io/go-steputils/v2/ruby/environment.go @@ -7,10 +7,10 @@ import ( "regexp" "strings" - "github.com/bitrise-io/go-utils/pathutil" "github.com/bitrise-io/go-utils/v2/command" "github.com/bitrise-io/go-utils/v2/env" "github.com/bitrise-io/go-utils/v2/log" + "github.com/bitrise-io/go-utils/v2/pathutil" ) const ( @@ -33,6 +33,8 @@ const ( RVMRuby // RbenvRuby ... RbenvRuby + // ASDFRuby ... + ASDFRuby ) // Environment ... @@ -40,6 +42,7 @@ type Environment interface { RubyInstallType() InstallType IsGemInstalled(gem, version string) (bool, error) IsSpecifiedRbenvRubyInstalled(workdir string) (bool, string, error) + IsSpecifiedASDFRubyInstalled(workdir string) (bool, string, error) } type environment struct { @@ -62,6 +65,36 @@ func (m environment) RubyInstallType() InstallType { return rubyInstallType(m.cmdLocator) } +func rubyInstallType(cmdLocator env.CommandLocator) InstallType { + pth, err := cmdLocator.LookPath("ruby") + if err != nil { + return Unknown + } + + installType := Unknown + if pth == systemRubyPth { + installType = SystemRuby + } else if pth == brewRubyPth { + installType = BrewRuby + } else if pth == brewRubyPthAlt { + installType = BrewRuby + } else if _, err := cmdLocator.LookPath("rvm"); err == nil { + installType = RVMRuby + } else if _, err := cmdLocator.LookPath("rbenv"); err == nil { + installType = RbenvRuby + } else if _, err := cmdLocator.LookPath("asdf"); err == nil { + // asdf doesn't store its installs in a definite location, + // but it does store its shims in a 'shims' directory, which + // is what we'll get from the `LookPath("ruby")` call above. + if strings.Contains(pth, "shims/ruby") { + installType = ASDFRuby + } + } + + return installType +} + +// IsGemInstalled returns true if the specified gem version is installed func (m environment) IsGemInstalled(gem, version string) (bool, error) { cmd := m.factory.Create("gem", []string{"list"}, nil) @@ -83,7 +116,7 @@ func (m environment) IsGemInstalled(gem, version string) (bool, error) { // 4. The global ~/.rbenv/version file. You can modify this file using the rbenv global command. // src: https://github.com/rbenv/rbenv#choosing-the-ruby-version func (m environment) IsSpecifiedRbenvRubyInstalled(workdir string) (bool, string, error) { - absWorkdir, err := pathutil.AbsPath(workdir) + absWorkdir, err := pathutil.NewPathModifier().AbsPath(workdir) if err != nil { return false, "", fmt.Errorf("failed to get absolute path for ( %s ), error: %s", workdir, err) } @@ -96,34 +129,13 @@ func (m environment) IsSpecifiedRbenvRubyInstalled(workdir string) (bool, string return isSpecifiedRbenvRubyInstalled(out) } -func rubyInstallType(cmdLocator env.CommandLocator) InstallType { - pth, err := cmdLocator.LookPath("ruby") - if err != nil { - return Unknown - } - - installType := Unknown - if pth == systemRubyPth { - installType = SystemRuby - } else if pth == brewRubyPth { - installType = BrewRuby - } else if pth == brewRubyPthAlt { - installType = BrewRuby - } else if _, err := cmdLocator.LookPath("rvm"); err == nil { - installType = RVMRuby - } else if _, err := cmdLocator.LookPath("rbenv"); err == nil { - installType = RbenvRuby - } - - return installType -} - func isSpecifiedRbenvRubyInstalled(message string) (bool, string, error) { // // Not installed - reg, err := regexp.Compile("rbenv: version \x60.*' is not installed") // \x60 == ` (The go linter suggested to use the hex code instead) + regexPattern := "rbenv: version \x60.*' is not installed" // \x60 == ` (The go linter suggested to use the hex code instead) + reg, err := regexp.Compile(regexPattern) if err != nil { - return false, "", fmt.Errorf("failed to parse regex ( %s ) on the error message, error: %s", "rbenv: version \x60.*' is not installed", err) // \x60 == ` (The go linter suggested to use the hex code instead) + return false, "", fmt.Errorf("failed to parse regex ( %s ) on the error message, error: %s", regexPattern, err) } var version string @@ -135,7 +147,7 @@ func isSpecifiedRbenvRubyInstalled(message string) (bool, string, error) { // // Installed - reg, err = regexp.Compile(".* \\(set by") + reg, err = regexp.Compile(`.* \(set by`) if err != nil { return false, "", fmt.Errorf("failed to parse regex ( %s ) on the error message, error: %s", ".* \\(set by", err) } @@ -148,6 +160,47 @@ func isSpecifiedRbenvRubyInstalled(message string) (bool, string, error) { return false, version, nil } +// IsSpecifiedASDFRubyInstalled ... +func (m environment) IsSpecifiedASDFRubyInstalled(workdir string) (isInstalled bool, versionInstalled string, error error) { + absWorkdir, err := pathutil.NewPathModifier().AbsPath(workdir) + if err != nil { + return false, "", fmt.Errorf("failed to get absolute path for ( %s ), error: %s", workdir, err) + } + + cmd := m.factory.Create("asdf", []string{"current", "ruby"}, &command.Opts{Dir: absWorkdir}) + out, err := cmd.RunAndReturnTrimmedCombinedOutput() + if err != nil { + m.logger.Warnf("failed to check installed ruby version, %s error: %s", out, err) + } + + return isSpecifiedASDFRubyInstalled(out) +} + +func isSpecifiedASDFRubyInstalled(message string) (isInstalled bool, versionInstalled string, error error) { + regexPattern := "Not installed. Run \"asdf install ruby .*\"" + reg, err := regexp.Compile(regexPattern) + if err != nil { + return false, "", fmt.Errorf("failed to parse regex ( %s ) on the error message, error: %s", regexPattern, err) + } + + var version string + if reg.MatchString(message) { + // + // Not installed + version = strings.Split(strings.Split(message, "\"asdf install ruby ")[1], "\"")[0] + return false, version, nil + } + // + // Installed + patternTerminator := "/" + if strings.Contains(message, "ASDF_RUBY_VERSION") { + patternTerminator = "ASDF_RUBY_VERSION" + } + version = strings.Split(strings.Split(message, "ruby ")[1], patternTerminator)[0] + version = strings.TrimSpace(version) + return true, version, nil +} + func findGemInList(gemList, gem, version string) (bool, error) { // minitest (5.10.1, 5.9.1, 5.9.0, 5.8.3, 4.7.5) pattern := fmt.Sprintf(`^%s \(.*%s.*\)`, gem, version) diff --git a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go index 1f0acf6..8fb7e90 100644 --- a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go +++ b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go @@ -9,7 +9,6 @@ import ( "strconv" "strings" - "github.com/bitrise-io/go-utils/parseutil" "github.com/bitrise-io/go-utils/v2/env" ) @@ -86,11 +85,11 @@ func setField(field reflect.Value, value, constraint string) error { field = field.Elem() } - switch field.Kind() { + switch field.Kind() { //nolint:exhaustive case reflect.String: field.SetString(value) case reflect.Bool: - b, err := parseutil.ParseBool(value) + b, err := parseBool(value) if err != nil { return errors.New("can't convert to bool") } @@ -448,3 +447,19 @@ func contains(s, opt string) bool { } return false } + +func parseBool(userInputStr string) (bool, error) { + if userInputStr == "" { + return false, errors.New("no string to parse") + } + userInputStr = strings.TrimSpace(userInputStr) + + lowercased := strings.ToLower(userInputStr) + if lowercased == "yes" || lowercased == "y" { + return true, nil + } + if lowercased == "no" || lowercased == "n" { + return false, nil + } + return strconv.ParseBool(lowercased) +} diff --git a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/strings.go b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/strings.go index 325d5fb..a73e887 100644 --- a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/strings.go +++ b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/strings.go @@ -5,11 +5,11 @@ import ( "reflect" "strings" - "github.com/bitrise-io/go-utils/colorstring" + "github.com/bitrise-io/go-utils/v2/log/colorstring" ) // Print the name of the struct with Title case in blue color with followed by a newline, -// then print all fields formatted as '- field name: field value` separated by newline. +// then print all fields formatted as `- field name: field value` separated by newline. func Print(config interface{}) { fmt.Print(toString(config)) } @@ -17,7 +17,7 @@ func Print(config interface{}) { func valueString(v reflect.Value) string { if v.Kind() != reflect.Ptr { if v.Kind() == reflect.String && v.Len() == 0 { - return fmt.Sprintf("") + return "" } return fmt.Sprintf("%v", v.Interface()) } @@ -30,7 +30,7 @@ func valueString(v reflect.Value) string { } // returns the name of the struct with Title case in blue color followed by a newline, -// then print all fields formatted as '- field name: field value` separated by newline. +// then print all fields formatted as `- field name: field value` separated by newline. func toString(config interface{}) string { v := reflect.ValueOf(config) t := reflect.TypeOf(config) @@ -43,7 +43,9 @@ func toString(config interface{}) string { t = t.Elem() } - str := fmt.Sprint(colorstring.Bluef("%s:\n", strings.Title(t.Name()))) + configName := strings.Title(t.Name()) //nolint:staticcheck + // It's not worth pulling the heavy /x/text lib for this simple case, string.Title() can handle the struct name + str := fmt.Sprint(colorstring.Bluef("%s:\n", configName)) for i := 0; i < t.NumField(); i++ { field := t.Field(i) var key, _ = parseTag(field.Tag.Get("env")) diff --git a/vendor/github.com/bitrise-io/go-utils/command/command.go b/vendor/github.com/bitrise-io/go-utils/command/command.go index c068490..3dcdac5 100644 --- a/vendor/github.com/bitrise-io/go-utils/command/command.go +++ b/vendor/github.com/bitrise-io/go-utils/command/command.go @@ -2,10 +2,10 @@ package command import ( "errors" + "fmt" "io" "os" "os/exec" - "strconv" "strings" ) @@ -125,7 +125,7 @@ func (m Model) PrintableCommandArgs() string { func PrintableCommandArgs(isQuoteFirst bool, fullCommandArgs []string) string { cmdArgsDecorated := []string{} for idx, anArg := range fullCommandArgs { - quotedArg := strconv.Quote(anArg) + quotedArg := fmt.Sprintf("\"%s\"", anArg) if idx == 0 && !isQuoteFirst { quotedArg = anArg } diff --git a/vendor/github.com/bitrise-io/go-utils/filedownloader/filedownloader.go b/vendor/github.com/bitrise-io/go-utils/filedownloader/filedownloader.go index d2919dd..731ddfc 100644 --- a/vendor/github.com/bitrise-io/go-utils/filedownloader/filedownloader.go +++ b/vendor/github.com/bitrise-io/go-utils/filedownloader/filedownloader.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "net/http/httputil" "os" "github.com/bitrise-io/go-utils/log" @@ -108,6 +109,10 @@ func download(context context.Context, client HTTPClient, source string, destina }() if resp.StatusCode != http.StatusOK { + responseBytes, err := httputil.DumpResponse(resp, true) + if err == nil { + return fmt.Errorf("unable to download file from: %s. Status code: %d. Response: %s", source, resp.StatusCode, string(responseBytes)) + } return fmt.Errorf("unable to download file from: %s. Status code: %d", source, resp.StatusCode) } diff --git a/vendor/github.com/bitrise-io/go-utils/parseutil/parseutil.go b/vendor/github.com/bitrise-io/go-utils/parseutil/parseutil.go deleted file mode 100644 index 08cec36..0000000 --- a/vendor/github.com/bitrise-io/go-utils/parseutil/parseutil.go +++ /dev/null @@ -1,95 +0,0 @@ -package parseutil - -import ( - "errors" - "fmt" - "strconv" - "strings" - - "github.com/bitrise-io/go-utils/pointers" -) - -// ParseBool ... -func ParseBool(userInputStr string) (bool, error) { - if userInputStr == "" { - return false, errors.New("No string to parse") - } - userInputStr = strings.TrimSpace(userInputStr) - - lowercased := strings.ToLower(userInputStr) - if lowercased == "yes" || lowercased == "y" { - return true, nil - } - if lowercased == "no" || lowercased == "n" { - return false, nil - } - return strconv.ParseBool(lowercased) -} - -// CastToString ... -func CastToString(value interface{}) string { - casted, ok := value.(string) - - if !ok { - castedStr := fmt.Sprintf("%v", value) - casted = castedStr - } - - return casted -} - -// CastToStringPtr ... -func CastToStringPtr(value interface{}) *string { - castedValue := CastToString(value) - return pointers.NewStringPtr(castedValue) -} - -// CastToBool ... -func CastToBool(value interface{}) (bool, bool) { - casted, ok := value.(bool) - - if !ok { - castedStr := CastToString(value) - - castedBool, err := ParseBool(castedStr) - if err != nil { - return false, false - } - - casted = castedBool - } - - return casted, true -} - -// CastToBoolPtr ... -func CastToBoolPtr(value interface{}) (*bool, bool) { - castedValue, ok := CastToBool(value) - if !ok { - return nil, false - } - return pointers.NewBoolPtr(castedValue), true -} - -// CastToMapStringInterface ... -func CastToMapStringInterface(value interface{}) (map[string]interface{}, bool) { - castedValue, ok := value.(map[interface{}]interface{}) - desiredMap := map[string]interface{}{} - for key, value := range castedValue { - keyStr, ok := key.(string) - if !ok { - return map[string]interface{}{}, false - } - desiredMap[keyStr] = value - } - return desiredMap, ok -} - -// CastToMapStringInterfacePtr ... -func CastToMapStringInterfacePtr(value interface{}) (*map[string]interface{}, bool) { - casted, ok := CastToMapStringInterface(value) - if !ok { - return nil, false - } - return pointers.NewMapStringInterfacePtr(casted), true -} diff --git a/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go b/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go deleted file mode 100644 index e26647d..0000000 --- a/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go +++ /dev/null @@ -1,98 +0,0 @@ -package pointers - -import "time" - -// NewBoolPtr ... -func NewBoolPtr(val bool) *bool { - ptrValue := new(bool) - *ptrValue = val - return ptrValue -} - -// NewStringPtr ... -func NewStringPtr(val string) *string { - ptrValue := new(string) - *ptrValue = val - return ptrValue -} - -// NewTimePtr ... -func NewTimePtr(val time.Time) *time.Time { - ptrValue := new(time.Time) - *ptrValue = val - return ptrValue -} - -// NewIntPtr ... -func NewIntPtr(val int) *int { - ptrValue := new(int) - *ptrValue = val - return ptrValue -} - -// NewInt64Ptr ... -func NewInt64Ptr(val int64) *int64 { - ptrValue := new(int64) - *ptrValue = val - return ptrValue -} - -// NewMapStringInterfacePtr ... -func NewMapStringInterfacePtr(val map[string]interface{}) *map[string]interface{} { - ptrValue := new(map[string]interface{}) - *ptrValue = map[string]interface{}{} - for key, value := range val { - (*ptrValue)[key] = value - } - return ptrValue -} - -// ------------------------------------------------------ -// --- Safe Getters - -// Bool ... -func Bool(val *bool) bool { - return BoolWithDefault(val, false) -} - -// BoolWithDefault ... -func BoolWithDefault(val *bool, defaultValue bool) bool { - if val == nil { - return defaultValue - } - return *val -} - -// String ... -func String(val *string) string { - return StringWithDefault(val, "") -} - -// StringWithDefault ... -func StringWithDefault(val *string, defaultValue string) string { - if val == nil { - return defaultValue - } - return *val -} - -// TimeWithDefault ... -func TimeWithDefault(val *time.Time, defaultValue time.Time) time.Time { - if val == nil { - return defaultValue - } - return *val -} - -// Int ... -func Int(val *int) int { - return IntWithDefault(val, 0) -} - -// IntWithDefault ... -func IntWithDefault(val *int, defaultValue int) int { - if val == nil { - return defaultValue - } - return *val -} diff --git a/vendor/github.com/bitrise-io/go-utils/v2/command/command.go b/vendor/github.com/bitrise-io/go-utils/v2/command/command.go index eedc628..4206c2b 100644 --- a/vendor/github.com/bitrise-io/go-utils/v2/command/command.go +++ b/vendor/github.com/bitrise-io/go-utils/v2/command/command.go @@ -1,6 +1,8 @@ package command import ( + "errors" + "fmt" "io" "os/exec" "strconv" @@ -9,13 +11,17 @@ import ( "github.com/bitrise-io/go-utils/v2/env" ) +// ErrorFinder ... +type ErrorFinder func(out string) []string + // Opts ... type Opts struct { - Stdout io.Writer - Stderr io.Writer - Stdin io.Reader - Env []string - Dir string + Stdout io.Writer + Stderr io.Writer + Stdin io.Reader + Env []string + Dir string + ErrorFinder ErrorFinder } // Factory ... @@ -35,7 +41,13 @@ func NewFactory(envRepository env.Repository) Factory { // Create ... func (f factory) Create(name string, args []string, opts *Opts) Command { cmd := exec.Command(name, args...) + var collector *errorCollector + if opts != nil { + if opts.ErrorFinder != nil { + collector = &errorCollector{errorFinder: opts.ErrorFinder} + } + cmd.Stdout = opts.Stdout cmd.Stderr = opts.Stderr cmd.Stdin = opts.Stdin @@ -47,7 +59,10 @@ func (f factory) Create(name string, args []string, opts *Opts) Command { cmd.Env = append(f.envRepository.List(), opts.Env...) cmd.Dir = opts.Dir } - return command{cmd} + return &command{ + cmd: cmd, + errorCollector: collector, + } } // Command ... @@ -62,7 +77,8 @@ type Command interface { } type command struct { - cmd *exec.Cmd + cmd *exec.Cmd + errorCollector *errorCollector } // PrintableCommandArgs ... @@ -71,13 +87,24 @@ func (c command) PrintableCommandArgs() string { } // Run ... -func (c command) Run() error { - return c.cmd.Run() +func (c *command) Run() error { + c.wrapOutputs() + + if err := c.cmd.Run(); err != nil { + return c.wrapError(err) + } + + return nil } // RunAndReturnExitCode ... func (c command) RunAndReturnExitCode() (int, error) { + c.wrapOutputs() err := c.cmd.Run() + if err != nil { + err = c.wrapError(err) + } + exitCode := c.cmd.ProcessState.ExitCode() return exitCode, err } @@ -86,6 +113,13 @@ func (c command) RunAndReturnExitCode() (int, error) { func (c command) RunAndReturnTrimmedOutput() (string, error) { outBytes, err := c.cmd.Output() outStr := string(outBytes) + if err != nil { + if c.errorCollector != nil { + c.errorCollector.collectErrors(outStr) + } + err = c.wrapError(err) + } + return strings.TrimSpace(outStr), err } @@ -93,17 +127,30 @@ func (c command) RunAndReturnTrimmedOutput() (string, error) { func (c command) RunAndReturnTrimmedCombinedOutput() (string, error) { outBytes, err := c.cmd.CombinedOutput() outStr := string(outBytes) + if err != nil { + if c.errorCollector != nil { + c.errorCollector.collectErrors(outStr) + } + err = c.wrapError(err) + } + return strings.TrimSpace(outStr), err } // Start ... func (c command) Start() error { + c.wrapOutputs() return c.cmd.Start() } // Wait ... func (c command) Wait() error { - return c.cmd.Wait() + err := c.cmd.Wait() + if err != nil { + err = c.wrapError(err) + } + + return err } func printableCommandArgs(isQuoteFirst bool, fullCommandArgs []string) string { @@ -118,3 +165,34 @@ func printableCommandArgs(isQuoteFirst bool, fullCommandArgs []string) string { return strings.Join(cmdArgsDecorated, " ") } + +func (c command) wrapError(err error) error { + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + if c.errorCollector != nil && len(c.errorCollector.errorLines) > 0 { + return fmt.Errorf("command failed with exit status %d (%s): %w", exitErr.ExitCode(), c.PrintableCommandArgs(), errors.New(strings.Join(c.errorCollector.errorLines, "\n"))) + } + return fmt.Errorf("command failed with exit status %d (%s): %w", exitErr.ExitCode(), c.PrintableCommandArgs(), errors.New("check the command's output for details")) + } + return fmt.Errorf("executing command failed (%s): %w", c.PrintableCommandArgs(), err) +} + +func (c command) wrapOutputs() { + if c.errorCollector == nil { + return + } + + if c.cmd.Stdout != nil { + outWriter := io.MultiWriter(c.errorCollector, c.cmd.Stdout) + c.cmd.Stdout = outWriter + } else { + c.cmd.Stdout = c.errorCollector + } + + if c.cmd.Stderr != nil { + errWriter := io.MultiWriter(c.errorCollector, c.cmd.Stderr) + c.cmd.Stderr = errWriter + } else { + c.cmd.Stderr = c.errorCollector + } +} diff --git a/vendor/github.com/bitrise-io/go-utils/v2/command/errorcollector.go b/vendor/github.com/bitrise-io/go-utils/v2/command/errorcollector.go new file mode 100644 index 0000000..945e3ff --- /dev/null +++ b/vendor/github.com/bitrise-io/go-utils/v2/command/errorcollector.go @@ -0,0 +1,18 @@ +package command + +type errorCollector struct { + errorLines []string + errorFinder ErrorFinder +} + +func (e *errorCollector) Write(p []byte) (n int, err error) { + e.collectErrors(string(p)) + return len(p), nil +} + +func (e *errorCollector) collectErrors(output string) { + lines := e.errorFinder(output) + if len(lines) > 0 { + e.errorLines = append(e.errorLines, lines...) + } +} diff --git a/vendor/github.com/bitrise-io/go-utils/v2/log/colorstring/colorstring.go b/vendor/github.com/bitrise-io/go-utils/v2/log/colorstring/colorstring.go new file mode 100644 index 0000000..5401b91 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-utils/v2/log/colorstring/colorstring.go @@ -0,0 +1,111 @@ +package colorstring + +// ANSI color escape sequences + +import ( + "fmt" +) + +// Color ... +type Color string + +const ( + blackColor Color = "\x1b[30;1m" + redColor Color = "\x1b[31;1m" + greenColor Color = "\x1b[32;1m" + yellowColor Color = "\x1b[33;1m" + blueColor Color = "\x1b[34;1m" + magentaColor Color = "\x1b[35;1m" + cyanColor Color = "\x1b[36;1m" + resetColor Color = "\x1b[0m" +) + +// ColorFunc ... +type ColorFunc func(a ...interface{}) string + +func addColor(color Color, msg string) string { + return string(color) + msg + string(resetColor) +} + +// NoColor ... +func NoColor(a ...interface{}) string { + return fmt.Sprint(a...) +} + +// Black ... +func Black(a ...interface{}) string { + return addColor(blackColor, fmt.Sprint(a...)) +} + +// Red ... +func Red(a ...interface{}) string { + return addColor(redColor, fmt.Sprint(a...)) +} + +// Green ... +func Green(a ...interface{}) string { + return addColor(greenColor, fmt.Sprint(a...)) +} + +// Yellow ... +func Yellow(a ...interface{}) string { + return addColor(yellowColor, fmt.Sprint(a...)) +} + +// Blue ... +func Blue(a ...interface{}) string { + return addColor(blueColor, fmt.Sprint(a...)) +} + +// Magenta ... +func Magenta(a ...interface{}) string { + return addColor(magentaColor, fmt.Sprint(a...)) +} + +// Cyan ... +func Cyan(a ...interface{}) string { + return addColor(cyanColor, fmt.Sprint(a...)) +} + +// ColorfFunc ... +type ColorfFunc func(format string, a ...interface{}) string + +// NoColorf ... +func NoColorf(format string, a ...interface{}) string { + return NoColor(fmt.Sprintf(format, a...)) +} + +// Blackf ... +func Blackf(format string, a ...interface{}) string { + return Black(fmt.Sprintf(format, a...)) +} + +// Redf ... +func Redf(format string, a ...interface{}) string { + return Red(fmt.Sprintf(format, a...)) +} + +// Greenf ... +func Greenf(format string, a ...interface{}) string { + return Green(fmt.Sprintf(format, a...)) +} + +// Yellowf ... +func Yellowf(format string, a ...interface{}) string { + return Yellow(fmt.Sprintf(format, a...)) +} + +// Bluef ... +func Bluef(format string, a ...interface{}) string { + return Blue(fmt.Sprintf(format, a...)) +} + +// Magentaf ... +func Magentaf(format string, a ...interface{}) string { + return Magenta(fmt.Sprintf(format, a...)) +} + +// Cyanf ... +func Cyanf(format string, a ...interface{}) string { + return Cyan(fmt.Sprintf(format, a...)) +} diff --git a/vendor/github.com/bitrise-io/go-utils/v2/log/severity.go b/vendor/github.com/bitrise-io/go-utils/v2/log/severity.go index fc1fc96..02a1431 100644 --- a/vendor/github.com/bitrise-io/go-utils/v2/log/severity.go +++ b/vendor/github.com/bitrise-io/go-utils/v2/log/severity.go @@ -1,6 +1,6 @@ package log -import "github.com/bitrise-io/go-utils/colorstring" +import "github.com/bitrise-io/go-utils/v2/log/colorstring" // Severity ... type Severity uint8 diff --git a/vendor/github.com/bitrise-io/go-utils/v2/pathutil/pathutil.go b/vendor/github.com/bitrise-io/go-utils/v2/pathutil/pathutil.go new file mode 100644 index 0000000..f173693 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-utils/v2/pathutil/pathutil.go @@ -0,0 +1,127 @@ +package pathutil + +import ( + "errors" + "os" + "os/user" + "path/filepath" + "strings" +) + +// PathProvider ... +type PathProvider interface { + CreateTempDir(prefix string) (string, error) +} + +type pathProvider struct{} + +// NewPathProvider ... +func NewPathProvider() PathProvider { + return pathProvider{} +} + +// CreateTempDir creates a temp dir, and returns its path. +// If prefix is provided it'll be used as the tmp dir's name prefix. +// Normalized: it's guaranteed that the path won't end with '/'. +func (pathProvider) CreateTempDir(prefix string) (dir string, err error) { + dir, err = os.MkdirTemp("", prefix) + dir = strings.TrimSuffix(dir, "/") + + return +} + +// PathChecker ... +type PathChecker interface { + IsPathExists(pth string) (bool, error) + IsDirExists(pth string) (bool, error) +} + +type pathChecker struct{} + +// NewPathChecker ... +func NewPathChecker() PathChecker { + return pathChecker{} +} + +// IsPathExists ... +func (c pathChecker) IsPathExists(pth string) (bool, error) { + _, isExists, err := c.genericIsPathExists(pth) + return isExists, err +} + +// IsDirExists ... +func (c pathChecker) IsDirExists(pth string) (bool, error) { + info, isExists, err := c.genericIsPathExists(pth) + return isExists && info.IsDir(), err +} + +func (pathChecker) genericIsPathExists(pth string) (os.FileInfo, bool, error) { + if pth == "" { + return nil, false, errors.New("no path provided") + } + + fileInf, err := os.Lstat(pth) + if err == nil { + return fileInf, true, nil + } + + if os.IsNotExist(err) { + return nil, false, nil + } + + return fileInf, false, err +} + +// PathModifier ... +type PathModifier interface { + AbsPath(pth string) (string, error) +} + +type pathModifier struct{} + +// NewPathModifier ... +func NewPathModifier() PathModifier { + return pathModifier{} +} + +// AbsPath expands ENV vars and the ~ character then calls Go's Abs +func (p pathModifier) AbsPath(pth string) (string, error) { + if pth == "" { + return "", errors.New("No Path provided") + } + + pth, err := p.expandTilde(pth) + if err != nil { + return "", err + } + + return filepath.Abs(os.ExpandEnv(pth)) +} + +func (pathModifier) expandTilde(pth string) (string, error) { + if pth == "" { + return "", errors.New("No Path provided") + } + + if strings.HasPrefix(pth, "~") { + pth = strings.TrimPrefix(pth, "~") + + if len(pth) == 0 || strings.HasPrefix(pth, "/") { + return os.ExpandEnv("$HOME" + pth), nil + } + + splitPth := strings.Split(pth, "/") + username := splitPth[0] + + usr, err := user.Lookup(username) + if err != nil { + return "", err + } + + pathInUsrHome := strings.Join(splitPth[1:], "/") + + return filepath.Join(usr.HomeDir, pathInUsrHome), nil + } + + return pth, nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/autocodesign.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/autocodesign.go index 89776ce..f00e0a4 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/autocodesign.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/autocodesign.go @@ -69,6 +69,8 @@ type Certificate struct { // DevPortalClient abstract away the Apple Developer Portal API type DevPortalClient interface { + Login() error + QueryCertificateBySerial(serial big.Int) (Certificate, error) QueryAllIOSCertificates() (map[appstoreconnect.CertificateType][]Certificate, error) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/codesignasset/writer.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/codesignasset/writer.go index 9a08582..906c5b5 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/codesignasset/writer.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/codesignasset/writer.go @@ -3,7 +3,6 @@ package codesignasset import ( "fmt" - "io/ioutil" "os" "path" @@ -101,7 +100,7 @@ func (w Writer) InstallProfile(profile autocodesign.Profile) error { } name := path.Join(profilesDir, profile.Attributes().UUID+ext) - if err := ioutil.WriteFile(name, profile.Attributes().ProfileContent, 0600); err != nil { + if err := os.WriteFile(name, profile.Attributes().ProfileContent, 0600); err != nil { return fmt.Errorf("failed to write profile to file: %s", err) } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go index a17e50b..73d9a38 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go @@ -9,7 +9,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "reflect" @@ -179,7 +178,7 @@ func checkResponse(r *http.Response) error { } errorResponse := &ErrorResponse{Response: r} - data, err := ioutil.ReadAll(r.Body) + data, err := io.ReadAll(r.Body) if err == nil && data != nil { if err := json.Unmarshal(data, errorResponse); err != nil { log.Errorf("Failed to unmarshal response (%s): %s", string(data), err) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/auth.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/auth.go new file mode 100644 index 0000000..f407828 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/auth.go @@ -0,0 +1,15 @@ +package appstoreconnectclient + +// AuthClient ... +type AuthClient struct { +} + +// NewAuthClient ... +func NewAuthClient() *AuthClient { + return &AuthClient{} +} + +// Login ... +func (c *AuthClient) Login() error { + return nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/client.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/client.go index f7c4fe6..92d2c00 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/client.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnectclient/client.go @@ -10,6 +10,7 @@ import ( // Client ... type Client struct { + *AuthClient *CertificateSource *DeviceClient *ProfileClient @@ -18,6 +19,7 @@ type Client struct { // NewAPIDevPortalClient ... func NewAPIDevPortalClient(client *appstoreconnect.Client) autocodesign.DevPortalClient { return Client{ + AuthClient: NewAuthClient(), CertificateSource: NewCertificateSource(client), DeviceClient: NewDeviceClient(client), ProfileClient: NewProfileClient(client), diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/devportalclient.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/devportalclient.go index 9f75a18..8d01bc2 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/devportalclient.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/devportalclient.go @@ -5,7 +5,10 @@ import ( "fmt" "net/http" + "github.com/bitrise-io/go-steputils/v2/ruby" "github.com/bitrise-io/go-utils/retry" + "github.com/bitrise-io/go-utils/v2/command" + "github.com/bitrise-io/go-utils/v2/env" "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-xcode/appleauth" "github.com/bitrise-io/go-xcode/devportalservice" @@ -76,7 +79,12 @@ func (f Factory) Create(credentials appleauth.Credentials, teamID string) (autoc devportalClient = appstoreconnectclient.NewAPIDevPortalClient(client) f.logger.Debugf("App Store Connect API client created with base URL: %s", client.BaseURL) } else if credentials.AppleID != nil { - client, err := spaceship.NewClient(*credentials.AppleID, teamID) + cmdFactory, err := ruby.NewCommandFactory(command.NewFactory(env.NewRepository()), env.NewCommandLocator()) + if err != nil { + return nil, err + } + + client, err := spaceship.NewClient(*credentials.AppleID, teamID, cmdFactory) if err != nil { return nil, fmt.Errorf("failed to initialize Apple ID client: %v", err) } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/auth.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/auth.go new file mode 100644 index 0000000..e8b1ff3 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/auth.go @@ -0,0 +1,34 @@ +package spaceship + +import ( + "encoding/json" + "fmt" +) + +// AuthClient ... +type AuthClient struct { + client *Client +} + +// NewAuthClient ... +func NewAuthClient(client *Client) *AuthClient { + return &AuthClient{client: client} +} + +// Login ... +func (c *AuthClient) Login() error { + output, err := c.client.runSpaceshipCommand("login") + if err != nil { + return fmt.Errorf("running command failed with error: %w", err) + } + + var teamIDResponse struct { + Data string `json:"data"` + } + if err := json.Unmarshal([]byte(output), &teamIDResponse); err != nil { + return fmt.Errorf("failed to unmarshal response: %w", err) + } + + c.client.teamID = teamIDResponse.Data + return nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/certificates.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/certificates.go index f0bf49f..a15d9f0 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/certificates.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/certificates.go @@ -54,26 +54,16 @@ func (s *CertificateSource) QueryAllIOSCertificates() (map[appstoreconnect.Certi } func (s *CertificateSource) downloadAll() error { - devCertsCmd, err := s.client.createRequestCommand("list_dev_certs") - if err != nil { - return err - } - - distCertsCommand, err := s.client.createRequestCommand("list_dist_certs") - if err != nil { - return err - } - fmt.Printf("Fetching developer certificates") - devCerts, err := getCertificates(devCertsCmd) + devCerts, err := s.getCertificates(true) if err != nil { return err } fmt.Printf("Fetching distribution certificates") - distCers, err := getCertificates(distCertsCommand) + distCers, err := s.getCertificates(false) if err != nil { return err } @@ -93,8 +83,14 @@ type certificatesResponse struct { } `json:"data"` } -func getCertificates(cmd spaceshipCommand) ([]autocodesign.Certificate, error) { - output, err := runSpaceshipCommand(cmd) +func (s *CertificateSource) getCertificates(devCerts bool) ([]autocodesign.Certificate, error) { + var output string + var err error + if devCerts { + output, err = s.client.runSpaceshipCommand("list_dev_certs") + } else { + output, err = s.client.runSpaceshipCommand("list_dist_certs") + } if err != nil { return nil, err } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/devices.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/devices.go index a9fe5ad..2e7d223 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/devices.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/devices.go @@ -51,12 +51,7 @@ func newDevice(d DeviceInfo) appstoreconnect.Device { func (d *DeviceClient) ListDevices(udid string, platform appstoreconnect.DevicePlatform) ([]appstoreconnect.Device, error) { log.Debugf("Fetching devices") - cmd, err := d.client.createRequestCommand("list_devices") - if err != nil { - return nil, err - } - - output, err := runSpaceshipCommand(cmd) + output, err := d.client.runSpaceshipCommand("list_devices") if err != nil { return nil, err } @@ -94,7 +89,7 @@ func (d *DeviceClient) ListDevices(udid string, platform appstoreconnect.DeviceP func (d *DeviceClient) RegisterDevice(testDevice devportalservice.TestDevice) (*appstoreconnect.Device, error) { log.Debugf("Registering device") - cmd, err := d.client.createRequestCommand("register_device", + output, err := d.client.runSpaceshipCommand("register_device", "--udid", testDevice.DeviceID, "--name", testDevice.Title, ) @@ -102,11 +97,6 @@ func (d *DeviceClient) RegisterDevice(testDevice devportalservice.TestDevice) (* return nil, err } - output, err := runSpaceshipCommand(cmd) - if err != nil { - return nil, err - } - var deviceResponse struct { Data struct { Device *DeviceInfo `json:"device"` diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/profiles.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/profiles.go index ed496b4..c144571 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/profiles.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/profiles.go @@ -125,7 +125,7 @@ type AppInfo struct { func (c *ProfileClient) FindProfile(name string, profileType appstoreconnect.ProfileType) (autocodesign.Profile, error) { log.Debugf("Locating provision profile") - cmd, err := c.client.createRequestCommand("list_profiles", + output, err := c.client.runSpaceshipCommand("list_profiles", profileNameArgKey, name, profileTypeArgKey, string(profileType), ) @@ -133,11 +133,6 @@ func (c *ProfileClient) FindProfile(name string, profileType appstoreconnect.Pro return nil, err } - output, err := runSpaceshipCommand(cmd) - if err != nil { - return nil, err - } - var profileResponse struct { Data []ProfileInfo `json:"data"` } @@ -164,12 +159,7 @@ func (c *ProfileClient) FindProfile(name string, profileType appstoreconnect.Pro func (c *ProfileClient) DeleteProfile(id string) error { log.Debugf("Deleting provisioning profile: %s", id) - cmd, err := c.client.createRequestCommand("delete_profile", "--id", id) - if err != nil { - return err - } - - _, err = runSpaceshipCommand(cmd) + _, err := c.client.runSpaceshipCommand("delete_profile", "--id", id) if err != nil { return err } @@ -181,7 +171,7 @@ func (c *ProfileClient) DeleteProfile(id string) error { func (c *ProfileClient) CreateProfile(name string, profileType appstoreconnect.ProfileType, bundleID appstoreconnect.BundleID, certificateIDs []string, deviceIDs []string) (autocodesign.Profile, error) { log.Debugf("Creating provisioning profile with name: %s", name) - cmd, err := c.client.createRequestCommand("create_profile", + output, err := c.client.runSpaceshipCommand("create_profile", bundleIDIdentifierArgKey, bundleID.Attributes.Identifier, certificateIDArgKey, certificateIDs[0], profileNameArgKey, name, @@ -191,11 +181,6 @@ func (c *ProfileClient) CreateProfile(name string, profileType appstoreconnect.P return nil, err } - output, err := runSpaceshipCommand(cmd) - if err != nil { - return nil, err - } - var profileResponse struct { Data ProfileInfo `json:"data"` } @@ -219,18 +204,13 @@ func (c *ProfileClient) CreateProfile(name string, profileType appstoreconnect.P func (c *ProfileClient) FindBundleID(bundleIDIdentifier string) (*appstoreconnect.BundleID, error) { log.Debugf("Locating bundle id: %s", bundleIDIdentifier) - cmd, err := c.client.createRequestCommand("get_app", + output, err := c.client.runSpaceshipCommand("get_app", bundleIDIdentifierArgKey, bundleIDIdentifier, ) if err != nil { return nil, err } - output, err := runSpaceshipCommand(cmd) - if err != nil { - return nil, err - } - var appResponse struct { Data []AppInfo `json:"data"` } @@ -256,7 +236,7 @@ func (c *ProfileClient) FindBundleID(bundleIDIdentifier string) (*appstoreconnec func (c *ProfileClient) CreateBundleID(bundleIDIdentifier, appIDName string) (*appstoreconnect.BundleID, error) { log.Debugf("Creating new bundle id with name: %s", bundleIDIdentifier) - cmd, err := c.client.createRequestCommand("create_app", + output, err := c.client.runSpaceshipCommand("create_app", bundleIDIdentifierArgKey, bundleIDIdentifier, bundleIDNameArgKey, appIDName, ) @@ -264,11 +244,6 @@ func (c *ProfileClient) CreateBundleID(bundleIDIdentifier, appIDName string) (*a return nil, err } - output, err := runSpaceshipCommand(cmd) - if err != nil { - return nil, err - } - var appResponse struct { Data AppInfo `json:"data"` } @@ -295,7 +270,7 @@ func (c *ProfileClient) CheckBundleIDEntitlements(bundleID appstoreconnect.Bundl } entitlementsBase64 := base64.StdEncoding.EncodeToString(entitlementsBytes) - cmd, err := c.client.createRequestCommand("check_bundleid", + _, err = c.client.runSpaceshipCommand("check_bundleid", bundleIDIdentifierArgKey, bundleID.Attributes.Identifier, entitlementsArgKey, entitlementsBase64, ) @@ -303,11 +278,6 @@ func (c *ProfileClient) CheckBundleIDEntitlements(bundleID appstoreconnect.Bundl return err } - _, err = runSpaceshipCommand(cmd) - if err != nil { - return err - } - return nil } @@ -321,7 +291,7 @@ func (c *ProfileClient) SyncBundleID(bundleID appstoreconnect.BundleID, appEntit } entitlementsBase64 := base64.StdEncoding.EncodeToString(entitlementsBytes) - cmd, err := c.client.createRequestCommand("sync_bundleid", + _, err = c.client.runSpaceshipCommand("sync_bundleid", bundleIDIdentifierArgKey, bundleID.Attributes.Identifier, entitlementsArgKey, entitlementsBase64, ) @@ -329,10 +299,5 @@ func (c *ProfileClient) SyncBundleID(bundleID appstoreconnect.BundleID, appEntit return err } - _, err = runSpaceshipCommand(cmd) - if err != nil { - return err - } - return nil } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship.go index fca0230..80f11df 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship.go @@ -11,15 +11,15 @@ import ( "fmt" "io/fs" "os" + "os/exec" "path/filepath" "regexp" "strings" + "time" "github.com/bitrise-io/go-steputils/v2/ruby" - "github.com/bitrise-io/go-utils/errorutil" "github.com/bitrise-io/go-utils/log" "github.com/bitrise-io/go-utils/v2/command" - "github.com/bitrise-io/go-utils/v2/env" "github.com/bitrise-io/go-xcode/appleauth" "github.com/bitrise-io/go-xcode/v2/autocodesign" ) @@ -32,11 +32,13 @@ type Client struct { workDir string authConfig appleauth.AppleID teamID string + + cmdFactory ruby.CommandFactory } // NewClient ... -func NewClient(authConfig appleauth.AppleID, teamID string) (*Client, error) { - dir, err := prepareSpaceship() +func NewClient(authConfig appleauth.AppleID, teamID string, cmdFactory ruby.CommandFactory) (*Client, error) { + dir, err := prepareSpaceship(cmdFactory) if err != nil { return nil, err } @@ -45,11 +47,13 @@ func NewClient(authConfig appleauth.AppleID, teamID string) (*Client, error) { workDir: dir, authConfig: authConfig, teamID: teamID, + cmdFactory: cmdFactory, }, nil } // DevPortalClient ... type DevPortalClient struct { + *AuthClient *CertificateSource *ProfileClient *DeviceClient @@ -58,6 +62,7 @@ type DevPortalClient struct { // NewSpaceshipDevportalClient ... func NewSpaceshipDevportalClient(client *Client) autocodesign.DevPortalClient { return DevPortalClient{ + AuthClient: NewAuthClient(client), CertificateSource: NewSpaceshipCertificateSource(client), DeviceClient: NewDeviceClient(client), ProfileClient: NewSpaceshipProfileClient(client), @@ -69,7 +74,7 @@ type spaceshipCommand struct { printableCommandArgs string } -func (c *Client) createRequestCommand(subCommand string, opts ...string) (spaceshipCommand, error) { +func (c *Client) createSpaceshipCommand(subCommand string, opts ...string) (spaceshipCommand, error) { authParams := []string{ "--username", c.authConfig.Username, "--password", c.authConfig.Password, @@ -83,12 +88,7 @@ func (c *Client) createRequestCommand(subCommand string, opts ...string) (spaces printableCommand := strings.Join(s, " ") s = append(s, authParams...) - factory, err := ruby.NewCommandFactory(command.NewFactory(env.NewRepository()), env.NewCommandLocator()) - if err != nil { - return spaceshipCommand{}, err - } - - cmd := factory.CreateBundleExec("ruby", s, "", &command.Opts{ + cmd := c.cmdFactory.CreateBundleExec("ruby", s, "", &command.Opts{ Dir: c.workDir, }) @@ -98,11 +98,43 @@ func (c *Client) createRequestCommand(subCommand string, opts ...string) (spaces }, nil } -func runSpaceshipCommand(cmd spaceshipCommand) (string, error) { - log.Debugf("$ %s", cmd.printableCommandArgs) +func (c *Client) runSpaceshipCommand(subCommand string, opts ...string) (string, error) { + var spaceshipOut string + var spaceshipErr error + for i := 1; i <= 3; i++ { + cmd, err := c.createSpaceshipCommand(subCommand, opts...) + if err != nil { + return "", err + } + + log.TDebugf("$ %s", cmd.printableCommandArgs) + + spaceshipOut, spaceshipErr = c.runSpaceshipCommandOnce(cmd) + if spaceshipErr == nil { + return spaceshipOut, nil + } else if shouldRetrySpaceshipCommand(spaceshipErr.Error()) { + log.Debugf(spaceshipErr.Error()) + log.TWarnf("spaceship command failed with a retryable error, retrying (%d. attempt)...", i) + + time.Sleep(time.Duration(i) * time.Minute) + } else { + return "", spaceshipErr + } + } + + return spaceshipOut, spaceshipErr +} + +func (c *Client) runSpaceshipCommandOnce(cmd spaceshipCommand) (string, error) { output, err := cmd.command.RunAndReturnTrimmedCombinedOutput() if err != nil { - return "", fmt.Errorf("spaceship command failed, output: %s, error: %v", output, err) + // Omitting err from log, to avoid logging plaintext password present in command params + var exitError *exec.ExitError + if errors.As(err, &exitError) { + return "", fmt.Errorf("spaceship command exited with status %d, output: %s", exitError.ProcessState.ExitCode(), output) + } + + return "", fmt.Errorf("spaceship command failed with output: %s", output) } jsonRegexp := regexp.MustCompile(`(?m)^\{.*\}$`) @@ -129,7 +161,7 @@ func runSpaceshipCommand(cmd spaceshipCommand) (string, error) { return match, nil } -func prepareSpaceship() (string, error) { +func prepareSpaceship(cmdFactory ruby.CommandFactory) (string, error) { targetDir, err := os.MkdirTemp("", "") if err != nil { return "", err @@ -164,13 +196,8 @@ func prepareSpaceship() (string, error) { return "", err } - factory, err := ruby.NewCommandFactory(command.NewFactory(env.NewRepository()), env.NewCommandLocator()) - if err != nil { - return "", err - } - - bundlerVersion := "2.2.24" - cmds := factory.CreateGemInstall("bundler", bundlerVersion, false, true, &command.Opts{ + bundlerVersion := "2.5.6" + cmds := cmdFactory.CreateGemInstall("bundler", bundlerVersion, false, true, &command.Opts{ Dir: targetDir, }) for _, cmd := range cmds { @@ -179,16 +206,12 @@ func prepareSpaceship() (string, error) { output, err := cmd.RunAndReturnTrimmedCombinedOutput() if err != nil { - if errorutil.IsExitStatusError(err) { - return "", fmt.Errorf("Installing bundler gem failed: %s", output) - } - - return "", fmt.Errorf("running command failed: %s", err) + return "", fmt.Errorf("running command failed with error: %s, output: %s", err, output) } } fmt.Println() - bundleInstallCmd := factory.CreateBundleInstall(bundlerVersion, &command.Opts{ + bundleInstallCmd := cmdFactory.CreateBundleInstall(bundlerVersion, &command.Opts{ Dir: targetDir, }) @@ -197,12 +220,15 @@ func prepareSpaceship() (string, error) { output, err := bundleInstallCmd.RunAndReturnTrimmedCombinedOutput() if err != nil { - if errorutil.IsExitStatusError(err) { - return "", fmt.Errorf("bundle install failed: %s", output) - } - - return "", fmt.Errorf("running command failed: %s", err) + return "", fmt.Errorf("running command failed with error: %s, output: %s", err, output) } return targetDir, nil } + +func shouldRetrySpaceshipCommand(out string) bool { + if out == "" { + return false + } + return strings.Contains(out, "503 Service Temporarily Unavailable") +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/Gemfile.lock b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/Gemfile.lock index e483615..2ca482f 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/Gemfile.lock +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/Gemfile.lock @@ -3,25 +3,25 @@ GEM specs: CFPropertyList (3.0.6) rexml - addressable (2.8.1) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) artifactory (3.0.15) atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.716.0) - aws-sdk-core (3.170.0) - aws-eventstream (~> 1, >= 1.0.2) + aws-eventstream (1.3.0) + aws-partitions (1.883.0) + aws-sdk-core (3.190.3) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.62.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (1.76.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.119.1) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-s3 (1.142.0) + aws-sdk-core (~> 3, >= 3.189.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -30,13 +30,12 @@ GEM commander (4.6.0) highline (~> 2.0.0) declarative (0.0.20) - digest-crc (0.6.4) + digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20240107) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.99.0) + excon (0.109.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -65,8 +64,8 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.212.1) + fastimage (2.3.0) + fastlane (2.219.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -85,20 +84,22 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) google-cloud-storage (~> 1.31) highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) - optparse (~> 0.1.1) + optparse (>= 0.1.1) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) @@ -106,9 +107,9 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.34.0) - google-apis-core (>= 0.9.1, < 2.a) - google-apis-core (0.11.0) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -116,31 +117,29 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.44.0) + google-cloud-errors (1.3.1) + google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) + google-apis-storage_v1 (~> 0.31.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.3.0) + googleauth (1.8.1) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) @@ -149,31 +148,30 @@ GEM domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) - json (2.6.3) - jwt (2.7.0) - memoist (0.16.2) + json (2.7.1) + jwt (2.7.1) mini_magick (4.12.0) - mini_mime (1.1.2) + mini_mime (1.1.5) multi_json (1.15.0) - multipart-post (2.0.0) + multipart-post (2.3.0) nanaimo (0.3.0) naturally (2.2.1) - optparse (0.1.1) + optparse (0.4.0) os (1.1.4) - plist (3.7.0) - public_suffix (5.0.1) - rake (13.0.6) + plist (3.7.1) + public_suffix (5.0.4) + rake (13.1.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.5) + rexml (3.2.6) rouge (2.0.7) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.17.0) + signet (0.18.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -182,21 +180,17 @@ GEM CFPropertyList naturally terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.8.0) - webrick (1.8.1) + unicode-display_width (2.5.0) word_wrap (1.0.0) - xcodeproj (1.22.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -209,6 +203,7 @@ GEM xcpretty (~> 0.2, >= 0.0.7) PLATFORMS + arm64-darwin-23 universal-darwin-22 x86_64-darwin-19 @@ -216,4 +211,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.2.24 + 2.4.22 diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/main.rb b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/main.rb index 10c1f69..9fda66b 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/main.rb +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/main.rb @@ -25,46 +25,52 @@ opt.on('--udid UDID') { |o| options[:udid] = o } end.parse! - Log.verbose = true - - begin - Portal::AuthClient.login(options[:username], options[:password], options[:session], options[:team_id]) - rescue => e - puts "\nApple ID authentication failed: #{e}" - exit(1) - end + FastlaneCore::Globals.verbose = true result = '{}' - case options[:subcommand] - when 'list_dev_certs' - client = CertificateHelper.new - result = client.list_dev_certs - when 'list_dist_certs' - client = CertificateHelper.new - result = client.list_dist_certs - when 'list_profiles' - result = list_profiles(options[:profile_type], options[:profile_name]) - when 'get_app' - result = get_app(options[:bundle_id]) - when 'create_app' - result = create_app(options[:bundle_id], options[:bundle_id_name]) - when 'delete_profile' - delete_profile(options[:id]) - result = { status: 'OK' } - when 'create_profile' - result = create_profile(options[:profile_type], options[:bundle_id], options[:certificate_id], options[:profile_name]) - when 'check_bundleid' - entitlements = JSON.parse(options[:entitlements]) - check_bundleid(options[:bundle_id], entitlements) - when 'sync_bundleid' - entitlements = JSON.parse(options[:entitlements]) - sync_bundleid(options[:bundle_id], entitlements) - when 'list_devices' - result = list_devices - when 'register_device' - result = register_device(options[:udid], options[:name]) + + if options[:subcommand] == 'login' + begin + team_id = Portal::AuthClient.login(options[:username], options[:password], options[:session], options[:team_id]) + result = team_id + rescue => e + puts "\nApple ID authentication failed: #{e}" + exit(1) + end else - raise "Unknown subcommand: #{options[:subcommand]}" + Portal::AuthClient.restore_from_session(options[:username], options[:team_id]) + + case options[:subcommand] + when 'list_dev_certs' + client = CertificateHelper.new + result = client.list_dev_certs + when 'list_dist_certs' + client = CertificateHelper.new + result = client.list_dist_certs + when 'list_profiles' + result = list_profiles(options[:profile_type], options[:profile_name]) + when 'get_app' + result = get_app(options[:bundle_id]) + when 'create_app' + result = create_app(options[:bundle_id], options[:bundle_id_name]) + when 'delete_profile' + delete_profile(options[:id]) + result = { status: 'OK' } + when 'create_profile' + result = create_profile(options[:profile_type], options[:bundle_id], options[:certificate_id], options[:profile_name]) + when 'check_bundleid' + entitlements = JSON.parse(options[:entitlements]) + check_bundleid(options[:bundle_id], entitlements) + when 'sync_bundleid' + entitlements = JSON.parse(options[:entitlements]) + sync_bundleid(options[:bundle_id], entitlements) + when 'list_devices' + result = list_devices + when 'register_device' + result = register_device(options[:udid], options[:name]) + else + raise "Unknown subcommand: #{options[:subcommand]}" + end end response = { data: result } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/portal/auth_client.rb b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/portal/auth_client.rb index 0743e89..fdbb08e 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/portal/auth_client.rb +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/spaceship/spaceship/portal/auth_client.rb @@ -7,7 +7,7 @@ def self.login(username, password, two_factor_session = nil, team_id = nil) ENV['FASTLANE_SESSION'] = two_factor_session unless two_factor_session.to_s.empty? ENV['SPACESHIP_SKIP_2FA_UPGRADE'] = '1' - client = Spaceship::Portal.login(username, password) + client = Spaceship::PortalClient.login(username, password) if team_id.to_s.empty? teams = client.teams @@ -15,6 +15,18 @@ def self.login(username, password, two_factor_session = nil, team_id = nil) else client.team_id = team_id end + + client.store_cookie + + client.team_id + end + + def self.restore_from_session(username, team_id) + client = Spaceship::PortalClient.new(current_team_id: team_id) + client.user = username + client.load_session_from_file + + Spaceship::Portal.client = client end end end diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/localcodesignasset/profileconverter.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/localcodesignasset/profileconverter.go index 30a1b4f..30b10d9 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/localcodesignasset/profileconverter.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/localcodesignasset/profileconverter.go @@ -1,7 +1,7 @@ package localcodesignasset import ( - "io/ioutil" + "os" "github.com/bitrise-io/go-xcode/profileutil" "github.com/bitrise-io/go-xcode/v2/autocodesign" @@ -26,7 +26,7 @@ func (c provisioningProfileConverter) ProfileInfoToProfile(info profileutil.Prov if err != nil { return nil, err } - content, err := ioutil.ReadFile(pth) + content, err := os.ReadFile(pth) if err != nil { return nil, err } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/mock_DevPortalClient.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/mock_DevPortalClient.go index 7aabbe2..d865e10 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/mock_DevPortalClient.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/mock_DevPortalClient.go @@ -1,12 +1,12 @@ -// Code generated by mockery 2.9.4. DO NOT EDIT. +// Code generated by mockery v2.20.0. DO NOT EDIT. package autocodesign import ( - big "math/big" - appstoreconnect "github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect" + big "math/big" + devportalservice "github.com/bitrise-io/go-xcode/devportalservice" mock "github.com/stretchr/testify/mock" @@ -36,17 +36,18 @@ func (_m *MockDevPortalClient) CreateBundleID(bundleIDIdentifier string, appIDNa ret := _m.Called(bundleIDIdentifier, appIDName) var r0 *appstoreconnect.BundleID + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*appstoreconnect.BundleID, error)); ok { + return rf(bundleIDIdentifier, appIDName) + } if rf, ok := ret.Get(0).(func(string, string) *appstoreconnect.BundleID); ok { r0 = rf(bundleIDIdentifier, appIDName) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(*appstoreconnect.BundleID) - if !ok { - } + r0 = ret.Get(0).(*appstoreconnect.BundleID) } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(bundleIDIdentifier, appIDName) } else { @@ -61,17 +62,18 @@ func (_m *MockDevPortalClient) CreateProfile(name string, profileType appstoreco ret := _m.Called(name, profileType, bundleID, certificateIDs, deviceIDs) var r0 Profile + var r1 error + if rf, ok := ret.Get(0).(func(string, appstoreconnect.ProfileType, appstoreconnect.BundleID, []string, []string) (Profile, error)); ok { + return rf(name, profileType, bundleID, certificateIDs, deviceIDs) + } if rf, ok := ret.Get(0).(func(string, appstoreconnect.ProfileType, appstoreconnect.BundleID, []string, []string) Profile); ok { r0 = rf(name, profileType, bundleID, certificateIDs, deviceIDs) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(Profile) - if !ok { - } + r0 = ret.Get(0).(Profile) } } - var r1 error if rf, ok := ret.Get(1).(func(string, appstoreconnect.ProfileType, appstoreconnect.BundleID, []string, []string) error); ok { r1 = rf(name, profileType, bundleID, certificateIDs, deviceIDs) } else { @@ -100,17 +102,18 @@ func (_m *MockDevPortalClient) FindBundleID(bundleIDIdentifier string) (*appstor ret := _m.Called(bundleIDIdentifier) var r0 *appstoreconnect.BundleID + var r1 error + if rf, ok := ret.Get(0).(func(string) (*appstoreconnect.BundleID, error)); ok { + return rf(bundleIDIdentifier) + } if rf, ok := ret.Get(0).(func(string) *appstoreconnect.BundleID); ok { r0 = rf(bundleIDIdentifier) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(*appstoreconnect.BundleID) - if !ok { - } + r0 = ret.Get(0).(*appstoreconnect.BundleID) } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(bundleIDIdentifier) } else { @@ -125,17 +128,18 @@ func (_m *MockDevPortalClient) FindProfile(name string, profileType appstoreconn ret := _m.Called(name, profileType) var r0 Profile + var r1 error + if rf, ok := ret.Get(0).(func(string, appstoreconnect.ProfileType) (Profile, error)); ok { + return rf(name, profileType) + } if rf, ok := ret.Get(0).(func(string, appstoreconnect.ProfileType) Profile); ok { r0 = rf(name, profileType) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(Profile) - if !ok { - } + r0 = ret.Get(0).(Profile) } } - var r1 error if rf, ok := ret.Get(1).(func(string, appstoreconnect.ProfileType) error); ok { r1 = rf(name, profileType) } else { @@ -150,17 +154,18 @@ func (_m *MockDevPortalClient) ListDevices(UDID string, platform appstoreconnect ret := _m.Called(UDID, platform) var r0 []appstoreconnect.Device + var r1 error + if rf, ok := ret.Get(0).(func(string, appstoreconnect.DevicePlatform) ([]appstoreconnect.Device, error)); ok { + return rf(UDID, platform) + } if rf, ok := ret.Get(0).(func(string, appstoreconnect.DevicePlatform) []appstoreconnect.Device); ok { r0 = rf(UDID, platform) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).([]appstoreconnect.Device) - if !ok { - } + r0 = ret.Get(0).([]appstoreconnect.Device) } } - var r1 error if rf, ok := ret.Get(1).(func(string, appstoreconnect.DevicePlatform) error); ok { r1 = rf(UDID, platform) } else { @@ -170,22 +175,37 @@ func (_m *MockDevPortalClient) ListDevices(UDID string, platform appstoreconnect return r0, r1 } +// Login provides a mock function with given fields: +func (_m *MockDevPortalClient) Login() error { + ret := _m.Called() + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + // QueryAllIOSCertificates provides a mock function with given fields: func (_m *MockDevPortalClient) QueryAllIOSCertificates() (map[appstoreconnect.CertificateType][]Certificate, error) { ret := _m.Called() var r0 map[appstoreconnect.CertificateType][]Certificate + var r1 error + if rf, ok := ret.Get(0).(func() (map[appstoreconnect.CertificateType][]Certificate, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() map[appstoreconnect.CertificateType][]Certificate); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(map[appstoreconnect.CertificateType][]Certificate) - if !ok { - } + r0 = ret.Get(0).(map[appstoreconnect.CertificateType][]Certificate) } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -200,15 +220,16 @@ func (_m *MockDevPortalClient) QueryCertificateBySerial(serial big.Int) (Certifi ret := _m.Called(serial) var r0 Certificate + var r1 error + if rf, ok := ret.Get(0).(func(big.Int) (Certificate, error)); ok { + return rf(serial) + } if rf, ok := ret.Get(0).(func(big.Int) Certificate); ok { r0 = rf(serial) } else { - r0, ok = ret.Get(0).(Certificate) - if !ok { - } + r0 = ret.Get(0).(Certificate) } - var r1 error if rf, ok := ret.Get(1).(func(big.Int) error); ok { r1 = rf(serial) } else { @@ -223,17 +244,18 @@ func (_m *MockDevPortalClient) RegisterDevice(testDevice devportalservice.TestDe ret := _m.Called(testDevice) var r0 *appstoreconnect.Device + var r1 error + if rf, ok := ret.Get(0).(func(devportalservice.TestDevice) (*appstoreconnect.Device, error)); ok { + return rf(testDevice) + } if rf, ok := ret.Get(0).(func(devportalservice.TestDevice) *appstoreconnect.Device); ok { r0 = rf(testDevice) } else { if ret.Get(0) != nil { - r0, ok = ret.Get(0).(*appstoreconnect.Device) - if !ok { - } + r0 = ret.Get(0).(*appstoreconnect.Device) } } - var r1 error if rf, ok := ret.Get(1).(func(devportalservice.TestDevice) error); ok { r1 = rf(testDevice) } else { @@ -256,3 +278,18 @@ func (_m *MockDevPortalClient) SyncBundleID(bundleID appstoreconnect.BundleID, a return r0 } + +type mockConstructorTestingTNewMockDevPortalClient interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockDevPortalClient creates a new instance of MockDevPortalClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockDevPortalClient(t mockConstructorTestingTNewMockDevPortalClient) *MockDevPortalClient { + mock := &MockDevPortalClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/projectmanager/projecthelper.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/projectmanager/projecthelper.go index 99de122..8f3a33a 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/projectmanager/projecthelper.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/projectmanager/projecthelper.go @@ -448,7 +448,7 @@ func findBuiltProject(pth, schemeName string) (xcodeproj.XcodeProj, xcscheme.Sch scheme, schemeContainerDir, err := schemeint.Scheme(pth, schemeName) if err != nil { - return xcodeproj.XcodeProj{}, xcscheme.Scheme{}, fmt.Errorf("could not get scheme with name %s from path %s", schemeName, pth) + return xcodeproj.XcodeProj{}, xcscheme.Scheme{}, fmt.Errorf("could not get scheme with name %s from path %s: %w", schemeName, pth, err) } archiveEntry, archivable := scheme.AppBuildActionEntry() diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/codesign/codesign.go b/vendor/github.com/bitrise-io/go-xcode/v2/codesign/codesign.go index ec425a7..2fe3460 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/codesign/codesign.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/codesign/codesign.go @@ -2,6 +2,7 @@ package codesign import ( "fmt" + "time" "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-xcode/appleauth" @@ -231,6 +232,12 @@ func SelectConnectionCredentials( return appleauth.Credentials{}, fmt.Errorf("failed to restore Apple ID login session: %w", err) } + if session != "" && + bitriseConnection.AppleIDConnection.SessionExpiryDate != nil && + bitriseConnection.AppleIDConnection.SessionExpiryDate.Before(time.Now()) { + logger.Warnf("Two-factor session has expired at: %s", bitriseConnection.AppleIDConnection.SessionExpiryDate.Format("2006-01-02 15:04")) + } + logger.Donef("Using Apple Service connection with Apple ID.") return appleauth.Credentials{ AppleID: &appleauth.AppleID{ @@ -354,7 +361,6 @@ func (m *Manager) registerTestDevices(credentials appleauth.Credentials, devices } func (m *Manager) prepareCodeSigningWithBitrise(credentials appleauth.Credentials, testDevices []devportalservice.TestDevice) error { - // Analyze project fmt.Println() m.logger.TDebugf("Analyzing project") appLayout, err := m.detailsProvider.GetAppLayout(m.opts.SignUITests) @@ -362,11 +368,6 @@ func (m *Manager) prepareCodeSigningWithBitrise(credentials appleauth.Credential return err } - devPortalClient, err := m.devPortalClientFactory.Create(credentials, m.opts.TeamID) - if err != nil { - return err - } - fmt.Println() m.logger.TDebugf("Downloading certificates") certs, err := m.downloadCertificates() @@ -379,21 +380,12 @@ func (m *Manager) prepareCodeSigningWithBitrise(credentials appleauth.Credential return err } - manager := autocodesign.NewCodesignAssetManager(devPortalClient, m.assetInstaller, m.localCodeSignAssetManager) - - // Fetch and apply codesigning assets var testDevicesToRegister []devportalservice.TestDevice if m.opts.RegisterTestDevices { testDevicesToRegister = testDevices } - codesignAssetsByDistributionType, err := manager.EnsureCodesignAssets(appLayout, autocodesign.CodesignAssetsOpts{ - DistributionType: m.opts.ExportMethod, - TypeToLocalCertificates: typeToLocalCerts, - BitriseTestDevices: testDevicesToRegister, - MinProfileValidityDays: m.opts.MinDaysProfileValidity, - VerboseLog: m.opts.IsVerboseLog, - }) + codesignAssetsByDistributionType, err := m.prepareAutomaticAssets(credentials, appLayout, typeToLocalCerts, testDevicesToRegister) if err != nil { if !m.fallbackProfileDownloader.IsAvailable() { return err @@ -416,6 +408,32 @@ func (m *Manager) prepareCodeSigningWithBitrise(credentials appleauth.Credential return nil } +func (m *Manager) prepareAutomaticAssets(credentials appleauth.Credentials, appLayout autocodesign.AppLayout, typeToLocalCerts autocodesign.LocalCertificates, testDevicesToRegister []devportalservice.TestDevice) (map[autocodesign.DistributionType]autocodesign.AppCodesignAssets, error) { + devPortalClient, err := m.devPortalClientFactory.Create(credentials, m.opts.TeamID) + if err != nil { + return nil, err + } + + if err := devPortalClient.Login(); err != nil { + return nil, fmt.Errorf("Developer Portal client login failed: %w", err) + } + + manager := autocodesign.NewCodesignAssetManager(devPortalClient, m.assetInstaller, m.localCodeSignAssetManager) + + codesignAssets, err := manager.EnsureCodesignAssets(appLayout, autocodesign.CodesignAssetsOpts{ + DistributionType: m.opts.ExportMethod, + TypeToLocalCertificates: typeToLocalCerts, + BitriseTestDevices: testDevicesToRegister, + MinProfileValidityDays: m.opts.MinDaysProfileValidity, + VerboseLog: m.opts.IsVerboseLog, + }) + if err != nil { + return nil, fmt.Errorf("failed to ensure code signing assets: %w", err) + } + + return codesignAssets, nil +} + func (m *Manager) prepareManualAssets(certificates []certificateutil.CertificateInfoModel) error { if err := m.installCertificates(certificates); err != nil { return err diff --git a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj/schemes.go b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj/schemes.go index c08305c..8a64432 100644 --- a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj/schemes.go +++ b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj/schemes.go @@ -43,7 +43,7 @@ func (p XcodeProj) Schemes() ([]xcscheme.Scheme, error) { isAutocreateSchemesEnabled, err := p.isAutocreateSchemesEnabled() if err != nil { - return nil, err + return nil, fmt.Errorf("failed to read the project autocreate scheme option: %w", err) } if isAutocreateSchemesEnabled { @@ -60,6 +60,8 @@ func (p XcodeProj) Schemes() ([]xcscheme.Scheme, error) { } // SchemesWithAutocreateEnabled returns the schemes considered by Xcode, when opening the given project as part of a workspace. +// THIS SHOULD BE CALLED ONLY BY A WORKSPACE. If you want to get the schemes directly, please call XcodeProj.Schemes. +// // SchemesWithAutocreateEnabled behaves similarly to XcodeProj.Schemes, // the only difference is that the 'Autocreate schemes' option is coming from the workspace settings. func (p XcodeProj) SchemesWithAutocreateEnabled(isAutocreateSchemesEnabled bool) ([]xcscheme.Scheme, error) { @@ -88,10 +90,15 @@ func (p XcodeProj) SchemesWithAutocreateEnabled(isAutocreateSchemesEnabled bool) return defaultSchemes, nil } - return nil, fmt.Errorf("no schemes found and the Xcode project's 'Autocreate schemes' option is disabled") + log.TDebugf("No schemes found") + + // It is perfectly fine if a project does not contain any accessible schemes at all. + // For example, the Pods.xcodeproj file generated by a newer Cocoapods version is such a project file. + return nil, nil } log.TDebugf("%d scheme(s) found", len(schemes)) + return schemes, nil } diff --git a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/file_ref.go b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/file_ref.go index c22b816..3f2a3e3 100644 --- a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/file_ref.go +++ b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/file_ref.go @@ -38,7 +38,7 @@ func (f FileRef) TypeAndPath() (FileRefType, string, error) { case "container": return ContainerFileRefType, s[1], nil default: - return "", "", fmt.Errorf("unknown file reference type: %s", s[0]) + return "", "", fmt.Errorf("unknown file reference type: %s, value: %s", s[0], s[1]) } } diff --git a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/schemes.go b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/schemes.go index b0f07b8..d9265d3 100644 --- a/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/schemes.go +++ b/vendor/github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace/schemes.go @@ -26,12 +26,12 @@ func (w Workspace) Schemes() (map[string][]xcscheme.Scheme, error) { sharedSchemes, err := w.sharedSchemes() if err != nil { - return nil, err + return nil, fmt.Errorf("failed to read shared schemes: %w", err) } userSchemes, err := w.userSchemes() if err != nil { - return nil, err + return nil, fmt.Errorf("failed to read user schemes: %w", err) } workspaceSchemes := append(sharedSchemes, userSchemes...) @@ -44,17 +44,17 @@ func (w Workspace) Schemes() (map[string][]xcscheme.Scheme, error) { // project schemes projectLocations, err := w.ProjectFileLocations() if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get project locations from workspace: %w", err) } isAutocreateSchemesEnabled, err := w.isAutocreateSchemesEnabled() if err != nil { - return nil, err + return nil, fmt.Errorf("failed to read the workspace autocreate scheme option: %w", err) } for _, projectLocation := range projectLocations { if exist, err := pathutil.IsPathExists(projectLocation); err != nil { - return nil, fmt.Errorf("failed to check if project exist at: %s, error: %s", projectLocation, err) + return nil, fmt.Errorf("failed to check if project (%s) exists: %w", projectLocation, err) } else if !exist { // at this point we are interested the schemes visible for the workspace continue @@ -62,12 +62,12 @@ func (w Workspace) Schemes() (map[string][]xcscheme.Scheme, error) { project, err := xcodeproj.Open(projectLocation) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to open project (%s): %w", projectLocation, err) } projectSchemes, err := project.SchemesWithAutocreateEnabled(isAutocreateSchemesEnabled) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to read project (%s) schemes: %w", projectLocation, err) } if len(projectSchemes) > 0 { @@ -179,7 +179,7 @@ func (w Workspace) isAutocreateSchemesEnabled() (bool, error) { var settings serialized.Object if _, err := plist.Unmarshal(workspaceSettingsContent, &settings); err != nil { - return false, err + return false, fmt.Errorf("failed to unmarshall settings: %w", err) } autoCreate, err := settings.Bool("IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded") diff --git a/vendor/github.com/golang-jwt/jwt/v4/README.md b/vendor/github.com/golang-jwt/jwt/v4/README.md index 01b2164..30f2f2a 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/README.md +++ b/vendor/github.com/golang-jwt/jwt/v4/README.md @@ -36,24 +36,39 @@ The part in the middle is the interesting bit. It's called the Claims and conta This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. +## Installation Guidelines + +1. To install the jwt package, you first need to have [Go](https://go.dev/doc/install) installed, then you can use the command below to add `jwt-go` as a dependency in your Go program. + +```sh +go get -u github.com/golang-jwt/jwt/v4 +``` + +2. Import it in your code: + +```go +import "github.com/golang-jwt/jwt/v4" +``` + ## Examples -See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt) for examples of usage: +See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt/v4) for examples of usage: -* [Simple example of parsing and validating a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-Parse-Hmac) -* [Simple example of building and signing a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-New-Hmac) -* [Directory of Examples](https://pkg.go.dev/github.com/golang-jwt/jwt#pkg-examples) +* [Simple example of parsing and validating a token](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#example-Parse-Hmac) +* [Simple example of building and signing a token](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#example-New-Hmac) +* [Directory of Examples](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#pkg-examples) ## Extensions -This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. +This library publishes all the necessary components for adding your own signing methods or key functions. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod` or provide a `jwt.Keyfunc`. -A common use case would be integrating with different 3rd party signature providers, like key management services from various cloud providers or Hardware Security Modules (HSMs). +A common use case would be integrating with different 3rd party signature providers, like key management services from various cloud providers or Hardware Security Modules (HSMs) or to implement additional standards. -| Extension | Purpose | Repo | -|-----------|----------------------------------------------------------------------------------------------|--------------------------------------------| -| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go | -| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms | +| Extension | Purpose | Repo | +| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------ | +| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go | +| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms | +| JWKS | Provides support for JWKS ([RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517)) as a `jwt.Keyfunc` | https://github.com/MicahParks/keyfunc | *Disclaimer*: Unless otherwise specified, these integrations are maintained by third parties and should not be considered as a primary offer by any of the mentioned cloud providers @@ -81,7 +96,7 @@ A token is simply a JSON object that is signed by its author. this tells you exa * The author of the token was in the possession of the signing secret * The data has not been modified since it was signed -It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. +It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. The companion project https://github.com/golang-jwt/jwe aims at a (very) experimental implementation of the JWE standard. ### Choosing a Signing Method @@ -95,10 +110,10 @@ Asymmetric signing methods, such as RSA, use different keys for signing and veri Each signing method expects a different object type for its signing keys. See the package documentation for details. Here are the most common ones: -* The [HMAC signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation -* The [RSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation -* The [ECDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation -* The [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodEd25519) (`Ed25519`) expect `ed25519.PrivateKey` for signing and `ed25519.PublicKey` for validation +* The [HMAC signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation +* The [RSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation +* The [ECDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation +* The [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodEd25519) (`Ed25519`) expect `ed25519.PrivateKey` for signing and `ed25519.PublicKey` for validation ### JWT and OAuth @@ -116,7 +131,7 @@ This library uses descriptive error messages whenever possible. If you are not g ## More -Documentation can be found [on pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt). +Documentation can be found [on pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt/v4). The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in the documentation. diff --git a/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md b/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md new file mode 100644 index 0000000..b08402c --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +As of February 2022 (and until this document is updated), the latest version `v4` is supported. + +## Reporting a Vulnerability + +If you think you found a vulnerability, and even if you are not sure, please report it to jwt-go-security@googlegroups.com or one of the other [golang-jwt maintainers](https://github.com/orgs/golang-jwt/people). Please try be explicit, describe steps to reproduce the security issue with code example(s). + +You will receive a response within a timely manner. If the issue is confirmed, we will do our best to release a patch as soon as possible given the complexity of the problem. + +## Public Discussions + +Please avoid publicly discussing a potential security vulnerability. + +Let's take this offline and find a solution first, this limits the potential impact as much as possible. + +We appreciate your help! diff --git a/vendor/github.com/golang-jwt/jwt/v4/claims.go b/vendor/github.com/golang-jwt/jwt/v4/claims.go index 9d95cad..364cec8 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/claims.go +++ b/vendor/github.com/golang-jwt/jwt/v4/claims.go @@ -265,9 +265,5 @@ func verifyIss(iss string, cmp string, required bool) bool { if iss == "" { return !required } - if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 { - return true - } else { - return false - } + return subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 } diff --git a/vendor/github.com/golang-jwt/jwt/v4/parser.go b/vendor/github.com/golang-jwt/jwt/v4/parser.go index 2f61a69..c0a6f69 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/parser.go +++ b/vendor/github.com/golang-jwt/jwt/v4/parser.go @@ -42,6 +42,13 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) } +// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims +// interface. This provides default values which can be overridden and allows a caller to use their own type, rather +// than the default MapClaims implementation of Claims. +// +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), +// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the +// proper memory for it before passing in the overall claims, otherwise you might run into a panic. func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { token, parts, err := p.ParseUnverified(tokenString, claims) if err != nil { diff --git a/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go b/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go index 5a8502f..4fd6f9e 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go +++ b/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go @@ -1,3 +1,4 @@ +//go:build go1.4 // +build go1.4 package jwt diff --git a/vendor/github.com/golang-jwt/jwt/v4/token.go b/vendor/github.com/golang-jwt/jwt/v4/token.go index 09b4cde..786b275 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/token.go +++ b/vendor/github.com/golang-jwt/jwt/v4/token.go @@ -7,7 +7,6 @@ import ( "time" ) - // DecodePaddingAllowed will switch the codec used for decoding JWTs respectively. Note that the JWS RFC7515 // states that the tokens will utilize a Base64url encoding with no padding. Unfortunately, some implementations // of JWT are producing non-standard tokens, and thus require support for decoding. Note that this is a global @@ -15,6 +14,12 @@ import ( // To use the non-recommended decoding, set this boolean to `true` prior to using this package. var DecodePaddingAllowed bool +// DecodeStrict will switch the codec used for decoding JWTs into strict mode. +// In this mode, the decoder requires that trailing padding bits are zero, as described in RFC 4648 section 3.5. +// Note that this is a global variable, and updating it will change the behavior on a package level, and is also NOT go-routine safe. +// To use strict decoding, set this boolean to `true` prior to using this package. +var DecodeStrict bool + // TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time). // You can override it to use another time value. This is useful for testing or if your // server uses a different time zone than your tokens. @@ -100,6 +105,11 @@ func Parse(tokenString string, keyFunc Keyfunc, options ...ParserOption) (*Token return NewParser(options...).Parse(tokenString, keyFunc) } +// ParseWithClaims is a shortcut for NewParser().ParseWithClaims(). +// +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), +// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the +// proper memory for it before passing in the overall claims, otherwise you might run into a panic. func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options ...ParserOption) (*Token, error) { return NewParser(options...).ParseWithClaims(tokenString, claims, keyFunc) } @@ -117,12 +127,17 @@ func EncodeSegment(seg []byte) string { // Deprecated: In a future release, we will demote this function to a non-exported function, since it // should only be used internally func DecodeSegment(seg string) ([]byte, error) { + encoding := base64.RawURLEncoding + if DecodePaddingAllowed { if l := len(seg) % 4; l > 0 { seg += strings.Repeat("=", 4-l) } - return base64.URLEncoding.DecodeString(seg) + encoding = base64.URLEncoding } - return base64.RawURLEncoding.DecodeString(seg) + if DecodeStrict { + encoding = encoding.Strict() + } + return encoding.DecodeString(seg) } diff --git a/vendor/github.com/golang-jwt/jwt/v4/types.go b/vendor/github.com/golang-jwt/jwt/v4/types.go index 2c647fd..ac8e140 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/types.go +++ b/vendor/github.com/golang-jwt/jwt/v4/types.go @@ -53,9 +53,23 @@ func (date NumericDate) MarshalJSON() (b []byte, err error) { if TimePrecision < time.Second { prec = int(math.Log10(float64(time.Second) / float64(TimePrecision))) } - f := float64(date.Truncate(TimePrecision).UnixNano()) / float64(time.Second) - - return []byte(strconv.FormatFloat(f, 'f', prec, 64)), nil + truncatedDate := date.Truncate(TimePrecision) + + // For very large timestamps, UnixNano would overflow an int64, but this + // function requires nanosecond level precision, so we have to use the + // following technique to get round the issue: + // 1. Take the normal unix timestamp to form the whole number part of the + // output, + // 2. Take the result of the Nanosecond function, which retuns the offset + // within the second of the particular unix time instance, to form the + // decimal part of the output + // 3. Concatenate them to produce the final result + seconds := strconv.FormatInt(truncatedDate.Unix(), 10) + nanosecondsOffset := strconv.FormatFloat(float64(truncatedDate.Nanosecond())/float64(time.Second), 'f', prec, 64) + + output := append([]byte(seconds), []byte(nanosecondsOffset)[1:]...) + + return output, nil } // UnmarshalJSON is an implementation of the json.RawMessage interface and deserializses a diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md new file mode 100644 index 0000000..33686e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md @@ -0,0 +1,9 @@ +## 0.7.4 (Jun 6, 2023) + +BUG FIXES + +- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 [GH-194] + +## 0.7.3 (May 15, 2023) + +Initial release diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS new file mode 100644 index 0000000..f8389c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS @@ -0,0 +1 @@ +* @hashicorp/release-engineering \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE index e87a115..f4f97ee 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE +++ b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2015 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-retryablehttp/README.md b/vendor/github.com/hashicorp/go-retryablehttp/README.md index 09f5eaf..8943bec 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/README.md +++ b/vendor/github.com/hashicorp/go-retryablehttp/README.md @@ -45,25 +45,6 @@ The returned response object is an `*http.Response`, the same thing you would usually get from `net/http`. Had the request failed one or more times, the above call would block and retry with exponential backoff. -## Retrying cases that fail after a seeming success - -It's possible for a request to succeed in the sense that the expected response headers are received, but then to encounter network-level errors while reading the response body. In go-retryablehttp's most basic usage, this error would not be retryable, due to the out-of-band handling of the response body. In some cases it may be desirable to handle the response body as part of the retryable operation. - -A toy example (which will retry the full request and succeed on the second attempt) is shown below: - -```go -c := retryablehttp.NewClient() -r := retryablehttp.NewRequest("GET", "://foo", nil) -handlerShouldRetry := true -r.SetResponseHandler(func(*http.Response) error { - if !handlerShouldRetry { - return nil - } - handlerShouldRetry = false - return errors.New("retryable error") -}) -``` - ## Getting a stdlib `*http.Client` with retries It's possible to convert a `*retryablehttp.Client` directly to a `*http.Client`. diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go index 57116e9..cad96bd 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package retryablehttp provides a familiar HTTP client interface with // automatic retries and exponential backoff. It is a thin wrapper over the // standard net/http client library and exposes nearly the same public API. @@ -80,8 +83,15 @@ var ( type ReaderFunc func() (io.Reader, error) // ResponseHandlerFunc is a type of function that takes in a Response, and does something with it. -// It only runs if the initial part of the request was successful. -// If an error is returned, the client's retry policy will be used to determine whether to retry the whole request. +// The ResponseHandlerFunc is called when the HTTP client successfully receives a response and the +// CheckRetry function indicates that a retry of the base request is not necessary. +// If an error is returned from this function, the CheckRetry policy will be used to determine +// whether to retry the whole request (including this handler). +// +// Make sure to check status codes! Even if the request was completed it may have a non-2xx status code. +// +// The response body is not automatically closed. It must be closed either by the ResponseHandlerFunc or +// by the caller out-of-band. Failure to do so will result in a memory leak. type ResponseHandlerFunc func(*http.Response) error // LenReader is an interface implemented by many in-memory io.Reader's. Used @@ -250,10 +260,17 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro if err != nil { return nil, 0, err } - bodyReader = func() (io.Reader, error) { - return bytes.NewReader(buf), nil + if len(buf) == 0 { + bodyReader = func() (io.Reader, error) { + return http.NoBody, nil + } + contentLength = 0 + } else { + bodyReader = func() (io.Reader, error) { + return bytes.NewReader(buf), nil + } + contentLength = int64(len(buf)) } - contentLength = int64(len(buf)) // No body provided, nothing to do case nil: diff --git a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go index 8f3ee35..8c407ad 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package retryablehttp import ( diff --git a/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/stretchr/objx/README.md index 246660b..736e1eb 100644 --- a/vendor/github.com/stretchr/objx/README.md +++ b/vendor/github.com/stretchr/objx/README.md @@ -4,20 +4,20 @@ [![Maintainability](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/maintainability)](https://codeclimate.com/github/stretchr/objx/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/test_coverage)](https://codeclimate.com/github/stretchr/objx/test_coverage) [![Sourcegraph](https://sourcegraph.com/github.com/stretchr/objx/-/badge.svg)](https://sourcegraph.com/github.com/stretchr/objx) -[![GoDoc](https://godoc.org/github.com/stretchr/objx?status.svg)](https://godoc.org/github.com/stretchr/objx) +[![GoDoc](https://pkg.go.dev/badge/github.com/stretchr/objx?utm_source=godoc)](https://pkg.go.dev/github.com/stretchr/objx) Objx - Go package for dealing with maps, slices, JSON and other data. Get started: - Install Objx with [one line of code](#installation), or [update it with another](#staying-up-to-date) -- Check out the API Documentation http://godoc.org/github.com/stretchr/objx +- Check out the API Documentation http://pkg.go.dev/github.com/stretchr/objx ## Overview Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc. ### Pattern -Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: +Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: m, err := objx.FromJSON(json) @@ -74,7 +74,7 @@ To update Objx to the latest version, run: go get -u github.com/stretchr/objx ### Supported go versions -We support the lastest three major Go versions, which are 1.10, 1.11 and 1.12 at the moment. +We currently support the most recent major Go versions from 1.13 onward. ## Contributing Please feel free to submit issues, fork the repository and send pull requests! diff --git a/vendor/github.com/stretchr/objx/Taskfile.yml b/vendor/github.com/stretchr/objx/Taskfile.yml index 7746f51..39f49d5 100644 --- a/vendor/github.com/stretchr/objx/Taskfile.yml +++ b/vendor/github.com/stretchr/objx/Taskfile.yml @@ -1,8 +1,5 @@ version: '2' -env: - GOFLAGS: -mod=vendor - tasks: default: deps: [test] diff --git a/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/stretchr/objx/accessors.go index 4c60455..72f1d1c 100644 --- a/vendor/github.com/stretchr/objx/accessors.go +++ b/vendor/github.com/stretchr/objx/accessors.go @@ -14,17 +14,17 @@ const ( // For example, `location.address.city` PathSeparator string = "." - // arrayAccesRegexString is the regex used to extract the array number + // arrayAccessRegexString is the regex used to extract the array number // from the access path - arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` + arrayAccessRegexString = `^(.+)\[([0-9]+)\]$` // mapAccessRegexString is the regex used to extract the map key // from the access path mapAccessRegexString = `^([^\[]*)\[([^\]]+)\](.*)$` ) -// arrayAccesRegex is the compiled arrayAccesRegexString -var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString) +// arrayAccessRegex is the compiled arrayAccessRegexString +var arrayAccessRegex = regexp.MustCompile(arrayAccessRegexString) // mapAccessRegex is the compiled mapAccessRegexString var mapAccessRegex = regexp.MustCompile(mapAccessRegexString) @@ -37,11 +37,11 @@ var mapAccessRegex = regexp.MustCompile(mapAccessRegexString) // // Get can only operate directly on map[string]interface{} and []interface. // -// Example +// # Example // // To access the title of the third chapter of the second book, do: // -// o.Get("books[1].chapters[2].title") +// o.Get("books[1].chapters[2].title") func (m Map) Get(selector string) *Value { rawObj := access(m, selector, nil, false) return &Value{data: rawObj} @@ -52,26 +52,26 @@ func (m Map) Get(selector string) *Value { // // Set can only operate directly on map[string]interface{} and []interface // -// Example +// # Example // // To set the title of the third chapter of the second book, do: // -// o.Set("books[1].chapters[2].title","Time to Go") +// o.Set("books[1].chapters[2].title","Time to Go") func (m Map) Set(selector string, value interface{}) Map { access(m, selector, value, true) return m } -// getIndex returns the index, which is hold in s by two braches. -// It also returns s withour the index part, e.g. name[1] will return (1, name). +// getIndex returns the index, which is hold in s by two branches. +// It also returns s without the index part, e.g. name[1] will return (1, name). // If no index is found, -1 is returned func getIndex(s string) (int, string) { - arrayMatches := arrayAccesRegex.FindStringSubmatch(s) + arrayMatches := arrayAccessRegex.FindStringSubmatch(s) if len(arrayMatches) > 0 { // Get the key into the map selector := arrayMatches[1] // Get the index into the array at the key - // We know this cannt fail because arrayMatches[2] is an int for sure + // We know this can't fail because arrayMatches[2] is an int for sure index, _ := strconv.Atoi(arrayMatches[2]) return index, selector } diff --git a/vendor/github.com/stretchr/objx/conversions.go b/vendor/github.com/stretchr/objx/conversions.go index 080aa46..01c63d7 100644 --- a/vendor/github.com/stretchr/objx/conversions.go +++ b/vendor/github.com/stretchr/objx/conversions.go @@ -15,7 +15,7 @@ import ( const SignatureSeparator = "_" // URLValuesSliceKeySuffix is the character that is used to -// specify a suffic for slices parsed by URLValues. +// specify a suffix for slices parsed by URLValues. // If the suffix is set to "[i]", then the index of the slice // is used in place of i // Ex: Suffix "[]" would have the form a[]=b&a[]=c @@ -30,7 +30,7 @@ const ( ) // SetURLValuesSliceKeySuffix sets the character that is used to -// specify a suffic for slices parsed by URLValues. +// specify a suffix for slices parsed by URLValues. // If the suffix is set to "[i]", then the index of the slice // is used in place of i // Ex: Suffix "[]" would have the form a[]=b&a[]=c diff --git a/vendor/github.com/stretchr/objx/doc.go b/vendor/github.com/stretchr/objx/doc.go index 6d6af1a..b170af7 100644 --- a/vendor/github.com/stretchr/objx/doc.go +++ b/vendor/github.com/stretchr/objx/doc.go @@ -1,19 +1,19 @@ /* -Objx - Go package for dealing with maps, slices, JSON and other data. +Package objx provides utilities for dealing with maps, slices, JSON and other data. -Overview +# Overview Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc. -Pattern +# Pattern -Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy. +Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: - m, err := objx.FromJSON(json) + m, err := objx.FromJSON(json) NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking. @@ -21,46 +21,46 @@ the rest will be optimistic and try to figure things out without panicking. Use `Get` to access the value you're interested in. You can use dot and array notation too: - m.Get("places[0].latlng") + m.Get("places[0].latlng") Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type. - if m.Get("code").IsStr() { // Your code... } + if m.Get("code").IsStr() { // Your code... } Or you can just assume the type, and use one of the strong type methods to extract the real value: - m.Get("code").Int() + m.Get("code").Int() If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value. - Get("code").Int(-1) + Get("code").Int(-1) If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below. -Reading data +# Reading data A simple example of how to use Objx: - // Use MustFromJSON to make an objx.Map from some JSON - m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) + // Use MustFromJSON to make an objx.Map from some JSON + m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) - // Get the details - name := m.Get("name").Str() - age := m.Get("age").Int() + // Get the details + name := m.Get("name").Str() + age := m.Get("age").Int() - // Get their nickname (or use their name if they don't have one) - nickname := m.Get("nickname").Str(name) + // Get their nickname (or use their name if they don't have one) + nickname := m.Get("nickname").Str(name) -Ranging +# Ranging Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect: - m := objx.MustFromJSON(json) - for key, value := range m { - // Your code... - } + m := objx.MustFromJSON(json) + for key, value := range m { + // Your code... + } */ package objx diff --git a/vendor/github.com/stretchr/objx/map.go b/vendor/github.com/stretchr/objx/map.go index a64712a..ab9f9ae 100644 --- a/vendor/github.com/stretchr/objx/map.go +++ b/vendor/github.com/stretchr/objx/map.go @@ -47,17 +47,16 @@ func New(data interface{}) Map { // // The arguments follow a key, value pattern. // -// // Returns nil if any key argument is non-string or if there are an odd number of arguments. // -// Example +// # Example // // To easily create Maps: // -// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) +// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) // -// // creates an Map equivalent to -// m := objx.Map{"name": "Mat", "age": 29, "subobj": objx.Map{"active": true}} +// // creates an Map equivalent to +// m := objx.Map{"name": "Mat", "age": 29, "subobj": objx.Map{"active": true}} func MSI(keyAndValuePairs ...interface{}) Map { newMap := Map{} keyAndValuePairsLen := len(keyAndValuePairs) diff --git a/vendor/modules.txt b/vendor/modules.txt index 712b6f7..31e7036 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,11 +10,11 @@ github.com/bitrise-io/go-plist github.com/bitrise-io/go-steputils/input github.com/bitrise-io/go-steputils/output github.com/bitrise-io/go-steputils/tools -# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2 -## explicit; go 1.16 +# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18 +## explicit; go 1.17 github.com/bitrise-io/go-steputils/v2/ruby github.com/bitrise-io/go-steputils/v2/stepconf -# github.com/bitrise-io/go-utils v1.0.9 +# github.com/bitrise-io/go-utils v1.0.12 ## explicit; go 1.13 github.com/bitrise-io/go-utils/colorstring github.com/bitrise-io/go-utils/command @@ -23,21 +23,21 @@ github.com/bitrise-io/go-utils/filedownloader github.com/bitrise-io/go-utils/fileutil github.com/bitrise-io/go-utils/httputil github.com/bitrise-io/go-utils/log -github.com/bitrise-io/go-utils/parseutil github.com/bitrise-io/go-utils/pathutil -github.com/bitrise-io/go-utils/pointers github.com/bitrise-io/go-utils/pretty github.com/bitrise-io/go-utils/retry github.com/bitrise-io/go-utils/sliceutil github.com/bitrise-io/go-utils/stringutil github.com/bitrise-io/go-utils/ziputil -# github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11 -## explicit; go 1.16 +# github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 +## explicit; go 1.17 github.com/bitrise-io/go-utils/v2/command github.com/bitrise-io/go-utils/v2/env github.com/bitrise-io/go-utils/v2/log +github.com/bitrise-io/go-utils/v2/log/colorstring +github.com/bitrise-io/go-utils/v2/pathutil github.com/bitrise-io/go-utils/v2/retryhttp -# github.com/bitrise-io/go-xcode v1.0.16 +# github.com/bitrise-io/go-xcode v1.0.18 ## explicit; go 1.20 github.com/bitrise-io/go-xcode/appleauth github.com/bitrise-io/go-xcode/certificateutil @@ -55,8 +55,8 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.25 -## explicit; go 1.16 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.43 +## explicit; go 1.20 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader github.com/bitrise-io/go-xcode/v2/autocodesign/codesignasset @@ -77,7 +77,7 @@ github.com/davecgh/go-spew/spew # github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa ## explicit github.com/fullsailor/pkcs7 -# github.com/golang-jwt/jwt/v4 v4.4.1 +# github.com/golang-jwt/jwt/v4 v4.5.0 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 # github.com/google/go-querystring v1.1.0 @@ -86,7 +86,7 @@ github.com/google/go-querystring/query # github.com/hashicorp/go-cleanhttp v0.5.2 ## explicit; go 1.13 github.com/hashicorp/go-cleanhttp -# github.com/hashicorp/go-retryablehttp v0.7.1 +# github.com/hashicorp/go-retryablehttp v0.7.4 ## explicit; go 1.13 github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-version v1.6.0 @@ -101,8 +101,8 @@ github.com/pmezard/go-difflib/difflib # github.com/ryanuber/go-glob v1.0.0 ## explicit github.com/ryanuber/go-glob -# github.com/stretchr/objx v0.5.0 -## explicit; go 1.12 +# github.com/stretchr/objx v0.5.1 +## explicit; go 1.13 github.com/stretchr/objx # github.com/stretchr/testify v1.8.4 ## explicit; go 1.20