Skip to content

Commit 0a2a5fc

Browse files
authored
Merge branch 'main' into ale-fix-display-name-casing
2 parents 39cdaad + 178670f commit 0a2a5fc

12 files changed

Lines changed: 51 additions & 48 deletions

File tree

.github/STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The square brackets surrounding command arguments hint that these are optional:
3131

3232
```
3333
USAGE
34-
$ slack env add [name] [value] [flags]
34+
$ slack env set [name] [value] [flags]
3535
```
3636

3737
The angled brackets around arguments hint that these are required:

cmd/env/unset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func runEnvUnsetCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, a
112112
Emoji: "evergreen_tree",
113113
Text: "Environment Unset",
114114
Secondary: []string{
115-
"The app has no environment variables to remove",
115+
"The app has no environment variables to unset",
116116
},
117117
}))
118118
return nil
@@ -141,7 +141,7 @@ func runEnvUnsetCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, a
141141
Emoji: "evergreen_tree",
142142
Text: "Environment Unset",
143143
Secondary: []string{
144-
"The project has no environment variables to remove",
144+
"The project has no environment variables to unset",
145145
},
146146
}))
147147
return nil

cmd/env/unset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func Test_Env_RemoveCommand(t *testing.T) {
7979
cm.API.AssertNotCalled(t, "RemoveVariable")
8080
},
8181
ExpectedStdoutOutputs: []string{
82-
"The project has no environment variables to remove",
82+
"The project has no environment variables to unset",
8383
},
8484
},
8585
"exit without errors when hosted app has zero variables": {
@@ -94,7 +94,7 @@ func Test_Env_RemoveCommand(t *testing.T) {
9494
cm.API.AssertNotCalled(t, "RemoveVariable")
9595
},
9696
ExpectedStdoutOutputs: []string{
97-
"The app has no environment variables to remove",
97+
"The app has no environment variables to unset",
9898
},
9999
},
100100
"remove a hosted variable using arguments": {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ require (
222222
github.com/go-critic/go-critic v0.14.3 // indirect
223223
github.com/go-fed/httpsig v1.1.0 // indirect
224224
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
225-
github.com/go-git/go-billy/v5 v5.8.0 // indirect
225+
github.com/go-git/go-billy/v5 v5.9.0 // indirect
226226
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
227227
github.com/go-logr/logr v1.4.3 // indirect
228228
github.com/go-logr/stdr v1.2.2 // indirect
@@ -390,7 +390,7 @@ require (
390390
github.com/opencontainers/go-digest v1.0.0 // indirect
391391
github.com/opencontainers/image-spec v1.1.1 // indirect
392392
github.com/pelletier/go-toml v1.9.5 // indirect
393-
github.com/pjbgf/sha1cd v0.5.0 // indirect
393+
github.com/pjbgf/sha1cd v0.6.0 // indirect
394394
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
395395
github.com/polydawn/refmt v0.89.1-0.20221221234430-40501e09de1f // indirect
396396
github.com/prometheus/client_golang v1.23.2 // indirect
@@ -517,7 +517,7 @@ require (
517517
require (
518518
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
519519
github.com/fatih/color v1.19.0 // indirect
520-
github.com/go-git/go-git/v5 v5.18.0
520+
github.com/go-git/go-git/v5 v5.19.0
521521
github.com/inconshreveable/mousetrap v1.1.0 // indirect
522522
github.com/kubescape/go-git-url v0.0.31
523523
github.com/mattn/go-colorable v0.1.14 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,12 @@ github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
504504
github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
505505
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
506506
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
507-
github.com/go-git/go-billy/v5 v5.8.0 h1:I8hjc3LbBlXTtVuFNJuwYuMiHvQJDq1AT6u4DwDzZG0=
508-
github.com/go-git/go-billy/v5 v5.8.0/go.mod h1:RpvI/rw4Vr5QA+Z60c6d6LXH0rYJo0uD5SqfmrrheCY=
507+
github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmmBPA=
508+
github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw=
509509
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
510510
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
511-
github.com/go-git/go-git/v5 v5.18.0 h1:O831KI+0PR51hM2kep6T8k+w0/LIAD490gvqMCvL5hM=
512-
github.com/go-git/go-git/v5 v5.18.0/go.mod h1:pW/VmeqkanRFqR6AljLcs7EA7FbZaN5MQqO7oZADXpo=
511+
github.com/go-git/go-git/v5 v5.19.0 h1:+WkVUQZSy/F1Gb13udrMKjIM2PrzsNfDKFSfo5tkMtc=
512+
github.com/go-git/go-git/v5 v5.19.0/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ=
513513
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
514514
github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=
515515
github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
@@ -1021,8 +1021,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v
10211021
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
10221022
github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc=
10231023
github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
1024-
github.com/pjbgf/sha1cd v0.5.0 h1:a+UkboSi1znleCDUNT3M5YxjOnN1fz2FhN48FlwCxs0=
1025-
github.com/pjbgf/sha1cd v0.5.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM=
1024+
github.com/pjbgf/sha1cd v0.6.0 h1:3WJ8Wz8gvDz29quX1OcEmkAlUg9diU4GxJHqs0/XiwU=
1025+
github.com/pjbgf/sha1cd v0.6.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM=
10261026
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
10271027
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
10281028
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -1397,8 +1397,8 @@ golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL
13971397
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
13981398
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
13991399
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
1400-
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9 h1:MDfG8Cvcqlt9XXrmEiD4epKn7VJHZO84hejP9Jmp0MM=
1401-
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU=
1400+
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM=
1401+
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80=
14021402
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
14031403
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
14041404
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 h1:qWFG1Dj7TBjOjOvhEOkmyGPVoquqUKnIU0lEVLp8xyk=

internal/api/s3_upload.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ package api
1717
import (
1818
"bytes"
1919
"context"
20-
"crypto/md5"
21-
"encoding/base64"
2220
"fmt"
2321
"io"
2422
"mime/multipart"
@@ -76,13 +74,6 @@ func (c *Client) UploadPackageToS3(ctx context.Context, fs afero.Fs, appID strin
7674
}
7775
}
7876

79-
md5hash := md5.New()
80-
if _, err := io.Copy(md5hash, archive); err != nil {
81-
return fileName, err
82-
}
83-
84-
md5s := base64.StdEncoding.EncodeToString(md5hash.Sum(nil))
85-
8677
var part io.Writer
8778
h := make(textproto.MIMEHeader)
8879
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="%s"; filename="%s"`, "file", fileName))
@@ -105,7 +96,6 @@ func (c *Client) UploadPackageToS3(ctx context.Context, fs afero.Fs, appID strin
10596
return fileName, err
10697
}
10798
request.Header.Add("Content-Type", writer.FormDataContentType())
108-
request.Header.Add("Content-MD5", md5s)
10999
cliVersion, err := slackcontext.Version(ctx)
110100
if err != nil {
111101
return fileName, err

internal/api/s3_upload_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ func TestClient_UploadPackageToS3(t *testing.T) {
6767
require.NoError(t, err)
6868
require.Equal(t, "this is the package", string(contentBytes))
6969

70-
md5Header := r.Header["Content-Md5"][0]
71-
require.Equal(t, "1B2M2Y8AsgTpgAmY7PhCfg==", md5Header)
72-
7370
w.WriteHeader(http.StatusNoContent)
7471
}))
7572
defer server.Close()

internal/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ func (c *Client) ResolveAPIHost(ctx context.Context, apiHostFlag string, customA
494494
c.io.PrintDebug(
495495
ctx,
496496
"You're using a custom apihost. Run %s to add it to your app's Run on Slack environment",
497-
style.Commandf(fmt.Sprintf("var add SLACK_API_URL %s", apiHost), false),
497+
style.Commandf(fmt.Sprintf("env set SLACK_API_URL %s", apiHost), false),
498498
)
499499
}
500500

internal/goutils/strings.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
package goutils
1616

1717
import (
18-
"crypto/sha1"
18+
"crypto/sha256"
1919
"fmt"
2020
"net/url"
2121
"os"
2222
"regexp"
2323
"strings"
2424
)
2525

26-
// HashString will compute a short sha1 identity for a text blob
26+
// HashString will compute a short sha256 identity for a text blob
2727
func HashString(s string) (string, error) {
28-
var hash = sha1.New()
28+
var hash = sha256.New()
2929
_, err := hash.Write([]byte(s))
3030
if err != nil {
3131
return "", err

internal/goutils/strings_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ import (
2222
)
2323

2424
func Test_HashString(t *testing.T) {
25+
t.Run("produces a sha256 hex string", func(t *testing.T) {
26+
hash, err := HashString("test")
27+
require.NoError(t, err)
28+
require.Len(t, hash, 64)
29+
})
30+
2531
tests := map[string]struct {
2632
text1 string
2733
text2 string

0 commit comments

Comments
 (0)