Skip to content

Commit 7b61934

Browse files
authored
Use x crypto instead of sodium (#2034)
1 parent 54ec837 commit 7b61934

File tree

6 files changed

+575
-5
lines changed

6 files changed

+575
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module newreposecret
1+
module newreposecretwithlibsodium
22

33
go 1.15
44

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
8282
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
8383
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
8484
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
85+
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
8586
github.com/google/go-github/v33 v33.0.0 h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM=
8687
github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg=
88+
github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM=
89+
github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4=
8790
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
8891
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
8992
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=

example/newreposecret/main.go renamed to example/newreposecretwithlibsodium/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// Use of this source code is governed by a BSD-style
44
// license that can be found in the LICENSE file.
55

6-
// newreposecret creates a new secret in GitHub for a given owner/repo.
7-
// newreposecret depends on sodium being installed. Installation instructions for Sodium can be found at this url:
6+
// newreposecretwithlibsodium creates a new secret in GitHub for a given owner/repo.
7+
// newreposecretwithlibsodium depends on sodium being installed. Installation instructions for Sodium can be found at this url:
88
// https://github.com/jedisct1/libsodium
99
//
10-
// newreposecret has two required flags for owner and repo, and takes in one argument for the name of the secret to add.
10+
// nnewreposecretwithlibsodium has two required flags for owner and repo, and takes in one argument for the name of the secret to add.
1111
// The secret value is pulled from an environment variable based on the secret name.
1212
// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.
1313
//
@@ -114,7 +114,7 @@ func githubAuth(token string) (context.Context, *github.Client, error) {
114114
// Finally, the secretName and secretValue will determine the name of the secret added and it's corresponding value.
115115
//
116116
// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted
117-
// using the public key of the target repo. This encryption must be done using sodium.
117+
// using the public key of the target repo. This encryption is done using sodium.
118118
//
119119
// First, the public key of the repo is retrieved. The public key comes base64
120120
// encoded, so it must be decoded prior to use in sodiumlib.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module newreposecretwithxcrypto
2+
3+
go 1.15
4+
5+
require (
6+
github.com/google/go-github/v37 v37.0.0
7+
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
8+
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
9+
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
10+
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
11+
)

0 commit comments

Comments
 (0)