Skip to content

Commit 134c09b

Browse files
author
Scott Schulthess
committed
remove private key file reference
1 parent 7f3b0ae commit 134c09b

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

models.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Source struct {
3030
TrustedTeams []string `json:"trusted_teams"`
3131
TrustedUsers []string `json:"trusted_users"`
3232
UseGitHubApp bool `json:"use_github_app"`
33-
GithubOrganziation string `json:"github_organization"`
33+
GithubOrganziation string `json:"github_organization"`
3434
PrivateKey string `json:"private_key"`
3535
ApplicationID int64 `json:"application_id"`
3636
InstallationID int64 `json:"installation_id"`
@@ -43,7 +43,7 @@ func (s *Source) Validate() error {
4343
}
4444
if s.UseGitHubApp {
4545
if s.PrivateKey == "" {
46-
return errors.New("Either private_key or private_key_file should be supplied if using GitHub App authentication")
46+
return errors.New("private_key is required for GitHub App authentication")
4747
}
4848
if s.ApplicationID == 0 || s.InstallationID == 0 {
4949
return errors.New("application_id and installation_id must be set if using GitHub App authentication")

models_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ func TestSource(t *testing.T) {
3838
{
3939
description: "should support GitHub App authentication",
4040
source: resource.Source{
41-
Repository: "test/test",
41+
Repository: "test/test",
4242
GithubOrganziation: "test",
43-
UseGitHubApp: true,
44-
PrivateKey: "key.pem",
45-
ApplicationID: 123456,
46-
InstallationID: 1,
43+
UseGitHubApp: true,
44+
PrivateKey: "key.pem",
45+
ApplicationID: 123456,
46+
InstallationID: 1,
4747
},
4848
},
4949
{
50-
description: "requires a private_key or private_key_file GitHub App configuration values",
50+
description: "private_key App configuration values",
5151
source: resource.Source{
5252
Repository: "test/test",
5353
UseGitHubApp: true,
5454
ApplicationID: 123456,
5555
InstallationID: 1,
5656
},
57-
wantErr: "Either private_key or private_key_file should be supplied if using GitHub App authentication",
57+
wantErr: "private_key is required for GitHub App authentication",
5858
},
5959
{
6060
description: "requires an application_id and installation_id GitHub App configuration values",
@@ -69,13 +69,13 @@ func TestSource(t *testing.T) {
6969
{
7070
description: "should not have an access_token when using GitHub App authentication",
7171
source: resource.Source{
72-
Repository: "test/test",
73-
UseGitHubApp: true,
72+
Repository: "test/test",
73+
UseGitHubApp: true,
7474
GithubOrganziation: "test",
75-
PrivateKey: "key.pem",
76-
ApplicationID: 123456,
77-
InstallationID: 1,
78-
AccessToken: "123456",
75+
PrivateKey: "key.pem",
76+
ApplicationID: 123456,
77+
InstallationID: 1,
78+
AccessToken: "123456",
7979
},
8080
wantErr: "access_token is not required when using GitHub App authentication",
8181
},

0 commit comments

Comments
 (0)