Skip to content

Commit b8db84c

Browse files
chore(deps): update module golang.org/x/crypto to v0.35.0 [security] (#531)
* chore(deps): update module golang.org/x/crypto to v0.35.0 [security] * TAR_OPTIONS=--skip-old-files * fix --------- Co-authored-by: descope[bot] <107609351+descope[bot]@users.noreply.github.com> Co-authored-by: Omer Cohen <[email protected]> Co-authored-by: Omer C <[email protected]>
1 parent d5ec647 commit b8db84c

File tree

14 files changed

+55
-57
lines changed

14 files changed

+55
-57
lines changed

.github/actions/setup/action.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ runs:
66
steps:
77
- name: Set up Go
88
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
9+
env:
10+
# to handle cache overwrite errors
11+
TAR_OPTIONS: --skip-old-files
912
with:
1013
go-version-file: go.mod
11-
12-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
13-
with:
14-
path: |
15-
~/.cache/go-build
16-
~/go/pkg/mod
17-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
18-
restore-keys: |
19-
${{ runner.os }}-go-

.gitleaksignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2db698a94e8f6af32c81e8e2830062ca6418077a:descope/types.go:generic-api-key:991

descope/api/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ func (c *Client) DoRequest(ctx context.Context, method, uriPath string, body io.
14771477
}
14781478

14791479
if response.Body != nil {
1480-
defer response.Body.Close()
1480+
defer func() { _ = response.Body.Close() }()
14811481
}
14821482
if !isResponseOK(response) {
14831483
err = c.parseDescopeError(response).WithInfo(descope.ErrorInfoKeys.HTTPResponseStatusCode, response.StatusCode)

descope/gin/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/descope/go-sdk/descope/gin
22

33
go 1.23
44

5+
toolchain go1.24.0
6+
57
replace github.com/descope/go-sdk => ../../
68

79
require (

descope/internal/auth/auth_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
)
2323

2424
const (
25-
jwtTokenValid = `eyJhbGciOiJFUzM4NCIsImtpZCI6InRlc3RrZXkiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidGVzdCJdLCJkcm4iOiJEUyIsImV4cCI6MzY1OTU2MTQzMCwiaWF0IjoxNjU5NTYxNDMwLCJpc3MiOiJ0ZXN0Iiwic3ViIjoic29tZXVzZXIiLCJ0ZXN0IjoidGVzdCJ9.tE6hXIuH74drymm6DSAs4FkaQSzf3MQ0D7pjC-9SaBRnqHoRuDOIJd3mIRsxzfb2nS6NX_tk6H1na6kFEKsJdMsUG-LbCqqib98z9tHtq-Jh6Axl5Qe9RITfIOwzOssw`
26-
jwtRTokenValid = `eyJhbGciOiJFUzM4NCIsImtpZCI6InRlc3RrZXkiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidGVzdCJdLCJkcm4iOiJEU1IiLCJleHAiOjM2NTk1NjE0MzAsImlhdCI6MTY1OTU2MTQzMCwiaXNzIjoidGVzdCIsInN1YiI6InNvbWV1c2VyIiwidGVzdCI6InRlc3QifQ.zKbJKuGo9Q9NsvI_SdrH1pDH8uuTRnTcT4eMJe237Lr6ZrtRGbw2a0U0aEwgNrox2RXupkmD3vfQtZiD3AiU9xHY8X3xwTGsDwA497eT6RrA13zNufrhSMNjF6V5-xVl`
27-
jwtTokenExpired = `eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzM4NCIsImtpZCI6ImU0YTU3Y2M5ZGZiNDAyYTNlNTNjNDJhNjQyMmY3M2FmIn0.eyJjb29raWVOYW1lIjoiRFMiLCJleHAiOjEyNTYyNTg2OTF9.AvU50pkQt8F000JqpVy7vCbcV-pwGqyi_GENqmmqrRMVswk5Y5VfSjP7axBnZ55xJ85sP6ozawbs_g1FdGtzvgrHEIJVRJSe73EwWTV9yZwiUD8kU-QAtUqP_Vk-rf-3zzE1lmI3DubX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DiO3EW7D35gE1CPOgITjktWSRt035TR0iV91YoPyPAkmEo3mxI4XXu-1fLcZdFFTZOOU4TmA-_wbXevf0kIaQ9Kl4jPEK9lSUHEhLG59nu_0aPVxUXqE-Y8Qo7Ed-Gri5fPhZarDtMRRpVc1pc7D8zYMyKEHvCqkdjV9MDfIK3eCVuCGUxytgEe4Px-sgPSS_7Ne8hZ1T7K3TbcoMlRl--fI6rbmcOj-2srCcofr9NX2pxeUdWU8g6ZfFFxADSfJNb0MbZz55QGN8yz-54jZR3nT7i7kXX0ylrDQw` // nolint:gosec
28+
jwtTokenNotYet = `eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzM4NCIsImtpZCI6ImU0YTU3Y2M5ZGZiNDAyYTNlNTNjNDJhNjQyMmY3M2FmIn0.eyJjb29raWVOYW1lIjoiRFMiLCJuYmYiOjI2NTYyNTg2OTF9.dvkNfmyUgbhlwv2eW_qC8VfcKYaMKaS8aDM2XdgYxnLuOhQUNnlY87H8bQGw7RChvqyJtciFo74KFhTZkAWqKDpdisIPDnydJ7SzY-NOv6Mtg0DAl99nDuItsYDoSIHVV_3h6feZC353ziQIEoktPf9dnyYpN0IumGMg-g5ww7foDglpwbIP9c6SxxDIOIMh5fGlT7tG79-i_QJ3zsDuYo0v8aNFd7QcP5tA8Kj9Tthp2pHTacu0WDSq39p6XEvDaKiLRhhVOfyd_jTTC2xzmkXRzt2KOy1ObRvhOiItQCoISn66QO4dm8febSagA2_GtDd1VYxwT0zW7usK4CwKfoSej_UMp-BZZ8Q1fDqMWfG9qWjeinfty7ePQwV2Y_kiNCjyTvKlbPnTINL_VXemb0pIaAITfROlzWtXGGnP3soFczgWe4WXC_Q7wx3uCkyN5BIKLajxCF3EAfPzDi7YbYnQXEk-imGoqWpYXw0SXMkYo2wkd9Qul4uXH_mGh50l` // nolint:gosec
2929
unknownPublicKey = `{
3030
"crv": "P-384",
3131
"key_ops": [
@@ -40,7 +40,7 @@ const (
4040
}`
4141
publicKey = `{"alg":"ES384","crv":"P-384","kid":"testkey","kty":"EC","use":"sig","x":"fcK-QcFhZooWoMPU2qIfkwBXfLIKkGm2plbS35jEQ53JqgnCaHDzLpyGaWWaIKfg","y":"IJS9pIQl3ZHh3GXi166DZgDieWGEypG9zaE3mEQrjgU-9F4qJWYDo4Fk0XS-ZJXr"}`
4242

43-
jwtTokenWithTenants = "eyJhbGciOiJFUzM4NCIsImtpZCI6InRlc3RrZXkiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidGVzdCJdLCJkcm4iOiJEUyIsImV4cCI6MzY2MDIyMzc1OSwiaWF0IjoxNjYwMjIzNzU5LCJpc3MiOiJ0ZXN0Iiwic3ViIjoic29tZXVzZXIiLCJ0ZW5hbnRzIjp7InQxIjp7fSwidDIiOnt9fX0.sIa7U18_h772xYpyFCjOXtsBtMtwWBoFNmDA-Bc-hmWciQC_5-sndtwLdaJD77t2wkoq3wAbjp6jcL1-qBSNZ6pueMdO02IbGK-mkmC439UhdQ7xs7jQXziHstMBaHT5"
43+
jwtTokenWithTenants = "eyJhbGciOiJFUzM4NCIsImtpZCI6InRlc3RrZXkiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidGVzdCJdLCJkcm4iOiJEUyIsImV4cCI6MzY2MDIyMzc1OSwiaWF0IjoxNjYwMjIzNzU5LCJpc3MiOiJ0ZXN0Iiwic3ViIjoic29tZXVzZXIiLCJ0ZW5hbnRzIjp7InQxIjp7fSwidDIiOnt9fX0.sIa7U18_h772xYpyFCjOXtsBtMtwWBoFNmDA-Bc-hmWciQC_5-sndtwLdaJD77t2wkoq3wAbjp6jcL1-qBSNZ6pueMdO02IbGK-mkmC439UhdQ7xs7jQXziHstMBaHT5" // nolint:gosec
4444
publicKeyWithTenants = `{"alg":"ES384","crv":"P-384","kid":"testkey","kty":"EC","use":"sig","x":"Ov545bC4GMh_YPMF_rHzpi2iuLk4wmQsSN_HiCS_-e1TOp2zrPPOVzjIaGWk-S4u","y":"uzQM6ROnewL6UhYkV7FNH-0sXRj3QqoaKsQmclzJSad8oYw9Q7czRDfGa0dWo7r6"}`
4545
)
4646

@@ -1217,7 +1217,7 @@ func TestMeEmptyResponse(t *testing.T) {
12171217
func TestTenants(t *testing.T) {
12181218
a, err := newTestAuth(nil, func(r *http.Request) (*http.Response, error) {
12191219
m := &map[string]any{}
1220-
readBody(r, m)
1220+
_ = readBody(r, m)
12211221
assert.EqualValues(t, map[string]any{"dct": true, "ids": nil}, *m)
12221222
res := descope.TenantsResponse{Tenants: []descope.MeTenant{{ID: "a"}}}
12231223
bs, err := utils.Marshal(res)

descope/internal/mgmt/jwt_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func TestUpdateJwt(t *testing.T) {
2525
require.EqualValues(t, refreshDuration, req["refreshDuration"])
2626

2727
}, map[string]interface{}{"jwt": expectedJWT}))
28-
jwtRes, err := mgmt.JWT().UpdateJWTWithCustomClaims(context.Background(), orgJwt, customClaims, int32(refreshDuration))
28+
jwtRes, err := mgmt.JWT().UpdateJWTWithCustomClaims(context.Background(), orgJwt, customClaims,
29+
int32(refreshDuration)) // nolint:gosec
2930
require.NoError(t, err)
3031
require.EqualValues(t, expectedJWT, jwtRes)
3132
}
@@ -94,8 +95,8 @@ func TestImpersonateMissingImpersonator(t *testing.T) {
9495
require.Empty(t, jwtRes)
9596
}
9697

97-
const jwtTokenValid = `eyJhbGciOiJFUzM4NCIsImtpZCI6InRlc3RrZXkiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidGVzdCJdLCJkcm4iOiJEUyIsImV4cCI6MzY1OTU2MTQzMCwiaWF0IjoxNjU5NTYxNDMwLCJpc3MiOiJ0ZXN0Iiwic3ViIjoic29tZXVzZXIiLCJ0ZXN0IjoidGVzdCJ9.tE6hXIuH74drymm6DSAs4FkaQSzf3MQ0D7pjC-9SaBRnqHoRuDOIJd3mIRsxzfb2nS6NX_tk6H1na6kFEKsJdMsUG-LbCqqib98z9tHtq-Jh6Axl5Qe9RITfIOw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100

100101
func TestSignIn(t *testing.T) {
101102
loginID := "id2"

descope/tests/mocks/auth/authenticationmock.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type MockMagicLink struct {
7474
SignUpOrInAssert func(method descope.DeliveryMethod, loginID string, URI string, signUpOptions *descope.SignUpOptions)
7575
SignUpOrInError error
7676

77-
VerifyAssert func(token string, w http.ResponseWriter) (*descope.AuthenticationInfo, error)
77+
VerifyAssert func(token string, w http.ResponseWriter)
7878
VerifyError error
7979
VerifyResponse *descope.AuthenticationInfo
8080

@@ -146,7 +146,7 @@ type MockEnchantedLink struct {
146146
GetSessionResponse *descope.AuthenticationInfo
147147
GetSessionError error
148148

149-
VerifyAssert func(token string) (*descope.AuthenticationInfo, error)
149+
VerifyAssert func(token string)
150150
VerifyError error
151151

152152
UpdateUserEmailAssert func(loginID, email, URI string, updateOptions *descope.UpdateOptions, r *http.Request)

descope/tests/mocks/mgmt/managementmock.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ type MockSSO struct {
176176
ConfigureSAMLSettingsByMetadataAssert func(tenantID string, settings *descope.SSOSAMLSettingsByMetadata, redirectURL string, domains []string, ssoID string)
177177
ConfigureSAMLSettingsByMetadataError error
178178

179-
ConfigureOIDCSettingsAssert func(tenantID string, settings *descope.SSOOIDCSettings, domains []string, ssoID string) error
179+
ConfigureOIDCSettingsAssert func(tenantID string, settings *descope.SSOOIDCSettings, domains []string, ssoID string)
180180
ConfigureOIDCSettingsError error
181181

182182
NewSettingsAssert func(tenantID string, ssoID string, displayName string)
@@ -950,7 +950,7 @@ type MockTenant struct {
950950
ConfigureSettingsResponse *descope.TenantSettings
951951
ConfigureSettingsError error
952952

953-
GenerateSSOConfigurationLinkAssert func(tenantID string, expireDuration int64, ssoID string, email string, templateID string) error
953+
GenerateSSOConfigurationLinkAssert func(tenantID string, expireDuration int64, ssoID string, email string, templateID string)
954954
GenerateSSOConfigurationLinkResponse string
955955
GenerateSSOConfigurationLinkError error
956956
}
@@ -1574,16 +1574,16 @@ func (m *MockAuthz) GetModified(_ context.Context, since time.Time) (*descope.Au
15741574
}
15751575

15761576
type MockFGA struct {
1577-
SaveSchemaAssert func(schema *descope.FGASchema) error
1577+
SaveSchemaAssert func(schema *descope.FGASchema)
15781578
SaveSchemaError error
15791579

15801580
LoadSchemaResponse *descope.FGASchema
15811581
LoadSchemaError error
15821582

1583-
CreateRelationsAssert func(relations []*descope.FGARelation) error
1583+
CreateRelationsAssert func(relations []*descope.FGARelation)
15841584
CreateRelationsError error
15851585

1586-
DeleteRelationsAssert func(relations []*descope.FGARelation) error
1586+
DeleteRelationsAssert func(relations []*descope.FGARelation)
15871587
DeleteRelationsError error
15881588

15891589
CheckAssert func(relations []*descope.FGARelation)

descope/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ const (
10181018
EnvironmentVariableProjectID = "DESCOPE_PROJECT_ID"
10191019
EnvironmentVariablePublicKey = "DESCOPE_PUBLIC_KEY"
10201020
EnvironmentVariableManagementKey = "DESCOPE_MANAGEMENT_KEY"
1021-
EnvironmentVariableAuthManagementKey = "DESCOPE_AUTH_MANAGEMENT_KEY"
1021+
EnvironmentVariableAuthManagementKey = "DESCOPE_AUTH_MANAGEMENT_KEY" // gitleaks:allow
10221022
EnvironmentVariableBaseURL = "DESCOPE_BASE_URL"
10231023
)
10241024

descope/types_test.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func TestNewToken(t *testing.T) {
4747
subject := "subj"
4848
expiration := time.Now()
4949

50-
token.Set(jwt.IssuerKey, issuer)
51-
token.Set(jwt.SubjectKey, subject)
52-
token.Set(jwt.ExpirationKey, expiration)
50+
_ = token.Set(jwt.IssuerKey, issuer)
51+
_ = token.Set(jwt.SubjectKey, subject)
52+
_ = token.Set(jwt.ExpirationKey, expiration)
5353

5454
resToken := NewToken(jwtStr, token)
5555

@@ -69,9 +69,9 @@ func TestNewTokenWithProjectID(t *testing.T) {
6969
subject := "subj"
7070
expiration := time.Now()
7171

72-
token.Set(jwt.IssuerKey, issuer)
73-
token.Set(jwt.SubjectKey, subject)
74-
token.Set(jwt.ExpirationKey, expiration)
72+
_ = token.Set(jwt.IssuerKey, issuer)
73+
_ = token.Set(jwt.SubjectKey, subject)
74+
_ = token.Set(jwt.ExpirationKey, expiration)
7575

7676
resToken := NewToken(jwtStr, token)
7777

@@ -86,11 +86,12 @@ func TestGetCreatedTime(t *testing.T) {
8686
now := time.Now()
8787
ct := now.Unix()
8888
now = time.Unix(ct, 0)
89-
u := UserResponse{CreatedTime: int32(ct)}
89+
u := UserResponse{CreatedTime: int32(ct)} // nolint:gosec
9090
assert.True(t, u.GetCreatedTime().Equal(now))
91-
r := Role{CreatedTime: int32(ct)}
91+
r := Role{CreatedTime: int32(ct)} // nolint:gosec
9292
assert.True(t, r.GetCreatedTime().Equal(now))
93-
c := ThirdPartyApplicationConsent{CreatedTime: int32(ct)}
93+
94+
c := ThirdPartyApplicationConsent{CreatedTime: int32(ct)} // nolint:gosec
9495
assert.True(t, c.GetCreatedTime().Equal(now))
9596
}
9697

go.mod

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/descope/go-sdk
22

3-
go 1.23
3+
go 1.23.0
4+
5+
toolchain go1.24.1
46

57
require (
68
github.com/google/uuid v1.6.0
@@ -20,7 +22,7 @@ require (
2022
github.com/lestrrat-go/option v1.0.1 // indirect
2123
github.com/pmezard/go-difflib v1.0.0 // indirect
2224
github.com/segmentio/asm v1.2.0 // indirect
23-
golang.org/x/crypto v0.31.0 // indirect
24-
golang.org/x/sys v0.28.0 // indirect
25+
golang.org/x/crypto v0.35.0 // indirect
26+
golang.org/x/sys v0.30.0 // indirect
2527
gopkg.in/yaml.v3 v3.0.1 // indirect
2628
)

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
2828
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2929
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3030
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
31-
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
32-
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
31+
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
32+
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
3333
golang.org/x/exp v0.0.0-20220921023135-46d9e7742f1e h1:Ctm9yurWsg7aWwIpH9Bnap/IdSVxixymIb3MhiMEQQA=
3434
golang.org/x/exp v0.0.0-20220921023135-46d9e7742f1e/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
35-
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
36-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
35+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
36+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3737
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
3838
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3939
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

scripts/lint/.golangci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ linters:
5050
- godox
5151
- depguard
5252
- forbidigo
53-
disable-all: true
53+
- gosec
5454

5555
issues:
5656
# Excluding configuration per-path, per-linter, per-text and per-source
@@ -63,4 +63,4 @@ issues:
6363
exclude-use-default: false
6464

6565
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
66-
max-issues-per-linter: 0
66+
max-issues-per-linter: 0

scripts/lint/lint.sh

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

3-
GITLEAKS_VERSION="v8.8.11"
3+
# renovate: datasource=docker depName=ghcr.io/gitleaks/gitleaks
4+
GITLEAKS_VERSION="v8.24.0"
45
CURRENT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
56

67
run_linter() {
@@ -62,7 +63,8 @@ lint_go_build() {
6263
# Run golangci-lint
6364
lint_run_golangci() {
6465
echo "- Running golangci-lint"
65-
GOLANG_CI_SUPPORTED_VERSION="1.61.0"
66+
# renovate: datasource=github-releases depName=golangci/golangci-lint
67+
GOLANG_CI_SUPPORTED_VERSION="1.64.7"
6668
INSTALLED_GOLANG_CLI_VERSION="$(golangci-lint --version)"
6769
if [[ $INSTALLED_GOLANG_CLI_VERSION != *"$GOLANG_CI_SUPPORTED_VERSION"* ]]; then
6870
echo "Installing golangci-lint for the first time..."
@@ -71,12 +73,7 @@ lint_run_golangci() {
7173
fi
7274

7375
local golang_cli_config="${1:-"${CURRENT_DIR}/.golangci.yml"}" # get first argument and set "cmd" to be default
74-
lintresult=$(golangci-lint --config ${golang_cli_config} --out-format colored-line-number run)
75-
if [[ -n $lintresult ]]; then
76-
echo "Some files aren't passing lint, please run 'golangci-lint run' to see the errors it flags and correct your source code before committing"
77-
echo $lintresult
78-
exit 1
79-
fi
76+
golangci-lint --config ${golang_cli_config} --out-format colored-line-number run
8077
if [ $? -ne 0 ]; then
8178
exit 1
8279
fi
@@ -86,19 +83,19 @@ lint_run_golangci() {
8683
# Run detect-secrets
8784
lint_find_secrets() {
8885
echo "- Running secrets check"
89-
INSTALLED_SECRETS_VERSION="$(docker inspect ghcr.io/zricethezav/gitleaks:$GITLEAKS_VERSION)"
86+
INSTALLED_SECRETS_VERSION="$(docker inspect ghcr.io/gitleaks/gitleaks:$GITLEAKS_VERSION)"
9087
if [[ -z $INSTALLED_SECRETS_VERSION ]]; then
9188
echo "Installing gitleaks for the first time..."
92-
git pull ghcr.io/zricethezav/gitleaks:$GITLEAKS_VERSION
89+
git pull ghcr.io/gitleaks/gitleaks:$GITLEAKS_VERSION
9390
echo "Done installing gitleaks"
9491
fi
9592
echo " - Finding leaks in git log"
96-
docker run --rm -v ${CURRENT_DIR}:/conf -v ${PWD}:/code ghcr.io/zricethezav/gitleaks:$GITLEAKS_VERSION detect -v --redact --source="/code" -c /conf/gitleaks.toml
93+
docker run --rm -v ${CURRENT_DIR}:/conf -v ${PWD}:/code ghcr.io/gitleaks/gitleaks:$GITLEAKS_VERSION detect -v --redact --source="/code" -c /conf/gitleaks.toml
9794
if [ $? -ne 0 ]; then
9895
exit 1
9996
fi
10097
echo " - Finding leaks in local repo"
101-
docker run --rm -v ${CURRENT_DIR}:/conf -v ${PWD}:/code ghcr.io/zricethezav/gitleaks:$GITLEAKS_VERSION detect --no-git -v --redact --source="/code" -c /conf/gitleaks.toml
98+
docker run --rm -v ${CURRENT_DIR}:/conf -v ${PWD}:/code ghcr.io/gitleaks/gitleaks:$GITLEAKS_VERSION detect --no-git -v --redact --source="/code" -c /conf/gitleaks.toml
10299
if [ $? -ne 0 ]; then
103100
exit 1
104101
fi

0 commit comments

Comments
 (0)