File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ type Source struct {
30
30
TrustedTeams []string `json:"trusted_teams"`
31
31
TrustedUsers []string `json:"trusted_users"`
32
32
UseGitHubApp bool `json:"use_github_app"`
33
- GithubOrganziation string `json:"github_organization"`
33
+ GithubOrganziation string `json:"github_organization"`
34
34
PrivateKey string `json:"private_key"`
35
35
ApplicationID int64 `json:"application_id"`
36
36
InstallationID int64 `json:"installation_id"`
@@ -43,7 +43,7 @@ func (s *Source) Validate() error {
43
43
}
44
44
if s .UseGitHubApp {
45
45
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" )
47
47
}
48
48
if s .ApplicationID == 0 || s .InstallationID == 0 {
49
49
return errors .New ("application_id and installation_id must be set if using GitHub App authentication" )
Original file line number Diff line number Diff line change @@ -38,23 +38,23 @@ func TestSource(t *testing.T) {
38
38
{
39
39
description : "should support GitHub App authentication" ,
40
40
source : resource.Source {
41
- Repository : "test/test" ,
41
+ Repository : "test/test" ,
42
42
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 ,
47
47
},
48
48
},
49
49
{
50
- description : "requires a private_key or private_key_file GitHub App configuration values" ,
50
+ description : "private_key App configuration values" ,
51
51
source : resource.Source {
52
52
Repository : "test/test" ,
53
53
UseGitHubApp : true ,
54
54
ApplicationID : 123456 ,
55
55
InstallationID : 1 ,
56
56
},
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" ,
58
58
},
59
59
{
60
60
description : "requires an application_id and installation_id GitHub App configuration values" ,
@@ -69,13 +69,13 @@ func TestSource(t *testing.T) {
69
69
{
70
70
description : "should not have an access_token when using GitHub App authentication" ,
71
71
source : resource.Source {
72
- Repository : "test/test" ,
73
- UseGitHubApp : true ,
72
+ Repository : "test/test" ,
73
+ UseGitHubApp : true ,
74
74
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" ,
79
79
},
80
80
wantErr : "access_token is not required when using GitHub App authentication" ,
81
81
},
You can’t perform that action at this time.
0 commit comments