From 9bee1d85ff7a0f14076c7424e347979dece8acbc Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:02:45 +0000 Subject: [PATCH 1/9] vendor: github.com/google/go-github/github@v17.0.0 Signed-off-by: Trevor Bramwell --- github/data_source_github_team.go | 4 +- github/resource_github_team.go | 12 +- github/resource_github_team_membership.go | 8 +- .../resource_github_team_membership_test.go | 6 +- github/resource_github_team_repository.go | 12 +- .../resource_github_team_repository_test.go | 4 +- github/resource_github_team_test.go | 4 +- go.mod | 2 +- go.sum | 2 + .../google/go-github/github/apps.go | 1 + .../google/go-github/github/event_types.go | 1 + .../google/go-github/github/gists.go | 30 - .../google/go-github/github/git_blobs.go | 6 - .../google/go-github/github/git_commits.go | 7 +- .../google/go-github/github/git_refs.go | 15 - .../google/go-github/github/git_tags.go | 7 +- .../go-github/github/github-accessors.go | 78 ++- .../google/go-github/github/github.go | 15 +- .../google/go-github/github/issues.go | 33 +- .../google/go-github/github/issues_events.go | 21 +- .../google/go-github/github/issues_labels.go | 25 +- .../go-github/github/issues_milestones.go | 12 - .../google/go-github/github/orgs.go | 17 +- .../google/go-github/github/orgs_members.go | 2 +- .../google/go-github/github/orgs_teams.go | 514 ------------------ .../google/go-github/github/projects.go | 31 +- .../google/go-github/github/pulls.go | 13 +- .../google/go-github/github/reactions.go | 25 +- .../google/go-github/github/repos.go | 38 +- .../go-github/github/repos_deployments.go | 19 +- .../google/go-github/github/repos_projects.go | 7 +- .../google/go-github/github/repos_releases.go | 24 - .../google/go-github/github/search.go | 10 +- .../google/go-github/github/teams.go | 350 ++++++++++++ .../github/teams_discussion_comments.go | 2 +- .../go-github/github/teams_discussions.go | 4 +- .../google/go-github/github/teams_members.go | 174 ++++++ .../google/go-github/github/users.go | 51 ++ vendor/modules.txt | 2 +- 39 files changed, 806 insertions(+), 782 deletions(-) delete mode 100644 vendor/github.com/google/go-github/github/orgs_teams.go create mode 100644 vendor/github.com/google/go-github/github/teams_members.go diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 5848c4bb50..06f358da2e 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -56,7 +56,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { return err } - member, _, err := client.Organizations.ListTeamMembers(ctx, team.GetID(), nil) + member, _, err := client.Teams.ListTeamMembers(ctx, team.GetID(), nil) if err != nil { return err } @@ -79,7 +79,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { func getGithubTeamBySlug(client *github.Client, org string, slug string) (team *github.Team, err error) { opt := &github.ListOptions{PerPage: 10} for { - teams, resp, err := client.Organizations.ListTeams(context.TODO(), org, opt) + teams, resp, err := client.Teams.ListTeams(context.TODO(), org, opt) if err != nil { return team, err } diff --git a/github/resource_github_team.go b/github/resource_github_team.go index b18a74a3d1..4b26c41801 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -60,7 +60,7 @@ func resourceGithubTeamCreate(d *schema.ResourceData, meta interface{}) error { orgName := meta.(*Organization).name name := d.Get("name").(string) - newTeam := &github.NewTeam{ + newTeam := github.NewTeam{ Name: name, Description: github.String(d.Get("description").(string)), Privacy: github.String(d.Get("privacy").(string)), @@ -72,7 +72,7 @@ func resourceGithubTeamCreate(d *schema.ResourceData, meta interface{}) error { ctx := context.Background() log.Printf("[DEBUG] Creating team: %s (%s)", name, orgName) - githubTeam, _, err := client.Organizations.CreateTeam(ctx, + githubTeam, _, err := client.Teams.CreateTeam(ctx, orgName, newTeam) if err != nil { return err @@ -105,7 +105,7 @@ func resourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { } log.Printf("[DEBUG] Reading team: %s", d.Id()) - team, resp, err := client.Organizations.GetTeam(ctx, id) + team, resp, err := client.Teams.GetTeam(ctx, id) if err != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { if ghErr.Response.StatusCode == http.StatusNotModified { @@ -139,7 +139,7 @@ func resourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { func resourceGithubTeamUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*Organization).client - editedTeam := &github.NewTeam{ + editedTeam := github.NewTeam{ Name: d.Get("name").(string), Description: github.String(d.Get("description").(string)), Privacy: github.String(d.Get("privacy").(string)), @@ -156,7 +156,7 @@ func resourceGithubTeamUpdate(d *schema.ResourceData, meta interface{}) error { ctx := context.WithValue(context.Background(), ctxId, d.Id()) log.Printf("[DEBUG] Updating team: %s", d.Id()) - team, _, err := client.Organizations.EditTeam(ctx, teamId, editedTeam) + team, _, err := client.Teams.EditTeam(ctx, teamId, editedTeam) if err != nil { return err } @@ -186,6 +186,6 @@ func resourceGithubTeamDelete(d *schema.ResourceData, meta interface{}) error { ctx := context.WithValue(context.Background(), ctxId, d.Id()) log.Printf("[DEBUG] Deleting team: %s", d.Id()) - _, err = client.Organizations.DeleteTeam(ctx, id) + _, err = client.Teams.DeleteTeam(ctx, id) return err } diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 15593c950f..2d2620a270 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -61,10 +61,10 @@ func resourceGithubTeamMembershipCreateOrUpdate(d *schema.ResourceData, meta int role := d.Get("role").(string) log.Printf("[DEBUG] Creating team membership: %s/%s (%s)", teamIdString, username, role) - _, _, err = client.Organizations.AddTeamMembership(ctx, + _, _, err = client.Teams.AddTeamMembership(ctx, teamId, username, - &github.OrganizationAddTeamMembershipOptions{ + &github.TeamAddTeamMembershipOptions{ Role: role, }, ) @@ -94,7 +94,7 @@ func resourceGithubTeamMembershipRead(d *schema.ResourceData, meta interface{}) } log.Printf("[DEBUG] Reading team membership: %s/%s", teamIdString, username) - membership, resp, err := client.Organizations.GetTeamMembership(ctx, + membership, resp, err := client.Teams.GetTeamMembership(ctx, teamId, username) if err != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { @@ -133,7 +133,7 @@ func resourceGithubTeamMembershipDelete(d *schema.ResourceData, meta interface{} ctx := context.WithValue(context.Background(), ctxId, d.Id()) log.Printf("[DEBUG] Deleting team membership: %s/%s", teamIdString, username) - _, err = client.Organizations.RemoveTeamMembership(ctx, teamId, username) + _, err = client.Teams.RemoveTeamMembership(ctx, teamId, username) return err } diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index bd32767e10..b72a1968d3 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -77,7 +77,7 @@ func testAccCheckGithubTeamMembershipDestroy(s *terraform.State) error { return unconvertibleIdErr(teamIdString, err) } - membership, resp, err := conn.Organizations.GetTeamMembership(context.TODO(), + membership, resp, err := conn.Teams.GetTeamMembership(context.TODO(), teamId, username) if err == nil { if membership != nil { @@ -114,7 +114,7 @@ func testAccCheckGithubTeamMembershipExists(n string, membership *github.Members return unconvertibleIdErr(teamIdString, err) } - teamMembership, _, err := conn.Organizations.GetTeamMembership(context.TODO(), teamId, username) + teamMembership, _, err := conn.Teams.GetTeamMembership(context.TODO(), teamId, username) if err != nil { return err @@ -145,7 +145,7 @@ func testAccCheckGithubTeamMembershipRoleState(n, expected string, membership *g return unconvertibleIdErr(teamIdString, err) } - teamMembership, _, err := conn.Organizations.GetTeamMembership(context.TODO(), + teamMembership, _, err := conn.Teams.GetTeamMembership(context.TODO(), teamId, username) if err != nil { return err diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index 48634ea010..3624159a34 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -60,11 +60,11 @@ func resourceGithubTeamRepositoryCreate(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Creating team repository association: %s:%s (%s/%s)", teamIdString, permission, orgName, repoName) - _, err = client.Organizations.AddTeamRepo(ctx, + _, err = client.Teams.AddTeamRepo(ctx, teamId, orgName, repoName, - &github.OrganizationAddTeamRepoOptions{ + &github.TeamAddTeamRepoOptions{ Permission: permission, }, ) @@ -98,7 +98,7 @@ func resourceGithubTeamRepositoryRead(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Reading team repository association: %s (%s/%s)", teamIdString, orgName, repoName) - repo, resp, repoErr := client.Organizations.IsTeamRepo(ctx, + repo, resp, repoErr := client.Teams.IsTeamRepo(ctx, teamId, orgName, repoName) if repoErr != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { @@ -145,11 +145,11 @@ func resourceGithubTeamRepositoryUpdate(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Updating team repository association: %s:%s (%s/%s)", teamIdString, permission, orgName, repoName) // the go-github library's AddTeamRepo method uses the add/update endpoint from Github API - _, err = client.Organizations.AddTeamRepo(ctx, + _, err = client.Teams.AddTeamRepo(ctx, teamId, orgName, repoName, - &github.OrganizationAddTeamRepoOptions{ + &github.TeamAddTeamRepoOptions{ Permission: permission, }, ) @@ -177,7 +177,7 @@ func resourceGithubTeamRepositoryDelete(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Deleting team repository association: %s (%s/%s)", teamIdString, orgName, repoName) - _, err = client.Organizations.RemoveTeamRepo(ctx, + _, err = client.Teams.RemoveTeamRepo(ctx, teamId, orgName, repoName) return err } diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index ef48ba0bcc..efa7ad6430 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -125,7 +125,7 @@ func testAccCheckGithubTeamRepositoryExists(n string, repository *github.Reposit return unconvertibleIdErr(teamIdString, err) } - repo, _, err := conn.Organizations.IsTeamRepo(context.TODO(), + repo, _, err := conn.Teams.IsTeamRepo(context.TODO(), teamId, testAccProvider.Meta().(*Organization).name, repoName) @@ -155,7 +155,7 @@ func testAccCheckGithubTeamRepositoryDestroy(s *terraform.State) error { return unconvertibleIdErr(teamIdString, err) } - repo, resp, err := conn.Organizations.IsTeamRepo(context.TODO(), + repo, resp, err := conn.Teams.IsTeamRepo(context.TODO(), teamId, testAccProvider.Meta().(*Organization).name, repoName) diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index e485389d05..fe24d79247 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -146,7 +146,7 @@ func testAccCheckGithubTeamExists(n string, team *github.Team) resource.TestChec return unconvertibleIdErr(rs.Primary.ID, err) } - githubTeam, _, err := conn.Organizations.GetTeam(context.TODO(), id) + githubTeam, _, err := conn.Teams.GetTeam(context.TODO(), id) if err != nil { return err } @@ -190,7 +190,7 @@ func testAccCheckGithubTeamDestroy(s *terraform.State) error { return unconvertibleIdErr(rs.Primary.ID, err) } - team, resp, err := conn.Organizations.GetTeam(context.TODO(), id) + team, resp, err := conn.Teams.GetTeam(context.TODO(), id) if err == nil { teamId := strconv.FormatInt(*team.ID, 10) if team != nil && teamId == rs.Primary.ID { diff --git a/go.mod b/go.mod index fbded09c87..d25ac45719 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github v16.0.0+incompatible + github.com/google/go-github v17.0.0+incompatible github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 8ace077a73..511a8722b2 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-github v16.0.0+incompatible h1:omSHCJqM3CNG6RFFfGmIqGVbdQS2U3QVQSqACgwV1PY= github.com/google/go-github v16.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= diff --git a/vendor/github.com/google/go-github/github/apps.go b/vendor/github.com/google/go-github/github/apps.go index c076704663..e25de2c573 100644 --- a/vendor/github.com/google/go-github/github/apps.go +++ b/vendor/github.com/google/go-github/github/apps.go @@ -20,6 +20,7 @@ type AppsService service // App represents a GitHub App. type App struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` diff --git a/vendor/github.com/google/go-github/github/event_types.go b/vendor/github.com/google/go-github/github/event_types.go index cfc9290b12..0b635ef895 100644 --- a/vendor/github.com/google/go-github/github/event_types.go +++ b/vendor/github.com/google/go-github/github/event_types.go @@ -631,6 +631,7 @@ func (p PushEventCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` Name *string `json:"name,omitempty"` FullName *string `json:"full_name,omitempty"` Owner *PushEventRepoOwner `json:"owner,omitempty"` diff --git a/vendor/github.com/google/go-github/github/gists.go b/vendor/github.com/google/go-github/github/gists.go index 9108b64244..15e0bc2cd9 100644 --- a/vendor/github.com/google/go-github/github/gists.go +++ b/vendor/github.com/google/go-github/github/gists.go @@ -114,9 +114,6 @@ func (s *GistsService) List(ctx context.Context, user string, opt *GistListOptio return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var gists []*Gist resp, err := s.client.Do(ctx, req, &gists) if err != nil { @@ -140,9 +137,6 @@ func (s *GistsService) ListAll(ctx context.Context, opt *GistListOptions) ([]*Gi return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var gists []*Gist resp, err := s.client.Do(ctx, req, &gists) if err != nil { @@ -166,9 +160,6 @@ func (s *GistsService) ListStarred(ctx context.Context, opt *GistListOptions) ([ return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var gists []*Gist resp, err := s.client.Do(ctx, req, &gists) if err != nil { @@ -188,9 +179,6 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - gist := new(Gist) resp, err := s.client.Do(ctx, req, gist) if err != nil { @@ -210,9 +198,6 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - gist := new(Gist) resp, err := s.client.Do(ctx, req, gist) if err != nil { @@ -232,9 +217,6 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - g := new(Gist) resp, err := s.client.Do(ctx, req, g) if err != nil { @@ -254,9 +236,6 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - g := new(Gist) resp, err := s.client.Do(ctx, req, g) if err != nil { @@ -281,9 +260,6 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opt *ListOpti return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var gistCommits []*GistCommit resp, err := s.client.Do(ctx, req, &gistCommits) if err != nil { @@ -353,9 +329,6 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - g := new(Gist) resp, err := s.client.Do(ctx, req, g) if err != nil { @@ -375,9 +348,6 @@ func (s *GistsService) ListForks(ctx context.Context, id string) ([]*GistFork, * return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var gistForks []*GistFork resp, err := s.client.Do(ctx, req, &gistForks) if err != nil { diff --git a/vendor/github.com/google/go-github/github/git_blobs.go b/vendor/github.com/google/go-github/github/git_blobs.go index 5290c5538a..70aee14a7a 100644 --- a/vendor/github.com/google/go-github/github/git_blobs.go +++ b/vendor/github.com/google/go-github/github/git_blobs.go @@ -31,9 +31,6 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - blob := new(Blob) resp, err := s.client.Do(ctx, req, blob) return blob, resp, err @@ -66,9 +63,6 @@ func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - t := new(Blob) resp, err := s.client.Do(ctx, req, t) return t, resp, err diff --git a/vendor/github.com/google/go-github/github/git_commits.go b/vendor/github.com/google/go-github/github/git_commits.go index 29882569c9..1eb48a8e2c 100644 --- a/vendor/github.com/google/go-github/github/git_commits.go +++ b/vendor/github.com/google/go-github/github/git_commits.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" "time" ) @@ -70,8 +69,7 @@ func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, s } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeGitSigningPreview) c := new(Commit) resp, err := s.client.Do(ctx, req, c) @@ -126,9 +124,6 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - c := new(Commit) resp, err := s.client.Do(ctx, req, c) if err != nil { diff --git a/vendor/github.com/google/go-github/github/git_refs.go b/vendor/github.com/google/go-github/github/git_refs.go index 0947d866ab..3b2ced2333 100644 --- a/vendor/github.com/google/go-github/github/git_refs.go +++ b/vendor/github.com/google/go-github/github/git_refs.go @@ -63,9 +63,6 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - r := new(Reference) resp, err := s.client.Do(ctx, req, r) if _, ok := err.(*json.UnmarshalTypeError); ok { @@ -97,9 +94,6 @@ func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var rawJSON json.RawMessage resp, err := s.client.Do(ctx, req, &rawJSON) if err != nil { @@ -154,9 +148,6 @@ func (s *GitService) ListRefs(ctx context.Context, owner, repo string, opt *Refe return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var rs []*Reference resp, err := s.client.Do(ctx, req, &rs) if err != nil { @@ -180,9 +171,6 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - r := new(Reference) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -206,9 +194,6 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - r := new(Reference) resp, err := s.client.Do(ctx, req, r) if err != nil { diff --git a/vendor/github.com/google/go-github/github/git_tags.go b/vendor/github.com/google/go-github/github/git_tags.go index f3822ffacc..90398b3806 100644 --- a/vendor/github.com/google/go-github/github/git_tags.go +++ b/vendor/github.com/google/go-github/github/git_tags.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // Tag represents a tag object. @@ -45,8 +44,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeGitSigningPreview) tag := new(Tag) resp, err := s.client.Do(ctx, req, tag) @@ -75,9 +73,6 @@ func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, t return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - t := new(Tag) resp, err := s.client.Do(ctx, req, t) return t, resp, err diff --git a/vendor/github.com/google/go-github/github/github-accessors.go b/vendor/github.com/google/go-github/github/github-accessors.go index 0086998c44..5094ca6616 100644 --- a/vendor/github.com/google/go-github/github/github-accessors.go +++ b/vendor/github.com/google/go-github/github/github-accessors.go @@ -164,6 +164,14 @@ func (a *App) GetName() string { return *a.Name } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (a *App) GetNodeID() string { + if a == nil || a.NodeID == nil { + return "" + } + return *a.NodeID +} + // GetOwner returns the Owner field. func (a *App) GetOwner() *User { if a == nil { @@ -2365,7 +2373,7 @@ func (d *DiscussionComment) GetNodeID() string { } // GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (d *DiscussionComment) GetNumber() int64 { +func (d *DiscussionComment) GetNumber() int { if d == nil || d.Number == nil { return 0 } @@ -3604,6 +3612,14 @@ func (i *Invitation) GetTeamCount() int { return *i.TeamCount } +// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise. +func (i *Issue) GetActiveLockReason() string { + if i == nil || i.ActiveLockReason == nil { + return "" + } + return *i.ActiveLockReason +} + // GetAssignee returns the Assignee field. func (i *Issue) GetAssignee() *User { if i == nil { @@ -4004,6 +4020,14 @@ func (i *IssueEvent) GetLabel() *Label { return i.Label } +// GetLockReason returns the LockReason field if it's non-nil, zero value otherwise. +func (i *IssueEvent) GetLockReason() string { + if i == nil || i.LockReason == nil { + return "" + } + return *i.LockReason +} + // GetMilestone returns the Milestone field. func (i *IssueEvent) GetMilestone() *Milestone { if i == nil { @@ -6628,6 +6652,14 @@ func (p *PublicEvent) GetSender() *User { return p.Sender } +// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise. +func (p *PullRequest) GetActiveLockReason() string { + if p == nil || p.ActiveLockReason == nil { + return "" + } + return *p.ActiveLockReason +} + // GetAdditions returns the Additions field if it's non-nil, zero value otherwise. func (p *PullRequest) GetAdditions() int { if p == nil || p.Additions == nil { @@ -7900,6 +7932,14 @@ func (p *PushEventRepository) GetName() string { return *p.Name } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *PushEventRepository) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + // GetOpenIssuesCount returns the OpenIssuesCount field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetOpenIssuesCount() int { if p == nil || p.OpenIssuesCount == nil { @@ -8772,6 +8812,14 @@ func (r *Repository) GetNetworkCount() int { return *r.NetworkCount } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *Repository) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + // GetNotificationsURL returns the NotificationsURL field if it's non-nil, zero value otherwise. func (r *Repository) GetNotificationsURL() string { if r == nil || r.NotificationsURL == nil { @@ -10365,7 +10413,7 @@ func (t *TeamDiscussion) GetBodyVersion() string { } // GetCommentsCount returns the CommentsCount field if it's non-nil, zero value otherwise. -func (t *TeamDiscussion) GetCommentsCount() int64 { +func (t *TeamDiscussion) GetCommentsCount() int { if t == nil || t.CommentsCount == nil { return 0 } @@ -10413,7 +10461,7 @@ func (t *TeamDiscussion) GetNodeID() string { } // GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (t *TeamDiscussion) GetNumber() int64 { +func (t *TeamDiscussion) GetNumber() int { if t == nil || t.Number == nil { return 0 } @@ -11148,6 +11196,14 @@ func (u *User) GetName() string { return *u.Name } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (u *User) GetNodeID() string { + if u == nil || u.NodeID == nil { + return "" + } + return *u.NodeID +} + // GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. func (u *User) GetOrganizationsURL() string { if u == nil || u.OrganizationsURL == nil { @@ -11284,6 +11340,22 @@ func (u *User) GetURL() string { return *u.URL } +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (u *UserContext) GetMessage() string { + if u == nil || u.Message == nil { + return "" + } + return *u.Message +} + +// GetOcticon returns the Octicon field if it's non-nil, zero value otherwise. +func (u *UserContext) GetOcticon() string { + if u == nil || u.Octicon == nil { + return "" + } + return *u.Octicon +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (u *UserEmail) GetEmail() string { if u == nil || u.Email == nil { diff --git a/vendor/github.com/google/go-github/github/github.go b/vendor/github.com/google/go-github/github/github.go index e10b9dde00..0685852db3 100644 --- a/vendor/github.com/google/go-github/github/github.go +++ b/vendor/github.com/google/go-github/github/github.go @@ -48,9 +48,6 @@ const ( // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ mediaTypeStarringPreview = "application/vnd.github.v3.star+json" - // https://developer.github.com/changes/2015-11-11-protected-branches-api/ - mediaTypeProtectedBranchesPreview = "application/vnd.github.loki-preview+json" - // https://help.github.com/enterprise/2.4/admin/guides/migrations/exporting-the-github-com-organization-s-repositories/ mediaTypeMigrationsPreview = "application/vnd.github.wyandotte-preview+json" @@ -102,18 +99,24 @@ const ( // https://developer.github.com/changes/2017-11-09-repository-transfer-api-preview/ mediaTypeRepositoryTransferPreview = "application/vnd.github.nightshade-preview+json" - // https://developer.github.com/changes/2017-12-19-graphql-node-id/ - mediaTypeGraphQLNodeIDPreview = "application/vnd.github.jean-grey-preview+json" - // https://developer.github.com/changes/2018-01-25-organization-invitation-api-preview/ mediaTypeOrganizationInvitationPreview = "application/vnd.github.dazzler-preview+json" + // https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/ + mediaTypeRequiredApprovingReviewsPreview = "application/vnd.github.luke-cage-preview+json" + // https://developer.github.com/changes/2018-02-22-label-description-search-preview/ mediaTypeLabelDescriptionSearchPreview = "application/vnd.github.symmetra-preview+json" // https://developer.github.com/changes/2018-02-07-team-discussions-api/ mediaTypeTeamDiscussionsPreview = "application/vnd.github.echo-preview+json" + // https://developer.github.com/changes/2018-03-21-hovercard-api-preview/ + mediaTypeHovercardPreview = "application/vnd.github.hagar-preview+json" + + // https://developer.github.com/changes/2018-01-10-lock-reason-api-preview/ + mediaTypeLockReasonPreview = "application/vnd.github.sailor-v-preview+json" + // https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/ mediaTypeCheckRunsPreview = "application/vnd.github.antiope-preview+json" diff --git a/vendor/github.com/google/go-github/github/issues.go b/vendor/github.com/google/go-github/github/issues.go index ded07f0aae..47537544a4 100644 --- a/vendor/github.com/google/go-github/github/issues.go +++ b/vendor/github.com/google/go-github/github/issues.go @@ -56,6 +56,10 @@ type Issue struct { // TextMatches is only populated from search results that request text matches // See: search.go and https://developer.github.com/v3/search/#text-match-metadata TextMatches []TextMatch `json:"text_matches,omitempty"` + + // ActiveLockReason is populated only when LockReason is provided while locking the issue. + // Possible values are: "off-topic", "too heated", "resolved", and "spam". + ActiveLockReason *string `json:"active_lock_reason,omitempty"` } func (i Issue) String() string { @@ -156,7 +160,7 @@ func (s *IssuesService) listIssues(ctx context.Context, u string, opt *IssueList } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var issues []*Issue @@ -224,7 +228,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var issues []*Issue @@ -247,7 +251,7 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) issue := new(Issue) @@ -270,8 +274,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) i := new(Issue) resp, err := s.client.Do(ctx, req, i) @@ -293,8 +296,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) i := new(Issue) resp, err := s.client.Do(ctx, req, i) @@ -305,16 +307,29 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num return i, resp, nil } +// LockIssueOptions specifies the optional parameters to the +// IssuesService.Lock method. +type LockIssueOptions struct { + // LockReason specifies the reason to lock this issue. + // Providing a lock reason can help make it clearer to contributors why an issue + // was locked. Possible values are: "off-topic", "too heated", "resolved", and "spam". + LockReason string `json:"lock_reason,omitempty"` +} + // Lock an issue's conversation. // // GitHub API docs: https://developer.github.com/v3/issues/#lock-an-issue -func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int) (*Response, error) { +func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opt *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest("PUT", u, opt) if err != nil { return nil, err } + if opt != nil { + req.Header.Set("Accept", mediaTypeLockReasonPreview) + } + return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/github/issues_events.go b/vendor/github.com/google/go-github/github/issues_events.go index 55e6d431b3..f71e46361c 100644 --- a/vendor/github.com/google/go-github/github/issues_events.go +++ b/vendor/github.com/google/go-github/github/issues_events.go @@ -34,9 +34,13 @@ type IssueEvent struct { // The Actor committed to master a commit mentioning the issue in its commit message. // CommitID holds the SHA1 of the commit. // - // reopened, locked, unlocked + // reopened, unlocked // The Actor did that to the issue. // + // locked + // The Actor locked the issue. + // LockReason holds the reason of locking the issue (if provided while locking). + // // renamed // The Actor changed the issue title from Rename.From to Rename.To. // @@ -64,12 +68,13 @@ type IssueEvent struct { Issue *Issue `json:"issue,omitempty"` // Only present on certain events; see above. - Assignee *User `json:"assignee,omitempty"` - Assigner *User `json:"assigner,omitempty"` - CommitID *string `json:"commit_id,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - Label *Label `json:"label,omitempty"` - Rename *Rename `json:"rename,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assigner *User `json:"assigner,omitempty"` + CommitID *string `json:"commit_id,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + Label *Label `json:"label,omitempty"` + Rename *Rename `json:"rename,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` } // ListIssueEvents lists events for the specified issue. @@ -87,6 +92,8 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, return nil, nil, err } + req.Header.Set("Accept", mediaTypeLockReasonPreview) + var events []*IssueEvent resp, err := s.client.Do(ctx, req, &events) if err != nil { diff --git a/vendor/github.com/google/go-github/github/issues_labels.go b/vendor/github.com/google/go-github/github/issues_labels.go index 4328997bbd..adcbe06834 100644 --- a/vendor/github.com/google/go-github/github/issues_labels.go +++ b/vendor/github.com/google/go-github/github/issues_labels.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // Label represents a GitHub label on an Issue @@ -42,8 +41,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) var labels []*Label resp, err := s.client.Do(ctx, req, &labels) @@ -65,8 +63,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) label := new(Label) resp, err := s.client.Do(ctx, req, label) @@ -88,8 +85,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) l := new(Label) resp, err := s.client.Do(ctx, req, l) @@ -111,8 +107,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) l := new(Label) resp, err := s.client.Do(ctx, req, l) @@ -151,8 +146,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) var labels []*Label resp, err := s.client.Do(ctx, req, &labels) @@ -174,8 +168,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) var l []*Label resp, err := s.client.Do(ctx, req, &l) @@ -213,8 +206,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) var l []*Label resp, err := s.client.Do(ctx, req, &l) @@ -257,8 +249,7 @@ func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) var labels []*Label resp, err := s.client.Do(ctx, req, &labels) diff --git a/vendor/github.com/google/go-github/github/issues_milestones.go b/vendor/github.com/google/go-github/github/issues_milestones.go index 6af1cc03c4..ffe9aae14c 100644 --- a/vendor/github.com/google/go-github/github/issues_milestones.go +++ b/vendor/github.com/google/go-github/github/issues_milestones.go @@ -68,9 +68,6 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var milestones []*Milestone resp, err := s.client.Do(ctx, req, &milestones) if err != nil { @@ -90,9 +87,6 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - milestone := new(Milestone) resp, err := s.client.Do(ctx, req, milestone) if err != nil { @@ -112,9 +106,6 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - m := new(Milestone) resp, err := s.client.Do(ctx, req, m) if err != nil { @@ -134,9 +125,6 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - m := new(Milestone) resp, err := s.client.Do(ctx, req, m) if err != nil { diff --git a/vendor/github.com/google/go-github/github/orgs.go b/vendor/github.com/google/go-github/github/orgs.go index 7832053582..044dff57af 100644 --- a/vendor/github.com/google/go-github/github/orgs.go +++ b/vendor/github.com/google/go-github/github/orgs.go @@ -21,6 +21,7 @@ type OrganizationsService service type Organization struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` Name *string `json:"name,omitempty"` @@ -43,7 +44,6 @@ type Organization struct { BillingEmail *string `json:"billing_email,omitempty"` Type *string `json:"type,omitempty"` Plan *Plan `json:"plan,omitempty"` - NodeID *string `json:"node_id,omitempty"` // API URLs URL *string `json:"url,omitempty"` @@ -101,9 +101,6 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opt *OrganizationsLi return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - orgs := []*Organization{} resp, err := s.client.Do(ctx, req, &orgs) if err != nil { @@ -133,9 +130,6 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opt *ListO return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var orgs []*Organization resp, err := s.client.Do(ctx, req, &orgs) if err != nil { @@ -155,9 +149,6 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - organization := new(Organization) resp, err := s.client.Do(ctx, req, organization) if err != nil { @@ -177,9 +168,6 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - organization := new(Organization) resp, err := s.client.Do(ctx, req, organization) if err != nil { @@ -199,9 +187,6 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - o := new(Organization) resp, err := s.client.Do(ctx, req, o) if err != nil { diff --git a/vendor/github.com/google/go-github/github/orgs_members.go b/vendor/github.com/google/go-github/github/orgs_members.go index 98e138e7e8..d18435999c 100644 --- a/vendor/github.com/google/go-github/github/orgs_members.go +++ b/vendor/github.com/google/go-github/github/orgs_members.go @@ -59,7 +59,7 @@ type ListMembersOptions struct { // Possible values are: // all - all members of the organization, regardless of role // admin - organization owners - // member - non-organization members + // member - non-owner organization members // // Default is "all". Role string `url:"role,omitempty"` diff --git a/vendor/github.com/google/go-github/github/orgs_teams.go b/vendor/github.com/google/go-github/github/orgs_teams.go deleted file mode 100644 index b3cc9f07da..0000000000 --- a/vendor/github.com/google/go-github/github/orgs_teams.go +++ /dev/null @@ -1,514 +0,0 @@ -// Copyright 2013 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" - "strings" - "time" -) - -// Team represents a team within a GitHub organization. Teams are used to -// manage access to an organization's repositories. -type Team struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - URL *string `json:"url,omitempty"` - Slug *string `json:"slug,omitempty"` - - // Permission specifies the default permission for repositories owned by the team. - Permission *string `json:"permission,omitempty"` - - // Privacy identifies the level of privacy this team should have. - // Possible values are: - // secret - only visible to organization owners and members of this team - // closed - visible to all members of this organization - // Default is "secret". - Privacy *string `json:"privacy,omitempty"` - - MembersCount *int `json:"members_count,omitempty"` - ReposCount *int `json:"repos_count,omitempty"` - Organization *Organization `json:"organization,omitempty"` - MembersURL *string `json:"members_url,omitempty"` - RepositoriesURL *string `json:"repositories_url,omitempty"` - Parent *Team `json:"parent,omitempty"` - - // LDAPDN is only available in GitHub Enterprise and when the team - // membership is synchronized with LDAP. - LDAPDN *string `json:"ldap_dn,omitempty"` -} - -func (t Team) String() string { - return Stringify(t) -} - -// Invitation represents a team member's invitation status. -type Invitation struct { - ID *int64 `json:"id,omitempty"` - Login *string `json:"login,omitempty"` - Email *string `json:"email,omitempty"` - // Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'. - Role *string `json:"role,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - Inviter *User `json:"inviter,omitempty"` - TeamCount *int `json:"team_count,omitempty"` - InvitationTeamURL *string `json:"invitation_team_url,omitempty"` -} - -func (i Invitation) String() string { - return Stringify(i) -} - -// ListTeams lists all of the teams for an organization. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-teams -func (s *OrganizationsService) ListTeams(ctx context.Context, org string, opt *ListOptions) ([]*Team, *Response, error) { - u := fmt.Sprintf("orgs/%v/teams", org) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) - if err != nil { - return nil, resp, err - } - - return teams, resp, nil -} - -// GetTeam fetches a team by ID. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team -func (s *OrganizationsService) GetTeam(ctx context.Context, team int64) (*Team, *Response, error) { - u := fmt.Sprintf("teams/%v", team) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - t := new(Team) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// NewTeam represents a team to be created or modified. -type NewTeam struct { - Name string `json:"name"` // Name of the team. (Required.) - Description *string `json:"description,omitempty"` - Maintainers []string `json:"maintainers,omitempty"` - RepoNames []string `json:"repo_names,omitempty"` - ParentTeamID *int64 `json:"parent_team_id,omitempty"` - - // Deprecated: Permission is deprecated when creating or editing a team in an org - // using the new GitHub permission model. It no longer identifies the - // permission a team has on its repos, but only specifies the default - // permission a repo is initially added with. Avoid confusion by - // specifying a permission value when calling AddTeamRepo. - Permission *string `json:"permission,omitempty"` - - // Privacy identifies the level of privacy this team should have. - // Possible values are: - // secret - only visible to organization owners and members of this team - // closed - visible to all members of this organization - // Default is "secret". - Privacy *string `json:"privacy,omitempty"` - - // LDAPDN may be used in GitHub Enterprise when the team membership - // is synchronized with LDAP. - LDAPDN *string `json:"ldap_dn,omitempty"` -} - -func (s NewTeam) String() string { - return Stringify(s) -} - -// CreateTeam creates a new team within an organization. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#create-team -func (s *OrganizationsService) CreateTeam(ctx context.Context, org string, team *NewTeam) (*Team, *Response, error) { - u := fmt.Sprintf("orgs/%v/teams", org) - req, err := s.client.NewRequest("POST", u, team) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - t := new(Team) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// EditTeam edits a team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#edit-team -func (s *OrganizationsService) EditTeam(ctx context.Context, id int64, team *NewTeam) (*Team, *Response, error) { - u := fmt.Sprintf("teams/%v", id) - req, err := s.client.NewRequest("PATCH", u, team) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - t := new(Team) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// DeleteTeam deletes a team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#delete-team -func (s *OrganizationsService) DeleteTeam(ctx context.Context, team int64) (*Response, error) { - u := fmt.Sprintf("teams/%v", team) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - return s.client.Do(ctx, req, nil) -} - -// OrganizationListTeamMembersOptions specifies the optional parameters to the -// OrganizationsService.ListTeamMembers method. -type OrganizationListTeamMembersOptions struct { - // Role filters members returned by their role in the team. Possible - // values are "all", "member", "maintainer". Default is "all". - Role string `url:"role,omitempty"` - - ListOptions -} - -// ListChildTeams lists child teams for a team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-child-teams -func (s *OrganizationsService) ListChildTeams(ctx context.Context, teamID int64, opt *ListOptions) ([]*Team, *Response, error) { - u := fmt.Sprintf("teams/%v/teams", teamID) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) - if err != nil { - return nil, resp, err - } - - return teams, resp, nil -} - -// ListTeamMembers lists all of the users who are members of the specified -// team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-team-members -func (s *OrganizationsService) ListTeamMembers(ctx context.Context, team int64, opt *OrganizationListTeamMembersOptions) ([]*User, *Response, error) { - u := fmt.Sprintf("teams/%v/members", team) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - var members []*User - resp, err := s.client.Do(ctx, req, &members) - if err != nil { - return nil, resp, err - } - - return members, resp, nil -} - -// IsTeamMember checks if a user is a member of the specified team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team-member -// -// Deprecated: This API has been marked as deprecated in the Github API docs, -// OrganizationsService.GetTeamMembership method should be used instead. -func (s *OrganizationsService) IsTeamMember(ctx context.Context, team int64, user string) (bool, *Response, error) { - u := fmt.Sprintf("teams/%v/members/%v", team, user) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return false, nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - member, err := parseBoolResponse(err) - return member, resp, err -} - -// ListTeamRepos lists the repositories that the specified team has access to. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-team-repos -func (s *OrganizationsService) ListTeamRepos(ctx context.Context, team int64, opt *ListOptions) ([]*Repository, *Response, error) { - u := fmt.Sprintf("teams/%v/repos", team) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when topics API fully launches. - headers := []string{mediaTypeTopicsPreview, mediaTypeNestedTeamsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) - - var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) - if err != nil { - return nil, resp, err - } - - return repos, resp, nil -} - -// IsTeamRepo checks if a team manages the specified repository. If the -// repository is managed by team, a Repository is returned which includes the -// permissions team has for that repo. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#check-if-a-team-manages-a-repository -func (s *OrganizationsService) IsTeamRepo(ctx context.Context, team int64, owner string, repo string) (*Repository, *Response, error) { - u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - headers := []string{mediaTypeOrgPermissionRepo, mediaTypeNestedTeamsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) - - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) - if err != nil { - return nil, resp, err - } - - return repository, resp, nil -} - -// OrganizationAddTeamRepoOptions specifies the optional parameters to the -// OrganizationsService.AddTeamRepo method. -type OrganizationAddTeamRepoOptions struct { - // Permission specifies the permission to grant the team on this repository. - // Possible values are: - // pull - team members can pull, but not push to or administer this repository - // push - team members can pull and push, but not administer this repository - // admin - team members can pull, push and administer this repository - // - // If not specified, the team's permission attribute will be used. - Permission string `json:"permission,omitempty"` -} - -// AddTeamRepo adds a repository to be managed by the specified team. The -// specified repository must be owned by the organization to which the team -// belongs, or a direct fork of a repository owned by the organization. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#add-team-repo -func (s *OrganizationsService) AddTeamRepo(ctx context.Context, team int64, owner string, repo string, opt *OrganizationAddTeamRepoOptions) (*Response, error) { - u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) - req, err := s.client.NewRequest("PUT", u, opt) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// RemoveTeamRepo removes a repository from being managed by the specified -// team. Note that this does not delete the repository, it just removes it -// from the team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#remove-team-repo -func (s *OrganizationsService) RemoveTeamRepo(ctx context.Context, team int64, owner string, repo string) (*Response, error) { - u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// ListUserTeams lists a user's teams -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-user-teams -func (s *OrganizationsService) ListUserTeams(ctx context.Context, opt *ListOptions) ([]*Team, *Response, error) { - u := "user/teams" - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) - if err != nil { - return nil, resp, err - } - - return teams, resp, nil -} - -// GetTeamMembership returns the membership status for a user in a team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team-membership -func (s *OrganizationsService) GetTeamMembership(ctx context.Context, team int64, user string) (*Membership, *Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeNestedTeamsPreview) - - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// OrganizationAddTeamMembershipOptions does stuff specifies the optional -// parameters to the OrganizationsService.AddTeamMembership method. -type OrganizationAddTeamMembershipOptions struct { - // Role specifies the role the user should have in the team. Possible - // values are: - // member - a normal member of the team - // maintainer - a team maintainer. Able to add/remove other team - // members, promote other team members to team - // maintainer, and edit the team’s name and description - // - // Default value is "member". - Role string `json:"role,omitempty"` -} - -// AddTeamMembership adds or invites a user to a team. -// -// In order to add a membership between a user and a team, the authenticated -// user must have 'admin' permissions to the team or be an owner of the -// organization that the team is associated with. -// -// If the user is already a part of the team's organization (meaning they're on -// at least one other team in the organization), this endpoint will add the -// user to the team. -// -// If the user is completely unaffiliated with the team's organization (meaning -// they're on none of the organization's teams), this endpoint will send an -// invitation to the user via email. This newly-created membership will be in -// the "pending" state until the user accepts the invitation, at which point -// the membership will transition to the "active" state and the user will be -// added as a member of the team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#add-team-membership -func (s *OrganizationsService) AddTeamMembership(ctx context.Context, team int64, user string, opt *OrganizationAddTeamMembershipOptions) (*Membership, *Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("PUT", u, opt) - if err != nil { - return nil, nil, err - } - - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// RemoveTeamMembership removes a user from a team. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#remove-team-membership -func (s *OrganizationsService) RemoveTeamMembership(ctx context.Context, team int64, user string) (*Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// ListPendingTeamInvitations get pending invitaion list in team. -// Warning: The API may change without advance notice during the preview period. -// Preview features are not supported for production use. -// -// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-pending-team-invitations -func (s *OrganizationsService) ListPendingTeamInvitations(ctx context.Context, team int64, opt *ListOptions) ([]*Invitation, *Response, error) { - u := fmt.Sprintf("teams/%v/invitations", team) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var pendingInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &pendingInvitations) - if err != nil { - return nil, resp, err - } - - return pendingInvitations, resp, nil -} diff --git a/vendor/github.com/google/go-github/github/projects.go b/vendor/github.com/google/go-github/github/projects.go index 4df8a49e5c..614870f518 100644 --- a/vendor/github.com/google/go-github/github/projects.go +++ b/vendor/github.com/google/go-github/github/projects.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ProjectsService provides access to the projects functions in the @@ -48,8 +47,7 @@ func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, * } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) project := &Project{} resp, err := s.client.Do(ctx, req, project) @@ -87,8 +85,7 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opt *Proj } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) project := &Project{} resp, err := s.client.Do(ctx, req, project) @@ -143,8 +140,7 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) columns := []*ProjectColumn{} resp, err := s.client.Do(ctx, req, &columns) @@ -166,8 +162,7 @@ func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*Proj } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) column := &ProjectColumn{} resp, err := s.client.Do(ctx, req, column) @@ -197,8 +192,7 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) column := &ProjectColumn{} resp, err := s.client.Do(ctx, req, column) @@ -220,8 +214,7 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) column := &ProjectColumn{} resp, err := s.client.Do(ctx, req, column) @@ -317,8 +310,7 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) cards := []*ProjectCard{} resp, err := s.client.Do(ctx, req, &cards) @@ -340,8 +332,7 @@ func (s *ProjectsService) GetProjectCard(ctx context.Context, columnID int64) (* } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) card := &ProjectCard{} resp, err := s.client.Do(ctx, req, card) @@ -379,8 +370,7 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) card := &ProjectCard{} resp, err := s.client.Do(ctx, req, card) @@ -402,8 +392,7 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) card := &ProjectCard{} resp, err := s.client.Do(ctx, req, card) diff --git a/vendor/github.com/google/go-github/github/pulls.go b/vendor/github.com/google/go-github/github/pulls.go index 1f344690bc..a123ec5686 100644 --- a/vendor/github.com/google/go-github/github/pulls.go +++ b/vendor/github.com/google/go-github/github/pulls.go @@ -62,6 +62,10 @@ type PullRequest struct { Head *PullRequestBranch `json:"head,omitempty"` Base *PullRequestBranch `json:"base,omitempty"` + + // ActiveLockReason is populated only when LockReason is provided while locking the pull request. + // Possible values are: "off-topic", "too heated", "resolved", and "spam". + ActiveLockReason *string `json:"active_lock_reason,omitempty"` } func (p PullRequest) String() string { @@ -119,7 +123,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var pulls []*PullRequest @@ -142,7 +146,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) pull := new(PullRequest) @@ -201,8 +205,7 @@ func (s *PullRequestsService) Create(ctx context.Context, owner string, repo str } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) p := new(PullRequest) resp, err := s.client.Do(ctx, req, p) @@ -251,7 +254,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) p := new(PullRequest) diff --git a/vendor/github.com/google/go-github/github/reactions.go b/vendor/github.com/google/go-github/github/reactions.go index 19b533f39f..97b2818cd5 100644 --- a/vendor/github.com/google/go-github/github/reactions.go +++ b/vendor/github.com/google/go-github/github/reactions.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ReactionsService provides access to the reactions-related functions in the @@ -61,8 +60,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction resp, err := s.client.Do(ctx, req, &m) @@ -88,8 +86,7 @@ func (s ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) m := &Reaction{} resp, err := s.client.Do(ctx, req, m) @@ -116,8 +113,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction resp, err := s.client.Do(ctx, req, &m) @@ -143,8 +139,7 @@ func (s ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo s } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) m := &Reaction{} resp, err := s.client.Do(ctx, req, m) @@ -171,8 +166,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction resp, err := s.client.Do(ctx, req, &m) @@ -198,8 +192,7 @@ func (s ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) m := &Reaction{} resp, err := s.client.Do(ctx, req, m) @@ -226,8 +219,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction resp, err := s.client.Do(ctx, req, &m) @@ -253,8 +245,7 @@ func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeReactionsPreview) m := &Reaction{} resp, err := s.client.Do(ctx, req, m) diff --git a/vendor/github.com/google/go-github/github/repos.go b/vendor/github.com/google/go-github/github/repos.go index fbc059c6b2..fe05272a93 100644 --- a/vendor/github.com/google/go-github/github/repos.go +++ b/vendor/github.com/google/go-github/github/repos.go @@ -20,6 +20,7 @@ type RepositoriesService service // Repository represents a GitHub repository. type Repository struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` FullName *string `json:"full_name,omitempty"` @@ -567,6 +568,9 @@ type PullRequestReviewsEnforcement struct { DismissStaleReviews bool `json:"dismiss_stale_reviews"` // RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner. RequireCodeOwnerReviews bool `json:"require_code_owner_reviews"` + // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. + // Valid values are 1-6. + RequiredApprovingReviewCount int `json:"required_approving_review_count"` } // PullRequestReviewsEnforcementRequest represents request to set the pull request review @@ -581,6 +585,9 @@ type PullRequestReviewsEnforcementRequest struct { DismissStaleReviews bool `json:"dismiss_stale_reviews"` // RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner. RequireCodeOwnerReviews bool `json:"require_code_owner_reviews"` + // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. + // Valid values are 1-6. + RequiredApprovingReviewCount int `json:"required_approving_review_count"` } // PullRequestReviewsEnforcementUpdate represents request to patch the pull request review @@ -593,6 +600,9 @@ type PullRequestReviewsEnforcementUpdate struct { DismissStaleReviews *bool `json:"dismiss_stale_reviews,omitempty"` // RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner. RequireCodeOwnerReviews bool `json:"require_code_owner_reviews,omitempty"` + // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. + // Valid values are 1 - 6. + RequiredApprovingReviewCount int `json:"required_approving_review_count"` } // AdminEnforcement represents the configuration to enforce required status checks for repository administrators. @@ -657,7 +667,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) var branches []*Branch resp, err := s.client.Do(ctx, req, &branches) @@ -679,7 +689,7 @@ func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) b := new(Branch) resp, err := s.client.Do(ctx, req, b) @@ -701,7 +711,7 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) p := new(Protection) resp, err := s.client.Do(ctx, req, p) @@ -723,7 +733,7 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) p := new(RequiredStatusChecks) resp, err := s.client.Do(ctx, req, p) @@ -745,7 +755,7 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) resp, err = s.client.Do(ctx, req, &contexts) if err != nil { @@ -766,7 +776,7 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) p := new(Protection) resp, err := s.client.Do(ctx, req, p) @@ -788,7 +798,7 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) return s.client.Do(ctx, req, nil) } @@ -842,7 +852,7 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) r := new(PullRequestReviewsEnforcement) resp, err := s.client.Do(ctx, req, r) @@ -865,7 +875,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) r := new(PullRequestReviewsEnforcement) resp, err := s.client.Do(ctx, req, r) @@ -893,7 +903,7 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) r := new(PullRequestReviewsEnforcement) resp, err := s.client.Do(ctx, req, r) @@ -915,7 +925,7 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) return s.client.Do(ctx, req, nil) } @@ -931,7 +941,7 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) r := new(AdminEnforcement) resp, err := s.client.Do(ctx, req, r) @@ -954,7 +964,7 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) r := new(AdminEnforcement) resp, err := s.client.Do(ctx, req, r) @@ -976,7 +986,7 @@ func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, } // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/github/repos_deployments.go b/vendor/github.com/google/go-github/github/repos_deployments.go index 1300f05ee2..794c3232ed 100644 --- a/vendor/github.com/google/go-github/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/github/repos_deployments.go @@ -9,7 +9,6 @@ import ( "context" "encoding/json" "fmt" - "strings" ) // Deployment represents a deployment in a repo @@ -76,9 +75,6 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var deployments []*Deployment resp, err := s.client.Do(ctx, req, &deployments) if err != nil { @@ -99,9 +95,6 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - deployment := new(Deployment) resp, err := s.client.Do(ctx, req, deployment) if err != nil { @@ -123,8 +116,7 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(Deployment) resp, err := s.client.Do(ctx, req, d) @@ -176,9 +168,6 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var statuses []*DeploymentStatus resp, err := s.client.Do(ctx, req, &statuses) if err != nil { @@ -200,8 +189,7 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(DeploymentStatus) resp, err := s.client.Do(ctx, req, d) @@ -224,8 +212,7 @@ func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(DeploymentStatus) resp, err := s.client.Do(ctx, req, d) diff --git a/vendor/github.com/google/go-github/github/repos_projects.go b/vendor/github.com/google/go-github/github/repos_projects.go index 97a045f6dd..d6486d293c 100644 --- a/vendor/github.com/google/go-github/github/repos_projects.go +++ b/vendor/github.com/google/go-github/github/repos_projects.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ProjectListOptions specifies the optional parameters to the @@ -36,8 +35,7 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -59,8 +57,7 @@ func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo str } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeProjectsPreview, mediaTypeGraphQLNodeIDPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) project := &Project{} resp, err := s.client.Do(ctx, req, project) diff --git a/vendor/github.com/google/go-github/github/repos_releases.go b/vendor/github.com/google/go-github/github/repos_releases.go index d5dfc702f2..c23601d1a5 100644 --- a/vendor/github.com/google/go-github/github/repos_releases.go +++ b/vendor/github.com/google/go-github/github/repos_releases.go @@ -79,9 +79,6 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var releases []*RepositoryRelease resp, err := s.client.Do(ctx, req, &releases) if err != nil { @@ -120,9 +117,6 @@ func (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - release := new(RepositoryRelease) resp, err := s.client.Do(ctx, req, release) if err != nil { @@ -142,9 +136,6 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - r := new(RepositoryRelease) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -164,9 +155,6 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - r := new(RepositoryRelease) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -203,9 +191,6 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - var assets []*ReleaseAsset resp, err := s.client.Do(ctx, req, &assets) if err != nil { @@ -225,9 +210,6 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - asset := new(ReleaseAsset) resp, err := s.client.Do(ctx, req, asset) if err != nil { @@ -292,9 +274,6 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - asset := new(ReleaseAsset) resp, err := s.client.Do(ctx, req, asset) if err != nil { @@ -341,9 +320,6 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) - asset := new(ReleaseAsset) resp, err := s.client.Do(ctx, req, asset) if err != nil { diff --git a/vendor/github.com/google/go-github/github/search.go b/vendor/github.com/google/go-github/github/search.go index 6e0000df88..abaf5e1f0b 100644 --- a/vendor/github.com/google/go-github/github/search.go +++ b/vendor/github.com/google/go-github/github/search.go @@ -8,7 +8,9 @@ package github import ( "context" "fmt" + "net/url" "strconv" + "strings" qs "github.com/google/go-querystring/query" ) @@ -221,11 +223,15 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter if err != nil { return nil, err } - params.Set("q", parameters.Query) + q := strings.Replace(parameters.Query, " ", "+", -1) if parameters.RepositoryID != nil { params.Set("repository_id", strconv.FormatInt(*parameters.RepositoryID, 10)) } - u := fmt.Sprintf("search/%s?%s", searchType, params.Encode()) + query := "q=" + url.PathEscape(q) + if v := params.Encode(); v != "" { + query = query + "&" + v + } + u := fmt.Sprintf("search/%s?%s", searchType, query) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/github/teams.go b/vendor/github.com/google/go-github/github/teams.go index 1021d538fd..c3773e00e3 100644 --- a/vendor/github.com/google/go-github/github/teams.go +++ b/vendor/github.com/google/go-github/github/teams.go @@ -1,7 +1,357 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package github +import ( + "context" + "fmt" + "strings" + "time" +) + // TeamsService provides access to the team-related functions // in the GitHub API. // // GitHub API docs: https://developer.github.com/v3/teams/ type TeamsService service + +// Team represents a team within a GitHub organization. Teams are used to +// manage access to an organization's repositories. +type Team struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + URL *string `json:"url,omitempty"` + Slug *string `json:"slug,omitempty"` + + // Permission specifies the default permission for repositories owned by the team. + Permission *string `json:"permission,omitempty"` + + // Privacy identifies the level of privacy this team should have. + // Possible values are: + // secret - only visible to organization owners and members of this team + // closed - visible to all members of this organization + // Default is "secret". + Privacy *string `json:"privacy,omitempty"` + + MembersCount *int `json:"members_count,omitempty"` + ReposCount *int `json:"repos_count,omitempty"` + Organization *Organization `json:"organization,omitempty"` + MembersURL *string `json:"members_url,omitempty"` + RepositoriesURL *string `json:"repositories_url,omitempty"` + Parent *Team `json:"parent,omitempty"` + + // LDAPDN is only available in GitHub Enterprise and when the team + // membership is synchronized with LDAP. + LDAPDN *string `json:"ldap_dn,omitempty"` +} + +func (t Team) String() string { + return Stringify(t) +} + +// Invitation represents a team member's invitation status. +type Invitation struct { + ID *int64 `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + Email *string `json:"email,omitempty"` + // Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'. + Role *string `json:"role,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Inviter *User `json:"inviter,omitempty"` + TeamCount *int `json:"team_count,omitempty"` + InvitationTeamURL *string `json:"invitation_team_url,omitempty"` +} + +func (i Invitation) String() string { + return Stringify(i) +} + +// ListTeams lists all of the teams for an organization. +// +// GitHub API docs: https://developer.github.com/v3/teams/#list-teams +func (s *TeamsService) ListTeams(ctx context.Context, org string, opt *ListOptions) ([]*Team, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams", org) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// GetTeam fetches a team by ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/#get-team +func (s *TeamsService) GetTeam(ctx context.Context, team int64) (*Team, *Response, error) { + u := fmt.Sprintf("teams/%v", team) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + t := new(Team) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// NewTeam represents a team to be created or modified. +type NewTeam struct { + Name string `json:"name"` // Name of the team. (Required.) + Description *string `json:"description,omitempty"` + Maintainers []string `json:"maintainers,omitempty"` + RepoNames []string `json:"repo_names,omitempty"` + ParentTeamID *int64 `json:"parent_team_id,omitempty"` + + // Deprecated: Permission is deprecated when creating or editing a team in an org + // using the new GitHub permission model. It no longer identifies the + // permission a team has on its repos, but only specifies the default + // permission a repo is initially added with. Avoid confusion by + // specifying a permission value when calling AddTeamRepo. + Permission *string `json:"permission,omitempty"` + + // Privacy identifies the level of privacy this team should have. + // Possible values are: + // secret - only visible to organization owners and members of this team + // closed - visible to all members of this organization + // Default is "secret". + Privacy *string `json:"privacy,omitempty"` + + // LDAPDN may be used in GitHub Enterprise when the team membership + // is synchronized with LDAP. + LDAPDN *string `json:"ldap_dn,omitempty"` +} + +func (s NewTeam) String() string { + return Stringify(s) +} + +// CreateTeam creates a new team within an organization. +// +// GitHub API docs: https://developer.github.com/v3/teams/#create-team +func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams", org) + req, err := s.client.NewRequest("POST", u, team) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + t := new(Team) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// EditTeam edits a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/#edit-team +func (s *TeamsService) EditTeam(ctx context.Context, id int64, team NewTeam) (*Team, *Response, error) { + u := fmt.Sprintf("teams/%v", id) + req, err := s.client.NewRequest("PATCH", u, team) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + t := new(Team) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// DeleteTeam deletes a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/#delete-team +func (s *TeamsService) DeleteTeam(ctx context.Context, team int64) (*Response, error) { + u := fmt.Sprintf("teams/%v", team) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + return s.client.Do(ctx, req, nil) +} + +// ListChildTeams lists child teams for a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/#list-child-teams +func (s *TeamsService) ListChildTeams(ctx context.Context, teamID int64, opt *ListOptions) ([]*Team, *Response, error) { + u := fmt.Sprintf("teams/%v/teams", teamID) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// ListTeamRepos lists the repositories that the specified team has access to. +// +// GitHub API docs: https://developer.github.com/v3/teams/#list-team-repos +func (s *TeamsService) ListTeamRepos(ctx context.Context, team int64, opt *ListOptions) ([]*Repository, *Response, error) { + u := fmt.Sprintf("teams/%v/repos", team) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when topics API fully launches. + headers := []string{mediaTypeTopicsPreview, mediaTypeNestedTeamsPreview} + req.Header.Set("Accept", strings.Join(headers, ", ")) + + var repos []*Repository + resp, err := s.client.Do(ctx, req, &repos) + if err != nil { + return nil, resp, err + } + + return repos, resp, nil +} + +// IsTeamRepo checks if a team manages the specified repository. If the +// repository is managed by team, a Repository is returned which includes the +// permissions team has for that repo. +// +// GitHub API docs: https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository +func (s *TeamsService) IsTeamRepo(ctx context.Context, team int64, owner string, repo string) (*Repository, *Response, error) { + u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + headers := []string{mediaTypeOrgPermissionRepo, mediaTypeNestedTeamsPreview} + req.Header.Set("Accept", strings.Join(headers, ", ")) + + repository := new(Repository) + resp, err := s.client.Do(ctx, req, repository) + if err != nil { + return nil, resp, err + } + + return repository, resp, nil +} + +// TeamAddTeamRepoOptions specifies the optional parameters to the +// TeamsService.AddTeamRepo method. +type TeamAddTeamRepoOptions struct { + // Permission specifies the permission to grant the team on this repository. + // Possible values are: + // pull - team members can pull, but not push to or administer this repository + // push - team members can pull and push, but not administer this repository + // admin - team members can pull, push and administer this repository + // + // If not specified, the team's permission attribute will be used. + Permission string `json:"permission,omitempty"` +} + +// AddTeamRepo adds a repository to be managed by the specified team. The +// specified repository must be owned by the organization to which the team +// belongs, or a direct fork of a repository owned by the organization. +// +// GitHub API docs: https://developer.github.com/v3/teams/#add-team-repo +func (s *TeamsService) AddTeamRepo(ctx context.Context, team int64, owner string, repo string, opt *TeamAddTeamRepoOptions) (*Response, error) { + u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveTeamRepo removes a repository from being managed by the specified +// team. Note that this does not delete the repository, it just removes it +// from the team. +// +// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-repo +func (s *TeamsService) RemoveTeamRepo(ctx context.Context, team int64, owner string, repo string) (*Response, error) { + u := fmt.Sprintf("teams/%v/repos/%v/%v", team, owner, repo) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListUserTeams lists a user's teams +// GitHub API docs: https://developer.github.com/v3/teams/#list-user-teams +func (s *TeamsService) ListUserTeams(ctx context.Context, opt *ListOptions) ([]*Team, *Response, error) { + u := "user/teams" + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} diff --git a/vendor/github.com/google/go-github/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/github/teams_discussion_comments.go index 26d0e8c506..383d559eef 100644 --- a/vendor/github.com/google/go-github/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/github/teams_discussion_comments.go @@ -21,7 +21,7 @@ type DiscussionComment struct { DiscussionURL *string `json:"discussion_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` NodeID *string `json:"node_id,omitempty"` - Number *int64 `json:"number,omitempty"` + Number *int `json:"number,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` URL *string `json:"url,omitempty"` } diff --git a/vendor/github.com/google/go-github/github/teams_discussions.go b/vendor/github.com/google/go-github/github/teams_discussions.go index fc9b25a58d..5db06d109c 100644 --- a/vendor/github.com/google/go-github/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/github/teams_discussions.go @@ -16,13 +16,13 @@ type TeamDiscussion struct { Body *string `json:"body,omitempty"` BodyHTML *string `json:"body_html,omitempty"` BodyVersion *string `json:"body_version,omitempty"` - CommentsCount *int64 `json:"comments_count,omitempty"` + CommentsCount *int `json:"comments_count,omitempty"` CommentsURL *string `json:"comments_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` LastEditedAt *Timestamp `json:"last_edited_at,omitempty"` HTMLURL *string `json:"html_url,omitempty"` NodeID *string `json:"node_id,omitempty"` - Number *int64 `json:"number,omitempty"` + Number *int `json:"number,omitempty"` Pinned *bool `json:"pinned,omitempty"` Private *bool `json:"private,omitempty"` TeamURL *string `json:"team_url,omitempty"` diff --git a/vendor/github.com/google/go-github/github/teams_members.go b/vendor/github.com/google/go-github/github/teams_members.go new file mode 100644 index 0000000000..d5cfa0dc7d --- /dev/null +++ b/vendor/github.com/google/go-github/github/teams_members.go @@ -0,0 +1,174 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// TeamListTeamMembersOptions specifies the optional parameters to the +// TeamsService.ListTeamMembers method. +type TeamListTeamMembersOptions struct { + // Role filters members returned by their role in the team. Possible + // values are "all", "member", "maintainer". Default is "all". + Role string `url:"role,omitempty"` + + ListOptions +} + +// ListTeamMembers lists all of the users who are members of the specified +// team. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-team-members +func (s *TeamsService) ListTeamMembers(ctx context.Context, team int64, opt *TeamListTeamMembersOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("teams/%v/members", team) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + var members []*User + resp, err := s.client.Do(ctx, req, &members) + if err != nil { + return nil, resp, err + } + + return members, resp, nil +} + +// IsTeamMember checks if a user is a member of the specified team. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-member +// +// Deprecated: This API has been marked as deprecated in the Github API docs, +// TeamsService.GetTeamMembership method should be used instead. +func (s *TeamsService) IsTeamMember(ctx context.Context, team int64, user string) (bool, *Response, error) { + u := fmt.Sprintf("teams/%v/members/%v", team, user) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return false, nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + member, err := parseBoolResponse(err) + return member, resp, err +} + +// GetTeamMembership returns the membership status for a user in a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-membership +func (s *TeamsService) GetTeamMembership(ctx context.Context, team int64, user string) (*Membership, *Response, error) { + u := fmt.Sprintf("teams/%v/memberships/%v", team, user) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeNestedTeamsPreview) + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// TeamAddTeamMembershipOptions specifies the optional +// parameters to the TeamsService.AddTeamMembership method. +type TeamAddTeamMembershipOptions struct { + // Role specifies the role the user should have in the team. Possible + // values are: + // member - a normal member of the team + // maintainer - a team maintainer. Able to add/remove other team + // members, promote other team members to team + // maintainer, and edit the team’s name and description + // + // Default value is "member". + Role string `json:"role,omitempty"` +} + +// AddTeamMembership adds or invites a user to a team. +// +// In order to add a membership between a user and a team, the authenticated +// user must have 'admin' permissions to the team or be an owner of the +// organization that the team is associated with. +// +// If the user is already a part of the team's organization (meaning they're on +// at least one other team in the organization), this endpoint will add the +// user to the team. +// +// If the user is completely unaffiliated with the team's organization (meaning +// they're on none of the organization's teams), this endpoint will send an +// invitation to the user via email. This newly-created membership will be in +// the "pending" state until the user accepts the invitation, at which point +// the membership will transition to the "active" state and the user will be +// added as a member of the team. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#add-or-update-team-membership +func (s *TeamsService) AddTeamMembership(ctx context.Context, team int64, user string, opt *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { + u := fmt.Sprintf("teams/%v/memberships/%v", team, user) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, nil, err + } + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// RemoveTeamMembership removes a user from a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#remove-team-membership +func (s *TeamsService) RemoveTeamMembership(ctx context.Context, team int64, user string) (*Response, error) { + u := fmt.Sprintf("teams/%v/memberships/%v", team, user) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListPendingTeamInvitations get pending invitaion list in team. +// Warning: The API may change without advance notice during the preview period. +// Preview features are not supported for production use. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-pending-team-invitations +func (s *TeamsService) ListPendingTeamInvitations(ctx context.Context, team int64, opt *ListOptions) ([]*Invitation, *Response, error) { + u := fmt.Sprintf("teams/%v/invitations", team) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var pendingInvitations []*Invitation + resp, err := s.client.Do(ctx, req, &pendingInvitations) + if err != nil { + return nil, resp, err + } + + return pendingInvitations, resp, nil +} diff --git a/vendor/github.com/google/go-github/github/users.go b/vendor/github.com/google/go-github/github/users.go index 8c4efe1d9b..f164d559ed 100644 --- a/vendor/github.com/google/go-github/github/users.go +++ b/vendor/github.com/google/go-github/github/users.go @@ -20,6 +20,7 @@ type UsersService service type User struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` GravatarID *string `json:"gravatar_id,omitempty"` @@ -134,6 +135,56 @@ func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, return uResp, resp, nil } +// HovercardOptions specifies optional parameters to the UsersService.GetHovercard +// method. +type HovercardOptions struct { + // SubjectType specifies the additional information to be received about the hovercard. + // Possible values are: organization, repository, issue, pull_request. (Required when using subject_id.) + SubjectType string `url:"subject_type"` + + // SubjectID specifies the ID for the SubjectType. (Required when using subject_type.) + SubjectID string `url:"subject_id"` +} + +// Hovercard represents hovercard information about a user. +type Hovercard struct { + Contexts []*UserContext `json:"contexts,omitempty"` +} + +// UserContext represents the contextual information about user. +type UserContext struct { + Message *string `json:"message,omitempty"` + Octicon *string `json:"octicon,omitempty"` +} + +// GetHovercard fetches contextual information about user. It requires authentication +// via Basic Auth or via OAuth with the repo scope. +// +// GitHub API docs: https://developer.github.com/v3/users/#get-contextual-information-about-a-user +func (s *UsersService) GetHovercard(ctx context.Context, user string, opt *HovercardOptions) (*Hovercard, *Response, error) { + u := fmt.Sprintf("users/%v/hovercard", user) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeHovercardPreview) + + hc := new(Hovercard) + resp, err := s.client.Do(ctx, req, hc) + if err != nil { + return nil, resp, err + } + + return hc, resp, nil +} + // UserListOptions specifies optional parameters to the UsersService.ListAll // method. type UserListOptions struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 6073f8322f..f79d022403 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,7 +54,7 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github v16.0.0+incompatible +# github.com/google/go-github v17.0.0+incompatible github.com/google/go-github/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query From 190238595c48b40ca8f4118ce79138fc83eaf877 Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:20:18 +0000 Subject: [PATCH 2/9] vendor: github.com/google/go-github/github@v18.0.0 Update imports as go-github converted to using modules starting with v18. Signed-off-by: Trevor Bramwell --- github/config.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 12 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- ...source_github_organization_webhook_test.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_project.go | 14 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 2 +- ...resource_github_repository_webhook_test.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 7 +- go.sum | 18 +- .../google/go-github/{ => v18}/AUTHORS | 19 + .../google/go-github/{ => v18}/LICENSE | 0 .../go-github/{ => v18}/github/activity.go | 0 .../{ => v18}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{ => v18}/github/activity_star.go | 0 .../{ => v18}/github/activity_watching.go | 0 .../go-github/{ => v18}/github/admin.go | 0 .../go-github/{ => v18}/github/admin_stats.go | 0 .../google/go-github/{ => v18}/github/apps.go | 7 + .../{ => v18}/github/apps_installation.go | 0 .../{ => v18}/github/apps_marketplace.go | 0 .../{ => v18}/github/authorizations.go | 0 .../go-github/{ => v18}/github/checks.go | 0 .../google/go-github/{ => v18}/github/doc.go | 0 .../go-github/{ => v18}/github/event_types.go | 66 +- .../{ => v18}/github/gen-accessors.go | 0 .../go-github/{ => v18}/github/gists.go | 0 .../{ => v18}/github/gists_comments.go | 0 .../google/go-github/{ => v18}/github/git.go | 0 .../go-github/{ => v18}/github/git_blobs.go | 0 .../go-github/{ => v18}/github/git_commits.go | 0 .../go-github/{ => v18}/github/git_refs.go | 0 .../go-github/{ => v18}/github/git_tags.go | 0 .../go-github/{ => v18}/github/git_trees.go | 0 .../{ => v18}/github/github-accessors.go | 82 +- .../go-github/{ => v18}/github/github.go | 0 .../go-github/{ => v18}/github/gitignore.go | 0 .../go-github/{ => v18}/github/issues.go | 0 .../{ => v18}/github/issues_assignees.go | 0 .../{ => v18}/github/issues_comments.go | 0 .../{ => v18}/github/issues_events.go | 0 .../{ => v18}/github/issues_labels.go | 0 .../{ => v18}/github/issues_milestones.go | 0 .../{ => v18}/github/issues_timeline.go | 0 .../go-github/{ => v18}/github/licenses.go | 0 .../go-github/{ => v18}/github/messages.go | 0 .../go-github/{ => v18}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{ => v18}/github/migrations_user.go | 0 .../google/go-github/{ => v18}/github/misc.go | 0 .../google/go-github/{ => v18}/github/orgs.go | 0 .../go-github/{ => v18}/github/orgs_hooks.go | 0 .../{ => v18}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{ => v18}/github/orgs_projects.go | 0 .../{ => v18}/github/orgs_users_blocking.go | 0 .../go-github/{ => v18}/github/projects.go | 38 +- .../go-github/{ => v18}/github/pulls.go | 0 .../{ => v18}/github/pulls_comments.go | 0 .../{ => v18}/github/pulls_reviewers.go | 0 .../{ => v18}/github/pulls_reviews.go | 0 .../go-github/{ => v18}/github/reactions.go | 0 .../go-github/{ => v18}/github/repos.go | 0 .../{ => v18}/github/repos_collaborators.go | 0 .../{ => v18}/github/repos_comments.go | 0 .../{ => v18}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{ => v18}/github/repos_contents.go | 0 .../{ => v18}/github/repos_deployments.go | 0 .../go-github/{ => v18}/github/repos_forks.go | 0 .../go-github/{ => v18}/github/repos_hooks.go | 0 .../{ => v18}/github/repos_invitations.go | 0 .../go-github/{ => v18}/github/repos_keys.go | 0 .../{ => v18}/github/repos_merging.go | 0 .../go-github/{ => v18}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{ => v18}/github/repos_projects.go | 0 .../{ => v18}/github/repos_releases.go | 0 .../go-github/{ => v18}/github/repos_stats.go | 0 .../{ => v18}/github/repos_statuses.go | 0 .../{ => v18}/github/repos_traffic.go | 0 .../go-github/{ => v18}/github/search.go | 0 .../go-github/{ => v18}/github/strings.go | 0 .../go-github/{ => v18}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{ => v18}/github/teams_discussions.go | 0 .../{ => v18}/github/teams_members.go | 0 .../go-github/{ => v18}/github/timestamp.go | 0 .../go-github/{ => v18}/github/users.go | 0 .../{ => v18}/github/users_administration.go | 0 .../{ => v18}/github/users_blocking.go | 0 .../{ => v18}/github/users_emails.go | 0 .../{ => v18}/github/users_followers.go | 0 .../{ => v18}/github/users_gpg_keys.go | 0 .../go-github/{ => v18}/github/users_keys.go | 0 .../{ => v18}/github/with_appengine.go | 0 .../{ => v18}/github/without_appengine.go | 0 vendor/golang.org/x/crypto/ed25519/ed25519.go | 47 +- .../internal/chacha20/chacha_generic.go | 426 ++++---- .../crypto/internal/chacha20/chacha_noasm.go | 16 + .../crypto/internal/chacha20/chacha_s390x.go | 30 + .../x/crypto/internal/chacha20/chacha_s390x.s | 283 +++++ .../x/crypto/internal/chacha20/xor.go | 43 + .../x/crypto/internal/subtle/aliasing.go | 32 + .../internal/subtle/aliasing_appengine.go | 35 + vendor/golang.org/x/crypto/openpgp/keys.go | 33 +- vendor/golang.org/x/crypto/openpgp/write.go | 172 +-- .../golang.org/x/crypto/poly1305/sum_noasm.go | 14 + .../golang.org/x/crypto/poly1305/sum_ref.go | 10 +- .../golang.org/x/crypto/poly1305/sum_s390x.go | 49 + .../golang.org/x/crypto/poly1305/sum_s390x.s | 400 +++++++ .../x/crypto/poly1305/sum_vmsl_s390x.s | 931 +++++++++++++++++ vendor/golang.org/x/crypto/ssh/cipher.go | 43 +- vendor/golang.org/x/crypto/ssh/client.go | 4 +- vendor/golang.org/x/crypto/ssh/keys.go | 5 +- vendor/golang.org/x/crypto/ssh/streamlocal.go | 1 + vendor/golang.org/x/crypto/ssh/tcpip.go | 9 + vendor/golang.org/x/net/html/parse.go | 103 +- vendor/golang.org/x/net/http/httpguts/guts.go | 15 - .../x/net/http2/client_conn_pool.go | 28 +- .../x/net/http2/configure_transport.go | 8 +- vendor/golang.org/x/net/http2/flow.go | 10 +- vendor/golang.org/x/net/http2/frame.go | 63 +- vendor/golang.org/x/net/http2/go111.go | 26 + vendor/golang.org/x/net/http2/go17.go | 15 + vendor/golang.org/x/net/http2/headermap.go | 20 +- .../golang.org/x/net/http2/hpack/huffman.go | 20 +- vendor/golang.org/x/net/http2/http2.go | 17 +- vendor/golang.org/x/net/http2/not_go111.go | 17 + vendor/golang.org/x/net/http2/not_go17.go | 8 + vendor/golang.org/x/net/http2/server.go | 65 +- vendor/golang.org/x/net/http2/transport.go | 207 +++- vendor/golang.org/x/net/http2/write.go | 4 - vendor/golang.org/x/net/trace/trace.go | 8 + vendor/golang.org/x/oauth2/internal/token.go | 4 + vendor/golang.org/x/oauth2/oauth2.go | 13 +- vendor/golang.org/x/oauth2/transport.go | 16 +- .../appengine/internal/api.go | 182 ++-- .../appengine/internal/api_classic.go | 16 +- .../appengine/internal/api_common.go | 39 +- .../appengine/internal/api_pre17.go | 682 ++++++++++++ .../appengine/internal/base/api_base.pb.go | 89 +- .../internal/datastore/datastore_v3.pb.go | 978 +++++++++++++----- .../internal/datastore/datastore_v3.proto | 10 + .../appengine/internal/identity_classic.go | 48 +- .../appengine/internal/identity_vm.go | 6 +- .../appengine/internal/log/log_service.pb.go | 348 +++++-- .../appengine/internal/main_vm.go | 6 +- .../internal/remote_api/remote_api.pb.go | 94 +- .../appengine/internal/transaction.go | 22 +- .../internal/urlfetch/urlfetch_service.pb.go | 116 ++- vendor/modules.txt | 13 +- 181 files changed, 5116 insertions(+), 1114 deletions(-) rename vendor/github.com/google/go-github/{ => v18}/AUTHORS (89%) rename vendor/github.com/google/go-github/{ => v18}/LICENSE (100%) rename vendor/github.com/google/go-github/{ => v18}/github/activity.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/admin.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/apps.go (95%) rename vendor/github.com/google/go-github/{ => v18}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/checks.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/doc.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/event_types.go (93%) rename vendor/github.com/google/go-github/{ => v18}/github/gen-accessors.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/gists.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git_commits.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/github-accessors.go (99%) rename vendor/github.com/google/go-github/{ => v18}/github/github.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/messages.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/misc.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/projects.go (91%) rename vendor/github.com/google/go-github/{ => v18}/github/pulls.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_commits.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_hooks.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/search.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/strings.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/teams.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{ => v18}/github/without_appengine.go (100%) create mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go create mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go create mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s create mode 100644 vendor/golang.org/x/crypto/internal/chacha20/xor.go create mode 100644 vendor/golang.org/x/crypto/internal/subtle/aliasing.go create mode 100644 vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_noasm.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_s390x.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_s390x.s create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s create mode 100644 vendor/golang.org/x/net/http2/go111.go create mode 100644 vendor/golang.org/x/net/http2/not_go111.go create mode 100644 vendor/google.golang.org/appengine/internal/api_pre17.go diff --git a/github/config.go b/github/config.go index 39f88190c8..a65738c1fb 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index 501335d265..c0be9f6fce 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 06f358da2e..1018f07759 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index 59018c6dab..683aacc280 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index c2dabc1128..cb5e33f81e 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index eb9036204d..e5b2c3880d 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index 52f3ca21d9..f49f974f12 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index b10a704cc3..7ca75349dc 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 1e8bef5d20..5a6b05df4e 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 5df7f23df2..6b5a402098 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) @@ -46,14 +46,15 @@ func resourceGithubOrganizationProjectCreate(d *schema.ResourceData, meta interf client := meta.(*Organization).client orgName := meta.(*Organization).name name := d.Get("name").(string) + body := d.Get("body").(string) ctx := context.Background() log.Printf("[DEBUG] Creating organization project: %s (%s)", name, orgName) project, _, err := client.Organizations.CreateProject(ctx, orgName, &github.ProjectOptions{ - Name: name, - Body: d.Get("body").(string), + Name: &name, + Body: &body, }, ) if err != nil { @@ -108,9 +109,10 @@ func resourceGithubOrganizationProjectUpdate(d *schema.ResourceData, meta interf orgName := meta.(*Organization).name name := d.Get("name").(string) + body := d.Get("body").(string) options := github.ProjectOptions{ - Name: name, - Body: d.Get("body").(string), + Name: &name, + Body: &body, } projectID, err := strconv.ParseInt(d.Id(), 10, 64) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index ee3a72b885..ae3765ddad 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index a7bbf344bc..5889c359b7 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index 4cba335d3d..04b8fee4f1 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index f4070dfab1..f14c91554f 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 5fa0077de4..bcf3fd1423 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 88614b1d17..32473a0b37 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index ccbf7a1885..e6d929be0b 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index 0c77867b07..e0e24bf163 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index dd2a50133a..23ebb43fcf 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) @@ -62,9 +62,10 @@ func resourceGithubRepositoryProjectCreate(d *schema.ResourceData, meta interfac orgName := meta.(*Organization).name repoName := d.Get("repository").(string) name := d.Get("name").(string) + body := d.Get("body").(string) options := github.ProjectOptions{ - Name: name, - Body: d.Get("body").(string), + Name: &name, + Body: &body, } ctx := context.Background() @@ -121,9 +122,12 @@ func resourceGithubRepositoryProjectRead(d *schema.ResourceData, meta interface{ func resourceGithubRepositoryProjectUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*Organization).client + name := d.Get("name").(string) + body := d.Get("body").(string) + options := github.ProjectOptions{ - Name: d.Get("name").(string), - Body: d.Get("body").(string), + Name: &name, + Body: &body, } projectID, err := strconv.ParseInt(d.Id(), 10, 64) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index 793e54a8dc..bbdbfb365a 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 327a3787cd..ea7b73ffca 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 055d8c5fdb..055bd55186 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index 1b9109a1a5..fec385b0fb 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 4b26c41801..ccab22eea0 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 2d2620a270..429aba464d 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index b72a1968d3..614552c095 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index 3624159a34..e3939fc122 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index efa7ad6430..4ff89a21fa 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index fe24d79247..c6f01b4cbb 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 75dfb1c81b..a08ec8d538 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index 49fbeed461..92b5eda7df 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index d97df1d1c1..e15142ea1a 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index f48d6c5ab1..ff6a7bc0da 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/transport.go b/github/transport.go index be78755611..9b16caf841 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index ea6c1c326d..4f81ee87e1 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index edd8b164a4..c84b29be61 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/github" + "github.com/google/go-github/v18/github" ) const ( diff --git a/go.mod b/go.mod index d25ac45719..2b92cef06e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github v17.0.0+incompatible + github.com/google/go-github/v18 v18.0.0 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect @@ -17,11 +17,8 @@ require ( github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac // indirect github.com/terraform-providers/terraform-provider-tls v1.2.0 github.com/zclconf/go-cty v0.0.0-20180328152515-d006e4534bc4 // indirect - golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f // indirect - golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7 // indirect - golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179 + golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be golang.org/x/text v0.0.0-20180327145029-ece95c760240 // indirect - google.golang.org/appengine v1.0.0 // indirect google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4 // indirect google.golang.org/grpc v0.0.0-20180508211726-45d7f3a23f0b // indirect gopkg.in/ini.v1 v1.42.0 // indirect diff --git a/go.sum b/go.sum index 511a8722b2..b065d3a9d3 100644 --- a/go.sum +++ b/go.sum @@ -74,10 +74,11 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-github v16.0.0+incompatible h1:omSHCJqM3CNG6RFFfGmIqGVbdQS2U3QVQSqACgwV1PY= -github.com/google/go-github v16.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github/v18 v18.0.0 h1:87etQr/RdxNeKgMN05p2JEfYKI4KzH47CbFvE7YpeoI= +github.com/google/go-github/v18 v18.0.0/go.mod h1:PVFtHjn6GZk2Z2E2siqOl01XmaQwtfnikCPCM+7WEVc= +github.com/google/go-github/v18 v18.2.0 h1:s7Y4I8ZlIL1Ofxpj4AQRJcSGAr0Jl2AHThHgXpsUCfU= +github.com/google/go-github/v18 v18.2.0/go.mod h1:Bf4Ut1RTeH0WuX7Z4Zf7N+qp/YqgcFOxvTLuSO+aY/k= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= @@ -263,14 +264,21 @@ github.com/zclconf/go-cty v0.0.0-20180328152515-d006e4534bc4/go.mod h1:LnDKxj8gN golang.org/x/crypto v0.0.0-20180211211603-9de5f2eaf759/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f h1:EDv9U2dOjZ9sVn985FJw58XWqRwhtTnd0RxCfIzqKI8= golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/net v0.0.0-20171004034648-a04bdaca5b32/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7 h1:vwPhSHmZ2xckGbhyz9c/u82CIp9iyzUDJHNXrRP0Xx8= golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/oauth2 v0.0.0-20170928010508-bb50c06baba3/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179 h1:i7nIATcLJZqBHx/NOl8hfnkelUjmcyEhCN1/oISBrUc= golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 h1:x6r4Jo0KNzOOzYd8lbcRsqjuqEASK6ob3auvWYM4/8U= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.0.0-20171013141220-c01e4764d870/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -283,6 +291,8 @@ google.golang.org/api v0.0.0-20171005000305-7a7376eff6a5/go.mod h1:4mhQ8q/RsB7i+ google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.0.0 h1:dN4LljjBKVChsv0XCSI+zbyzdqrkEwX5LQFUMRSGqOc= google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20171002232614-f676e0f3ac63/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4 h1:0rk3/gV3HbvCeUzVMhdxV3TEVKMVPDnayjN7sYRmcxY= google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/vendor/github.com/google/go-github/AUTHORS b/vendor/github.com/google/go-github/v18/AUTHORS similarity index 89% rename from vendor/github.com/google/go-github/AUTHORS rename to vendor/github.com/google/go-github/v18/AUTHORS index 56622a4c24..7c2f129117 100644 --- a/vendor/github.com/google/go-github/AUTHORS +++ b/vendor/github.com/google/go-github/v18/AUTHORS @@ -26,14 +26,17 @@ Andy Lindeman Anshuman Bhartiya Antoine Pelisse Anubha Kushwaha +appilon Aravind Arıl Bozoluk Austin Dizzy +Ben Batha Beshr Kayali Beyang Liu Billy Lynch Björn Häuser Brad Harris +Brad Moylan Bradley Falzon Brian Egizi Bryan Boreham @@ -54,7 +57,10 @@ Daniel Leavitt Dave Du Cros Dave Henderson David Deng +David Jannotta +Davide Zipeto Dennis Webb +Dhi Aurrahman Diego Lapiduz Dmitri Shuralyov dmnlk @@ -63,6 +69,7 @@ Doug Turner Drew Fradette Eli Uriegas Elliott Beach +Emerson Wood erwinvaneyk Fabrice Filippo Valsorda @@ -75,7 +82,9 @@ Georgy Buranov Gnahz Google Inc. griffin_stewie +Guillaume Jacquet Guz Alexander +Guðmundur Bjarni Ólafsson Hanno Hecker Hari haran haya14busa @@ -89,6 +98,7 @@ Jan Kosecki Jeremy Morris Jihoon Chung Jimmi Dyson +Joan Saum Joe Tsai John Barton John Engelman @@ -96,6 +106,7 @@ jpbelanger-mtl Juan Basso Julien Rostand Justin Abrahms +Jusung Lee jzhoucliqr Katrina Owen Keita Urashima @@ -113,9 +124,11 @@ Luke Young Maksim Zhylinski Martin-Louis Bright Mat Geist +Matt Matt Brender Matt Landis Maxime Bury +Michael Spiegel Michael Tiller Michał Glapa Nathan VanBenschoten @@ -125,15 +138,19 @@ Nick Spragg Nikhita Raghunath Noah Zoschke ns-cweber +Oleg Kovalov Ondřej Kupka Panagiotis Moustafellos +Parham Alvani Parker Moore +parkhyukjun89 Pavel Shtanko Petr Shevtsov Pierre Carrier Piotr Zurek Quinn Slack Rackspace US, Inc. +Radek Simko Rajendra arora RaviTeja Pothana rc1140 @@ -145,6 +162,7 @@ Ryan Lower Sahil Dua saisi Sam Minnée +Sandeep Sukhani Sander van Harmelen Sanket Payghan Sarasa Kisaragi @@ -152,6 +170,7 @@ Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen Sevki +Shagun Khemka Shawn Catanzarite Shawn Smith sona-tar diff --git a/vendor/github.com/google/go-github/LICENSE b/vendor/github.com/google/go-github/v18/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/LICENSE rename to vendor/github.com/google/go-github/v18/LICENSE diff --git a/vendor/github.com/google/go-github/github/activity.go b/vendor/github.com/google/go-github/v18/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/github/activity.go rename to vendor/github.com/google/go-github/v18/github/activity.go diff --git a/vendor/github.com/google/go-github/github/activity_events.go b/vendor/github.com/google/go-github/v18/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/github/activity_events.go rename to vendor/github.com/google/go-github/v18/github/activity_events.go diff --git a/vendor/github.com/google/go-github/github/activity_notifications.go b/vendor/github.com/google/go-github/v18/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/github/activity_notifications.go rename to vendor/github.com/google/go-github/v18/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/github/activity_star.go b/vendor/github.com/google/go-github/v18/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/github/activity_star.go rename to vendor/github.com/google/go-github/v18/github/activity_star.go diff --git a/vendor/github.com/google/go-github/github/activity_watching.go b/vendor/github.com/google/go-github/v18/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/github/activity_watching.go rename to vendor/github.com/google/go-github/v18/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/github/admin.go b/vendor/github.com/google/go-github/v18/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/github/admin.go rename to vendor/github.com/google/go-github/v18/github/admin.go diff --git a/vendor/github.com/google/go-github/github/admin_stats.go b/vendor/github.com/google/go-github/v18/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/github/admin_stats.go rename to vendor/github.com/google/go-github/v18/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/github/apps.go b/vendor/github.com/google/go-github/v18/github/apps.go similarity index 95% rename from vendor/github.com/google/go-github/github/apps.go rename to vendor/github.com/google/go-github/v18/github/apps.go index e25de2c573..32d4f2f450 100644 --- a/vendor/github.com/google/go-github/github/apps.go +++ b/vendor/github.com/google/go-github/v18/github/apps.go @@ -197,6 +197,13 @@ func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, rep return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } +// FindRepositoryInstallationByID finds the repository's installation information. +// +// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint /repositories/:id/installation. +func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { + return s.getInstallation(ctx, fmt.Sprintf("repositories/%d/installation", id)) +} + // FindUserInstallation finds the user's installation information. // // GitHub API docs: https://developer.github.com/v3/apps/#find-repository-installation diff --git a/vendor/github.com/google/go-github/github/apps_installation.go b/vendor/github.com/google/go-github/v18/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/github/apps_installation.go rename to vendor/github.com/google/go-github/v18/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/github/apps_marketplace.go b/vendor/github.com/google/go-github/v18/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v18/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/github/authorizations.go b/vendor/github.com/google/go-github/v18/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/github/authorizations.go rename to vendor/github.com/google/go-github/v18/github/authorizations.go diff --git a/vendor/github.com/google/go-github/github/checks.go b/vendor/github.com/google/go-github/v18/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/github/checks.go rename to vendor/github.com/google/go-github/v18/github/checks.go diff --git a/vendor/github.com/google/go-github/github/doc.go b/vendor/github.com/google/go-github/v18/github/doc.go similarity index 100% rename from vendor/github.com/google/go-github/github/doc.go rename to vendor/github.com/google/go-github/v18/github/doc.go diff --git a/vendor/github.com/google/go-github/github/event_types.go b/vendor/github.com/google/go-github/v18/github/event_types.go similarity index 93% rename from vendor/github.com/google/go-github/github/event_types.go rename to vendor/github.com/google/go-github/v18/github/event_types.go index 0b635ef895..d68bf581ca 100644 --- a/vendor/github.com/google/go-github/github/event_types.go +++ b/vendor/github.com/google/go-github/v18/github/event_types.go @@ -630,39 +630,39 @@ func (p PushEventCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *PushEventRepoOwner `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. diff --git a/vendor/github.com/google/go-github/github/gen-accessors.go b/vendor/github.com/google/go-github/v18/github/gen-accessors.go similarity index 100% rename from vendor/github.com/google/go-github/github/gen-accessors.go rename to vendor/github.com/google/go-github/v18/github/gen-accessors.go diff --git a/vendor/github.com/google/go-github/github/gists.go b/vendor/github.com/google/go-github/v18/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/github/gists.go rename to vendor/github.com/google/go-github/v18/github/gists.go diff --git a/vendor/github.com/google/go-github/github/gists_comments.go b/vendor/github.com/google/go-github/v18/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/github/gists_comments.go rename to vendor/github.com/google/go-github/v18/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/github/git.go b/vendor/github.com/google/go-github/v18/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/github/git.go rename to vendor/github.com/google/go-github/v18/github/git.go diff --git a/vendor/github.com/google/go-github/github/git_blobs.go b/vendor/github.com/google/go-github/v18/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/github/git_blobs.go rename to vendor/github.com/google/go-github/v18/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/github/git_commits.go b/vendor/github.com/google/go-github/v18/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/github/git_commits.go rename to vendor/github.com/google/go-github/v18/github/git_commits.go diff --git a/vendor/github.com/google/go-github/github/git_refs.go b/vendor/github.com/google/go-github/v18/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/github/git_refs.go rename to vendor/github.com/google/go-github/v18/github/git_refs.go diff --git a/vendor/github.com/google/go-github/github/git_tags.go b/vendor/github.com/google/go-github/v18/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/github/git_tags.go rename to vendor/github.com/google/go-github/v18/github/git_tags.go diff --git a/vendor/github.com/google/go-github/github/git_trees.go b/vendor/github.com/google/go-github/v18/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/github/git_trees.go rename to vendor/github.com/google/go-github/v18/github/git_trees.go diff --git a/vendor/github.com/google/go-github/github/github-accessors.go b/vendor/github.com/google/go-github/v18/github/github-accessors.go similarity index 99% rename from vendor/github.com/google/go-github/github/github-accessors.go rename to vendor/github.com/google/go-github/v18/github/github-accessors.go index 5094ca6616..8d03cc95f5 100644 --- a/vendor/github.com/google/go-github/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v18/github/github-accessors.go @@ -6164,6 +6164,14 @@ func (p *Project) GetBody() string { return *p.Body } +// GetColumnsURL returns the ColumnsURL field if it's non-nil, zero value otherwise. +func (p *Project) GetColumnsURL() string { + if p == nil || p.ColumnsURL == nil { + return "" + } + return *p.ColumnsURL +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *Project) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { @@ -6180,6 +6188,14 @@ func (p *Project) GetCreator() *User { return p.Creator } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *Project) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" + } + return *p.HTMLURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (p *Project) GetID() int64 { if p == nil || p.ID == nil { @@ -6220,6 +6236,14 @@ func (p *Project) GetOwnerURL() string { return *p.OwnerURL } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *Project) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *Project) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -6404,6 +6428,14 @@ func (p *ProjectCardOptions) GetArchived() bool { return *p.Archived } +// GetCardsURL returns the CardsURL field if it's non-nil, zero value otherwise. +func (p *ProjectColumn) GetCardsURL() string { + if p == nil || p.CardsURL == nil { + return "" + } + return *p.CardsURL +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *ProjectColumn) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { @@ -6452,6 +6484,14 @@ func (p *ProjectColumn) GetUpdatedAt() Timestamp { return *p.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *ProjectColumn) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectColumnEvent) GetAction() string { if p == nil || p.Action == nil { @@ -6572,6 +6612,46 @@ func (p *ProjectEvent) GetSender() *User { return p.Sender } +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetBody() string { + if p == nil || p.Body == nil { + return "" + } + return *p.Body +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetOrganizationPermission() string { + if p == nil || p.OrganizationPermission == nil { + return "" + } + return *p.OrganizationPermission +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + // GetEnforceAdmins returns the EnforceAdmins field. func (p *Protection) GetEnforceAdmins() *AdminEnforcement { if p == nil { @@ -7957,7 +8037,7 @@ func (p *PushEventRepository) GetOrganization() string { } // GetOwner returns the Owner field. -func (p *PushEventRepository) GetOwner() *PushEventRepoOwner { +func (p *PushEventRepository) GetOwner() *User { if p == nil { return nil } diff --git a/vendor/github.com/google/go-github/github/github.go b/vendor/github.com/google/go-github/v18/github/github.go similarity index 100% rename from vendor/github.com/google/go-github/github/github.go rename to vendor/github.com/google/go-github/v18/github/github.go diff --git a/vendor/github.com/google/go-github/github/gitignore.go b/vendor/github.com/google/go-github/v18/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/github/gitignore.go rename to vendor/github.com/google/go-github/v18/github/gitignore.go diff --git a/vendor/github.com/google/go-github/github/issues.go b/vendor/github.com/google/go-github/v18/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues.go rename to vendor/github.com/google/go-github/v18/github/issues.go diff --git a/vendor/github.com/google/go-github/github/issues_assignees.go b/vendor/github.com/google/go-github/v18/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_assignees.go rename to vendor/github.com/google/go-github/v18/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/github/issues_comments.go b/vendor/github.com/google/go-github/v18/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_comments.go rename to vendor/github.com/google/go-github/v18/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/github/issues_events.go b/vendor/github.com/google/go-github/v18/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_events.go rename to vendor/github.com/google/go-github/v18/github/issues_events.go diff --git a/vendor/github.com/google/go-github/github/issues_labels.go b/vendor/github.com/google/go-github/v18/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_labels.go rename to vendor/github.com/google/go-github/v18/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/github/issues_milestones.go b/vendor/github.com/google/go-github/v18/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_milestones.go rename to vendor/github.com/google/go-github/v18/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/github/issues_timeline.go b/vendor/github.com/google/go-github/v18/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/github/issues_timeline.go rename to vendor/github.com/google/go-github/v18/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/github/licenses.go b/vendor/github.com/google/go-github/v18/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/github/licenses.go rename to vendor/github.com/google/go-github/v18/github/licenses.go diff --git a/vendor/github.com/google/go-github/github/messages.go b/vendor/github.com/google/go-github/v18/github/messages.go similarity index 100% rename from vendor/github.com/google/go-github/github/messages.go rename to vendor/github.com/google/go-github/v18/github/messages.go diff --git a/vendor/github.com/google/go-github/github/migrations.go b/vendor/github.com/google/go-github/v18/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/github/migrations.go rename to vendor/github.com/google/go-github/v18/github/migrations.go diff --git a/vendor/github.com/google/go-github/github/migrations_source_import.go b/vendor/github.com/google/go-github/v18/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v18/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/github/migrations_user.go b/vendor/github.com/google/go-github/v18/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/github/migrations_user.go rename to vendor/github.com/google/go-github/v18/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/github/misc.go b/vendor/github.com/google/go-github/v18/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/github/misc.go rename to vendor/github.com/google/go-github/v18/github/misc.go diff --git a/vendor/github.com/google/go-github/github/orgs.go b/vendor/github.com/google/go-github/v18/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs.go rename to vendor/github.com/google/go-github/v18/github/orgs.go diff --git a/vendor/github.com/google/go-github/github/orgs_hooks.go b/vendor/github.com/google/go-github/v18/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v18/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/github/orgs_members.go b/vendor/github.com/google/go-github/v18/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs_members.go rename to vendor/github.com/google/go-github/v18/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v18/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v18/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/github/orgs_projects.go b/vendor/github.com/google/go-github/v18/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs_projects.go rename to vendor/github.com/google/go-github/v18/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v18/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v18/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/github/projects.go b/vendor/github.com/google/go-github/v18/github/projects.go similarity index 91% rename from vendor/github.com/google/go-github/github/projects.go rename to vendor/github.com/google/go-github/v18/github/projects.go index 614870f518..76ef1e0a3b 100644 --- a/vendor/github.com/google/go-github/github/projects.go +++ b/vendor/github.com/google/go-github/v18/github/projects.go @@ -18,15 +18,18 @@ type ProjectsService service // Project represents a GitHub Project. type Project struct { - ID *int64 `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - OwnerURL *string `json:"owner_url,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` + ID *int64 `json:"id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ColumnsURL *string `json:"columns_url,omitempty"` + OwnerURL *string `json:"owner_url,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + NodeID *string `json:"node_id,omitempty"` // The User object that generated the project. Creator *User `json:"creator,omitempty"` @@ -63,15 +66,24 @@ func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, * // ProjectsService.UpdateProject methods. type ProjectOptions struct { // The name of the project. (Required for creation; optional for update.) - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // The body of the project. (Optional.) - Body string `json:"body,omitempty"` + Body *string `json:"body,omitempty"` // The following field(s) are only applicable for update. // They should be left with zero values for creation. // State of the project. Either "open" or "closed". (Optional.) - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` + // The permission level that all members of the project's organization + // will have on this project. + // Setting the organization permission is only available + // for organization projects. (Optional.) + OrganizationPermission *string `json:"organization_permission,omitempty"` + // Sets visibility of the project within the organization. + // Setting visibility is only available + // for organization projects.(Optional.) + Public *bool `json:"public,omitempty"` } // UpdateProject updates a repository project. @@ -118,7 +130,9 @@ func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Respons type ProjectColumn struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` ProjectURL *string `json:"project_url,omitempty"` + CardsURL *string `json:"cards_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` NodeID *string `json:"node_id,omitempty"` diff --git a/vendor/github.com/google/go-github/github/pulls.go b/vendor/github.com/google/go-github/v18/github/pulls.go similarity index 100% rename from vendor/github.com/google/go-github/github/pulls.go rename to vendor/github.com/google/go-github/v18/github/pulls.go diff --git a/vendor/github.com/google/go-github/github/pulls_comments.go b/vendor/github.com/google/go-github/v18/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/github/pulls_comments.go rename to vendor/github.com/google/go-github/v18/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v18/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v18/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/github/pulls_reviews.go b/vendor/github.com/google/go-github/v18/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v18/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/github/reactions.go b/vendor/github.com/google/go-github/v18/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/github/reactions.go rename to vendor/github.com/google/go-github/v18/github/reactions.go diff --git a/vendor/github.com/google/go-github/github/repos.go b/vendor/github.com/google/go-github/v18/github/repos.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos.go rename to vendor/github.com/google/go-github/v18/github/repos.go diff --git a/vendor/github.com/google/go-github/github/repos_collaborators.go b/vendor/github.com/google/go-github/v18/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v18/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/github/repos_comments.go b/vendor/github.com/google/go-github/v18/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_comments.go rename to vendor/github.com/google/go-github/v18/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/github/repos_commits.go b/vendor/github.com/google/go-github/v18/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_commits.go rename to vendor/github.com/google/go-github/v18/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/github/repos_community_health.go b/vendor/github.com/google/go-github/v18/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_community_health.go rename to vendor/github.com/google/go-github/v18/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/github/repos_contents.go b/vendor/github.com/google/go-github/v18/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_contents.go rename to vendor/github.com/google/go-github/v18/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/github/repos_deployments.go b/vendor/github.com/google/go-github/v18/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_deployments.go rename to vendor/github.com/google/go-github/v18/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/github/repos_forks.go b/vendor/github.com/google/go-github/v18/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_forks.go rename to vendor/github.com/google/go-github/v18/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/github/repos_hooks.go b/vendor/github.com/google/go-github/v18/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_hooks.go rename to vendor/github.com/google/go-github/v18/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/github/repos_invitations.go b/vendor/github.com/google/go-github/v18/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_invitations.go rename to vendor/github.com/google/go-github/v18/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/github/repos_keys.go b/vendor/github.com/google/go-github/v18/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_keys.go rename to vendor/github.com/google/go-github/v18/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/github/repos_merging.go b/vendor/github.com/google/go-github/v18/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_merging.go rename to vendor/github.com/google/go-github/v18/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/github/repos_pages.go b/vendor/github.com/google/go-github/v18/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_pages.go rename to vendor/github.com/google/go-github/v18/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v18/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v18/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/github/repos_projects.go b/vendor/github.com/google/go-github/v18/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_projects.go rename to vendor/github.com/google/go-github/v18/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/github/repos_releases.go b/vendor/github.com/google/go-github/v18/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_releases.go rename to vendor/github.com/google/go-github/v18/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/github/repos_stats.go b/vendor/github.com/google/go-github/v18/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_stats.go rename to vendor/github.com/google/go-github/v18/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/github/repos_statuses.go b/vendor/github.com/google/go-github/v18/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_statuses.go rename to vendor/github.com/google/go-github/v18/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/github/repos_traffic.go b/vendor/github.com/google/go-github/v18/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/github/repos_traffic.go rename to vendor/github.com/google/go-github/v18/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/github/search.go b/vendor/github.com/google/go-github/v18/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/github/search.go rename to vendor/github.com/google/go-github/v18/github/search.go diff --git a/vendor/github.com/google/go-github/github/strings.go b/vendor/github.com/google/go-github/v18/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/github/strings.go rename to vendor/github.com/google/go-github/v18/github/strings.go diff --git a/vendor/github.com/google/go-github/github/teams.go b/vendor/github.com/google/go-github/v18/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/github/teams.go rename to vendor/github.com/google/go-github/v18/github/teams.go diff --git a/vendor/github.com/google/go-github/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/github/teams_discussions.go b/vendor/github.com/google/go-github/v18/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/github/teams_discussions.go rename to vendor/github.com/google/go-github/v18/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/github/teams_members.go b/vendor/github.com/google/go-github/v18/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/github/teams_members.go rename to vendor/github.com/google/go-github/v18/github/teams_members.go diff --git a/vendor/github.com/google/go-github/github/timestamp.go b/vendor/github.com/google/go-github/v18/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/github/timestamp.go rename to vendor/github.com/google/go-github/v18/github/timestamp.go diff --git a/vendor/github.com/google/go-github/github/users.go b/vendor/github.com/google/go-github/v18/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/github/users.go rename to vendor/github.com/google/go-github/v18/github/users.go diff --git a/vendor/github.com/google/go-github/github/users_administration.go b/vendor/github.com/google/go-github/v18/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_administration.go rename to vendor/github.com/google/go-github/v18/github/users_administration.go diff --git a/vendor/github.com/google/go-github/github/users_blocking.go b/vendor/github.com/google/go-github/v18/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_blocking.go rename to vendor/github.com/google/go-github/v18/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/github/users_emails.go b/vendor/github.com/google/go-github/v18/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_emails.go rename to vendor/github.com/google/go-github/v18/github/users_emails.go diff --git a/vendor/github.com/google/go-github/github/users_followers.go b/vendor/github.com/google/go-github/v18/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_followers.go rename to vendor/github.com/google/go-github/v18/github/users_followers.go diff --git a/vendor/github.com/google/go-github/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v18/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v18/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/github/users_keys.go b/vendor/github.com/google/go-github/v18/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/github/users_keys.go rename to vendor/github.com/google/go-github/v18/github/users_keys.go diff --git a/vendor/github.com/google/go-github/github/with_appengine.go b/vendor/github.com/google/go-github/v18/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/github/with_appengine.go rename to vendor/github.com/google/go-github/v18/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/github/without_appengine.go b/vendor/github.com/google/go-github/v18/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/github/without_appengine.go rename to vendor/github.com/google/go-github/v18/github/without_appengine.go diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519.go b/vendor/golang.org/x/crypto/ed25519/ed25519.go index a57771a1ed..d6f683ba3f 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519.go @@ -6,7 +6,10 @@ // https://ed25519.cr.yp.to/. // // These functions are also compatible with the “Ed25519” function defined in -// RFC 8032. +// RFC 8032. However, unlike RFC 8032's formulation, this package's private key +// representation includes a public key suffix to make multiple signing +// operations with the same key more efficient. This package refers to the RFC +// 8032 private key as the “seed”. package ed25519 // This code is a port of the public domain, “ref10” implementation of ed25519 @@ -31,6 +34,8 @@ const ( PrivateKeySize = 64 // SignatureSize is the size, in bytes, of signatures generated and verified by this package. SignatureSize = 64 + // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. + SeedSize = 32 ) // PublicKey is the type of Ed25519 public keys. @@ -46,6 +51,15 @@ func (priv PrivateKey) Public() crypto.PublicKey { return PublicKey(publicKey) } +// Seed returns the private key seed corresponding to priv. It is provided for +// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds +// in this package. +func (priv PrivateKey) Seed() []byte { + seed := make([]byte, SeedSize) + copy(seed, priv[:32]) + return seed +} + // Sign signs the given message with priv. // Ed25519 performs two passes over messages to be signed and therefore cannot // handle pre-hashed messages. Thus opts.HashFunc() must return zero to @@ -61,19 +75,33 @@ func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOp // GenerateKey generates a public/private key pair using entropy from rand. // If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, err error) { +func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { if rand == nil { rand = cryptorand.Reader } - privateKey = make([]byte, PrivateKeySize) - publicKey = make([]byte, PublicKeySize) - _, err = io.ReadFull(rand, privateKey[:32]) - if err != nil { + seed := make([]byte, SeedSize) + if _, err := io.ReadFull(rand, seed); err != nil { return nil, nil, err } - digest := sha512.Sum512(privateKey[:32]) + privateKey := NewKeyFromSeed(seed) + publicKey := make([]byte, PublicKeySize) + copy(publicKey, privateKey[32:]) + + return publicKey, privateKey, nil +} + +// NewKeyFromSeed calculates a private key from a seed. It will panic if +// len(seed) is not SeedSize. This function is provided for interoperability +// with RFC 8032. RFC 8032's private keys correspond to seeds in this +// package. +func NewKeyFromSeed(seed []byte) PrivateKey { + if l := len(seed); l != SeedSize { + panic("ed25519: bad seed length: " + strconv.Itoa(l)) + } + + digest := sha512.Sum512(seed) digest[0] &= 248 digest[31] &= 127 digest[31] |= 64 @@ -85,10 +113,11 @@ func GenerateKey(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, er var publicKeyBytes [32]byte A.ToBytes(&publicKeyBytes) + privateKey := make([]byte, PrivateKeySize) + copy(privateKey, seed) copy(privateKey[32:], publicKeyBytes[:]) - copy(publicKey, publicKeyBytes[:]) - return publicKey, privateKey, nil + return privateKey } // Sign signs the message with privateKey and returns a signature. It will diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go index 0f8efdbaa4..6570847f5e 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go @@ -2,197 +2,263 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package ChaCha20 implements the core ChaCha20 function as specified in https://tools.ietf.org/html/rfc7539#section-2.3. +// Package ChaCha20 implements the core ChaCha20 function as specified +// in https://tools.ietf.org/html/rfc7539#section-2.3. package chacha20 -import "encoding/binary" - -const rounds = 20 - -// core applies the ChaCha20 core function to 16-byte input in, 32-byte key k, -// and 16-byte constant c, and puts the result into 64-byte array out. -func core(out *[64]byte, in *[16]byte, k *[32]byte) { - j0 := uint32(0x61707865) - j1 := uint32(0x3320646e) - j2 := uint32(0x79622d32) - j3 := uint32(0x6b206574) - j4 := binary.LittleEndian.Uint32(k[0:4]) - j5 := binary.LittleEndian.Uint32(k[4:8]) - j6 := binary.LittleEndian.Uint32(k[8:12]) - j7 := binary.LittleEndian.Uint32(k[12:16]) - j8 := binary.LittleEndian.Uint32(k[16:20]) - j9 := binary.LittleEndian.Uint32(k[20:24]) - j10 := binary.LittleEndian.Uint32(k[24:28]) - j11 := binary.LittleEndian.Uint32(k[28:32]) - j12 := binary.LittleEndian.Uint32(in[0:4]) - j13 := binary.LittleEndian.Uint32(in[4:8]) - j14 := binary.LittleEndian.Uint32(in[8:12]) - j15 := binary.LittleEndian.Uint32(in[12:16]) - - x0, x1, x2, x3, x4, x5, x6, x7 := j0, j1, j2, j3, j4, j5, j6, j7 - x8, x9, x10, x11, x12, x13, x14, x15 := j8, j9, j10, j11, j12, j13, j14, j15 - - for i := 0; i < rounds; i += 2 { - x0 += x4 - x12 ^= x0 - x12 = (x12 << 16) | (x12 >> (16)) - x8 += x12 - x4 ^= x8 - x4 = (x4 << 12) | (x4 >> (20)) - x0 += x4 - x12 ^= x0 - x12 = (x12 << 8) | (x12 >> (24)) - x8 += x12 - x4 ^= x8 - x4 = (x4 << 7) | (x4 >> (25)) - x1 += x5 - x13 ^= x1 - x13 = (x13 << 16) | (x13 >> 16) - x9 += x13 - x5 ^= x9 - x5 = (x5 << 12) | (x5 >> 20) - x1 += x5 - x13 ^= x1 - x13 = (x13 << 8) | (x13 >> 24) - x9 += x13 - x5 ^= x9 - x5 = (x5 << 7) | (x5 >> 25) - x2 += x6 - x14 ^= x2 - x14 = (x14 << 16) | (x14 >> 16) - x10 += x14 - x6 ^= x10 - x6 = (x6 << 12) | (x6 >> 20) - x2 += x6 - x14 ^= x2 - x14 = (x14 << 8) | (x14 >> 24) - x10 += x14 - x6 ^= x10 - x6 = (x6 << 7) | (x6 >> 25) - x3 += x7 - x15 ^= x3 - x15 = (x15 << 16) | (x15 >> 16) - x11 += x15 - x7 ^= x11 - x7 = (x7 << 12) | (x7 >> 20) - x3 += x7 - x15 ^= x3 - x15 = (x15 << 8) | (x15 >> 24) - x11 += x15 - x7 ^= x11 - x7 = (x7 << 7) | (x7 >> 25) - x0 += x5 - x15 ^= x0 - x15 = (x15 << 16) | (x15 >> 16) - x10 += x15 - x5 ^= x10 - x5 = (x5 << 12) | (x5 >> 20) - x0 += x5 - x15 ^= x0 - x15 = (x15 << 8) | (x15 >> 24) - x10 += x15 - x5 ^= x10 - x5 = (x5 << 7) | (x5 >> 25) - x1 += x6 - x12 ^= x1 - x12 = (x12 << 16) | (x12 >> 16) - x11 += x12 - x6 ^= x11 - x6 = (x6 << 12) | (x6 >> 20) - x1 += x6 - x12 ^= x1 - x12 = (x12 << 8) | (x12 >> 24) - x11 += x12 - x6 ^= x11 - x6 = (x6 << 7) | (x6 >> 25) - x2 += x7 - x13 ^= x2 - x13 = (x13 << 16) | (x13 >> 16) - x8 += x13 - x7 ^= x8 - x7 = (x7 << 12) | (x7 >> 20) - x2 += x7 - x13 ^= x2 - x13 = (x13 << 8) | (x13 >> 24) - x8 += x13 - x7 ^= x8 - x7 = (x7 << 7) | (x7 >> 25) - x3 += x4 - x14 ^= x3 - x14 = (x14 << 16) | (x14 >> 16) - x9 += x14 - x4 ^= x9 - x4 = (x4 << 12) | (x4 >> 20) - x3 += x4 - x14 ^= x3 - x14 = (x14 << 8) | (x14 >> 24) - x9 += x14 - x4 ^= x9 - x4 = (x4 << 7) | (x4 >> 25) +import ( + "crypto/cipher" + "encoding/binary" + + "golang.org/x/crypto/internal/subtle" +) + +// assert that *Cipher implements cipher.Stream +var _ cipher.Stream = (*Cipher)(nil) + +// Cipher is a stateful instance of ChaCha20 using a particular key +// and nonce. A *Cipher implements the cipher.Stream interface. +type Cipher struct { + key [8]uint32 + counter uint32 // incremented after each block + nonce [3]uint32 + buf [bufSize]byte // buffer for unused keystream bytes + len int // number of unused keystream bytes at end of buf +} + +// New creates a new ChaCha20 stream cipher with the given key and nonce. +// The initial counter value is set to 0. +func New(key [8]uint32, nonce [3]uint32) *Cipher { + return &Cipher{key: key, nonce: nonce} +} + +// ChaCha20 constants spelling "expand 32-byte k" +const ( + j0 uint32 = 0x61707865 + j1 uint32 = 0x3320646e + j2 uint32 = 0x79622d32 + j3 uint32 = 0x6b206574 +) + +func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { + a += b + d ^= a + d = (d << 16) | (d >> 16) + c += d + b ^= c + b = (b << 12) | (b >> 20) + a += b + d ^= a + d = (d << 8) | (d >> 24) + c += d + b ^= c + b = (b << 7) | (b >> 25) + return a, b, c, d +} + +// XORKeyStream XORs each byte in the given slice with a byte from the +// cipher's key stream. Dst and src must overlap entirely or not at all. +// +// If len(dst) < len(src), XORKeyStream will panic. It is acceptable +// to pass a dst bigger than src, and in that case, XORKeyStream will +// only update dst[:len(src)] and will not touch the rest of dst. +// +// Multiple calls to XORKeyStream behave as if the concatenation of +// the src buffers was passed in a single run. That is, Cipher +// maintains state and does not reset at each XORKeyStream call. +func (s *Cipher) XORKeyStream(dst, src []byte) { + if len(dst) < len(src) { + panic("chacha20: output smaller than input") + } + if subtle.InexactOverlap(dst[:len(src)], src) { + panic("chacha20: invalid buffer overlap") + } + + // xor src with buffered keystream first + if s.len != 0 { + buf := s.buf[len(s.buf)-s.len:] + if len(src) < len(buf) { + buf = buf[:len(src)] + } + td, ts := dst[:len(buf)], src[:len(buf)] // BCE hint + for i, b := range buf { + td[i] = ts[i] ^ b + } + s.len -= len(buf) + if s.len != 0 { + return + } + s.buf = [len(s.buf)]byte{} // zero the empty buffer + src = src[len(buf):] + dst = dst[len(buf):] + } + + if len(src) == 0 { + return } + if haveAsm { + if uint64(len(src))+uint64(s.counter)*64 > (1<<38)-64 { + panic("chacha20: counter overflow") + } + s.xorKeyStreamAsm(dst, src) + return + } + + // set up a 64-byte buffer to pad out the final block if needed + // (hoisted out of the main loop to avoid spills) + rem := len(src) % 64 // length of final block + fin := len(src) - rem // index of final block + if rem > 0 { + copy(s.buf[len(s.buf)-64:], src[fin:]) + } + + // pre-calculate most of the first round + s1, s5, s9, s13 := quarterRound(j1, s.key[1], s.key[5], s.nonce[0]) + s2, s6, s10, s14 := quarterRound(j2, s.key[2], s.key[6], s.nonce[1]) + s3, s7, s11, s15 := quarterRound(j3, s.key[3], s.key[7], s.nonce[2]) + + n := len(src) + src, dst = src[:n:n], dst[:n:n] // BCE hint + for i := 0; i < n; i += 64 { + // calculate the remainder of the first round + s0, s4, s8, s12 := quarterRound(j0, s.key[0], s.key[4], s.counter) - x0 += j0 - x1 += j1 - x2 += j2 - x3 += j3 - x4 += j4 - x5 += j5 - x6 += j6 - x7 += j7 - x8 += j8 - x9 += j9 - x10 += j10 - x11 += j11 - x12 += j12 - x13 += j13 - x14 += j14 - x15 += j15 - - binary.LittleEndian.PutUint32(out[0:4], x0) - binary.LittleEndian.PutUint32(out[4:8], x1) - binary.LittleEndian.PutUint32(out[8:12], x2) - binary.LittleEndian.PutUint32(out[12:16], x3) - binary.LittleEndian.PutUint32(out[16:20], x4) - binary.LittleEndian.PutUint32(out[20:24], x5) - binary.LittleEndian.PutUint32(out[24:28], x6) - binary.LittleEndian.PutUint32(out[28:32], x7) - binary.LittleEndian.PutUint32(out[32:36], x8) - binary.LittleEndian.PutUint32(out[36:40], x9) - binary.LittleEndian.PutUint32(out[40:44], x10) - binary.LittleEndian.PutUint32(out[44:48], x11) - binary.LittleEndian.PutUint32(out[48:52], x12) - binary.LittleEndian.PutUint32(out[52:56], x13) - binary.LittleEndian.PutUint32(out[56:60], x14) - binary.LittleEndian.PutUint32(out[60:64], x15) + // execute the second round + x0, x5, x10, x15 := quarterRound(s0, s5, s10, s15) + x1, x6, x11, x12 := quarterRound(s1, s6, s11, s12) + x2, x7, x8, x13 := quarterRound(s2, s7, s8, s13) + x3, x4, x9, x14 := quarterRound(s3, s4, s9, s14) + + // execute the remaining 18 rounds + for i := 0; i < 9; i++ { + x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) + x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) + x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) + x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) + + x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) + x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) + x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) + x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) + } + + x0 += j0 + x1 += j1 + x2 += j2 + x3 += j3 + + x4 += s.key[0] + x5 += s.key[1] + x6 += s.key[2] + x7 += s.key[3] + x8 += s.key[4] + x9 += s.key[5] + x10 += s.key[6] + x11 += s.key[7] + + x12 += s.counter + x13 += s.nonce[0] + x14 += s.nonce[1] + x15 += s.nonce[2] + + // increment the counter + s.counter += 1 + if s.counter == 0 { + panic("chacha20: counter overflow") + } + + // pad to 64 bytes if needed + in, out := src[i:], dst[i:] + if i == fin { + // src[fin:] has already been copied into s.buf before + // the main loop + in, out = s.buf[len(s.buf)-64:], s.buf[len(s.buf)-64:] + } + in, out = in[:64], out[:64] // BCE hint + + // XOR the key stream with the source and write out the result + xor(out[0:], in[0:], x0) + xor(out[4:], in[4:], x1) + xor(out[8:], in[8:], x2) + xor(out[12:], in[12:], x3) + xor(out[16:], in[16:], x4) + xor(out[20:], in[20:], x5) + xor(out[24:], in[24:], x6) + xor(out[28:], in[28:], x7) + xor(out[32:], in[32:], x8) + xor(out[36:], in[36:], x9) + xor(out[40:], in[40:], x10) + xor(out[44:], in[44:], x11) + xor(out[48:], in[48:], x12) + xor(out[52:], in[52:], x13) + xor(out[56:], in[56:], x14) + xor(out[60:], in[60:], x15) + } + // copy any trailing bytes out of the buffer and into dst + if rem != 0 { + s.len = 64 - rem + copy(dst[fin:], s.buf[len(s.buf)-64:]) + } +} + +// Advance discards bytes in the key stream until the next 64 byte block +// boundary is reached and updates the counter accordingly. If the key +// stream is already at a block boundary no bytes will be discarded and +// the counter will be unchanged. +func (s *Cipher) Advance() { + s.len -= s.len % 64 + if s.len == 0 { + s.buf = [len(s.buf)]byte{} + } } // XORKeyStream crypts bytes from in to out using the given key and counters. // In and out must overlap entirely or not at all. Counter contains the raw // ChaCha20 counter bytes (i.e. block counter followed by nonce). func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - var block [64]byte - var counterCopy [16]byte - copy(counterCopy[:], counter[:]) - - for len(in) >= 64 { - core(&block, &counterCopy, key) - for i, x := range block { - out[i] = in[i] ^ x - } - u := uint32(1) - for i := 0; i < 4; i++ { - u += uint32(counterCopy[i]) - counterCopy[i] = byte(u) - u >>= 8 - } - in = in[64:] - out = out[64:] + s := Cipher{ + key: [8]uint32{ + binary.LittleEndian.Uint32(key[0:4]), + binary.LittleEndian.Uint32(key[4:8]), + binary.LittleEndian.Uint32(key[8:12]), + binary.LittleEndian.Uint32(key[12:16]), + binary.LittleEndian.Uint32(key[16:20]), + binary.LittleEndian.Uint32(key[20:24]), + binary.LittleEndian.Uint32(key[24:28]), + binary.LittleEndian.Uint32(key[28:32]), + }, + nonce: [3]uint32{ + binary.LittleEndian.Uint32(counter[4:8]), + binary.LittleEndian.Uint32(counter[8:12]), + binary.LittleEndian.Uint32(counter[12:16]), + }, + counter: binary.LittleEndian.Uint32(counter[0:4]), } + s.XORKeyStream(out, in) +} - if len(in) > 0 { - core(&block, &counterCopy, key) - for i, v := range in { - out[i] = v ^ block[i] - } +// HChaCha20 uses the ChaCha20 core to generate a derived key from a key and a +// nonce. It should only be used as part of the XChaCha20 construction. +func HChaCha20(key *[8]uint32, nonce *[4]uint32) [8]uint32 { + x0, x1, x2, x3 := j0, j1, j2, j3 + x4, x5, x6, x7 := key[0], key[1], key[2], key[3] + x8, x9, x10, x11 := key[4], key[5], key[6], key[7] + x12, x13, x14, x15 := nonce[0], nonce[1], nonce[2], nonce[3] + + for i := 0; i < 10; i++ { + x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) + x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) + x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) + x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) + + x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) + x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) + x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) + x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) } + + var out [8]uint32 + out[0], out[1], out[2], out[3] = x0, x1, x2, x3 + out[4], out[5], out[6], out[7] = x12, x13, x14, x15 + return out } diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go new file mode 100644 index 0000000000..91520d1de0 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go @@ -0,0 +1,16 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !s390x gccgo appengine + +package chacha20 + +const ( + bufSize = 64 + haveAsm = false +) + +func (*Cipher) xorKeyStreamAsm(dst, src []byte) { + panic("not implemented") +} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go new file mode 100644 index 0000000000..0c1c671c40 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go @@ -0,0 +1,30 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,!gccgo,!appengine + +package chacha20 + +var haveAsm = hasVectorFacility() + +const bufSize = 256 + +// hasVectorFacility reports whether the machine supports the vector +// facility (vx). +// Implementation in asm_s390x.s. +func hasVectorFacility() bool + +// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only +// be called when the vector facility is available. +// Implementation in asm_s390x.s. +//go:noescape +func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) + +func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { + xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len) +} + +// EXRL targets, DO NOT CALL! +func mvcSrcToBuf() +func mvcBufToDst() diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s new file mode 100644 index 0000000000..98427c5e22 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s @@ -0,0 +1,283 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,!gccgo,!appengine + +#include "go_asm.h" +#include "textflag.h" + +// This is an implementation of the ChaCha20 encryption algorithm as +// specified in RFC 7539. It uses vector instructions to compute +// 4 keystream blocks in parallel (256 bytes) which are then XORed +// with the bytes in the input slice. + +GLOBL ·constants<>(SB), RODATA|NOPTR, $32 +// BSWAP: swap bytes in each 4-byte element +DATA ·constants<>+0x00(SB)/4, $0x03020100 +DATA ·constants<>+0x04(SB)/4, $0x07060504 +DATA ·constants<>+0x08(SB)/4, $0x0b0a0908 +DATA ·constants<>+0x0c(SB)/4, $0x0f0e0d0c +// J0: [j0, j1, j2, j3] +DATA ·constants<>+0x10(SB)/4, $0x61707865 +DATA ·constants<>+0x14(SB)/4, $0x3320646e +DATA ·constants<>+0x18(SB)/4, $0x79622d32 +DATA ·constants<>+0x1c(SB)/4, $0x6b206574 + +// EXRL targets: +TEXT ·mvcSrcToBuf(SB), NOFRAME|NOSPLIT, $0 + MVC $1, (R1), (R8) + RET + +TEXT ·mvcBufToDst(SB), NOFRAME|NOSPLIT, $0 + MVC $1, (R8), (R9) + RET + +#define BSWAP V5 +#define J0 V6 +#define KEY0 V7 +#define KEY1 V8 +#define NONCE V9 +#define CTR V10 +#define M0 V11 +#define M1 V12 +#define M2 V13 +#define M3 V14 +#define INC V15 +#define X0 V16 +#define X1 V17 +#define X2 V18 +#define X3 V19 +#define X4 V20 +#define X5 V21 +#define X6 V22 +#define X7 V23 +#define X8 V24 +#define X9 V25 +#define X10 V26 +#define X11 V27 +#define X12 V28 +#define X13 V29 +#define X14 V30 +#define X15 V31 + +#define NUM_ROUNDS 20 + +#define ROUND4(a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3) \ + VAF a1, a0, a0 \ + VAF b1, b0, b0 \ + VAF c1, c0, c0 \ + VAF d1, d0, d0 \ + VX a0, a2, a2 \ + VX b0, b2, b2 \ + VX c0, c2, c2 \ + VX d0, d2, d2 \ + VERLLF $16, a2, a2 \ + VERLLF $16, b2, b2 \ + VERLLF $16, c2, c2 \ + VERLLF $16, d2, d2 \ + VAF a2, a3, a3 \ + VAF b2, b3, b3 \ + VAF c2, c3, c3 \ + VAF d2, d3, d3 \ + VX a3, a1, a1 \ + VX b3, b1, b1 \ + VX c3, c1, c1 \ + VX d3, d1, d1 \ + VERLLF $12, a1, a1 \ + VERLLF $12, b1, b1 \ + VERLLF $12, c1, c1 \ + VERLLF $12, d1, d1 \ + VAF a1, a0, a0 \ + VAF b1, b0, b0 \ + VAF c1, c0, c0 \ + VAF d1, d0, d0 \ + VX a0, a2, a2 \ + VX b0, b2, b2 \ + VX c0, c2, c2 \ + VX d0, d2, d2 \ + VERLLF $8, a2, a2 \ + VERLLF $8, b2, b2 \ + VERLLF $8, c2, c2 \ + VERLLF $8, d2, d2 \ + VAF a2, a3, a3 \ + VAF b2, b3, b3 \ + VAF c2, c3, c3 \ + VAF d2, d3, d3 \ + VX a3, a1, a1 \ + VX b3, b1, b1 \ + VX c3, c1, c1 \ + VX d3, d1, d1 \ + VERLLF $7, a1, a1 \ + VERLLF $7, b1, b1 \ + VERLLF $7, c1, c1 \ + VERLLF $7, d1, d1 + +#define PERMUTE(mask, v0, v1, v2, v3) \ + VPERM v0, v0, mask, v0 \ + VPERM v1, v1, mask, v1 \ + VPERM v2, v2, mask, v2 \ + VPERM v3, v3, mask, v3 + +#define ADDV(x, v0, v1, v2, v3) \ + VAF x, v0, v0 \ + VAF x, v1, v1 \ + VAF x, v2, v2 \ + VAF x, v3, v3 + +#define XORV(off, dst, src, v0, v1, v2, v3) \ + VLM off(src), M0, M3 \ + PERMUTE(BSWAP, v0, v1, v2, v3) \ + VX v0, M0, M0 \ + VX v1, M1, M1 \ + VX v2, M2, M2 \ + VX v3, M3, M3 \ + VSTM M0, M3, off(dst) + +#define SHUFFLE(a, b, c, d, t, u, v, w) \ + VMRHF a, c, t \ // t = {a[0], c[0], a[1], c[1]} + VMRHF b, d, u \ // u = {b[0], d[0], b[1], d[1]} + VMRLF a, c, v \ // v = {a[2], c[2], a[3], c[3]} + VMRLF b, d, w \ // w = {b[2], d[2], b[3], d[3]} + VMRHF t, u, a \ // a = {a[0], b[0], c[0], d[0]} + VMRLF t, u, b \ // b = {a[1], b[1], c[1], d[1]} + VMRHF v, w, c \ // c = {a[2], b[2], c[2], d[2]} + VMRLF v, w, d // d = {a[3], b[3], c[3], d[3]} + +// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) +TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 + MOVD $·constants<>(SB), R1 + MOVD dst+0(FP), R2 // R2=&dst[0] + LMG src+24(FP), R3, R4 // R3=&src[0] R4=len(src) + MOVD key+48(FP), R5 // R5=key + MOVD nonce+56(FP), R6 // R6=nonce + MOVD counter+64(FP), R7 // R7=counter + MOVD buf+72(FP), R8 // R8=buf + MOVD len+80(FP), R9 // R9=len + + // load BSWAP and J0 + VLM (R1), BSWAP, J0 + + // set up tail buffer + ADD $-1, R4, R12 + MOVBZ R12, R12 + CMPUBEQ R12, $255, aligned + MOVD R4, R1 + AND $~255, R1 + MOVD $(R3)(R1*1), R1 + EXRL $·mvcSrcToBuf(SB), R12 + MOVD $255, R0 + SUB R12, R0 + MOVD R0, (R9) // update len + +aligned: + // setup + MOVD $95, R0 + VLM (R5), KEY0, KEY1 + VLL R0, (R6), NONCE + VZERO M0 + VLEIB $7, $32, M0 + VSRLB M0, NONCE, NONCE + + // initialize counter values + VLREPF (R7), CTR + VZERO INC + VLEIF $1, $1, INC + VLEIF $2, $2, INC + VLEIF $3, $3, INC + VAF INC, CTR, CTR + VREPIF $4, INC + +chacha: + VREPF $0, J0, X0 + VREPF $1, J0, X1 + VREPF $2, J0, X2 + VREPF $3, J0, X3 + VREPF $0, KEY0, X4 + VREPF $1, KEY0, X5 + VREPF $2, KEY0, X6 + VREPF $3, KEY0, X7 + VREPF $0, KEY1, X8 + VREPF $1, KEY1, X9 + VREPF $2, KEY1, X10 + VREPF $3, KEY1, X11 + VLR CTR, X12 + VREPF $1, NONCE, X13 + VREPF $2, NONCE, X14 + VREPF $3, NONCE, X15 + + MOVD $(NUM_ROUNDS/2), R1 + +loop: + ROUND4(X0, X4, X12, X8, X1, X5, X13, X9, X2, X6, X14, X10, X3, X7, X15, X11) + ROUND4(X0, X5, X15, X10, X1, X6, X12, X11, X2, X7, X13, X8, X3, X4, X14, X9) + + ADD $-1, R1 + BNE loop + + // decrement length + ADD $-256, R4 + BLT tail + +continue: + // rearrange vectors + SHUFFLE(X0, X1, X2, X3, M0, M1, M2, M3) + ADDV(J0, X0, X1, X2, X3) + SHUFFLE(X4, X5, X6, X7, M0, M1, M2, M3) + ADDV(KEY0, X4, X5, X6, X7) + SHUFFLE(X8, X9, X10, X11, M0, M1, M2, M3) + ADDV(KEY1, X8, X9, X10, X11) + VAF CTR, X12, X12 + SHUFFLE(X12, X13, X14, X15, M0, M1, M2, M3) + ADDV(NONCE, X12, X13, X14, X15) + + // increment counters + VAF INC, CTR, CTR + + // xor keystream with plaintext + XORV(0*64, R2, R3, X0, X4, X8, X12) + XORV(1*64, R2, R3, X1, X5, X9, X13) + XORV(2*64, R2, R3, X2, X6, X10, X14) + XORV(3*64, R2, R3, X3, X7, X11, X15) + + // increment pointers + MOVD $256(R2), R2 + MOVD $256(R3), R3 + + CMPBNE R4, $0, chacha + CMPUBEQ R12, $255, return + EXRL $·mvcBufToDst(SB), R12 // len was updated during setup + +return: + VSTEF $0, CTR, (R7) + RET + +tail: + MOVD R2, R9 + MOVD R8, R2 + MOVD R8, R3 + MOVD $0, R4 + JMP continue + +// func hasVectorFacility() bool +TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1 + MOVD $x-24(SP), R1 + XC $24, 0(R1), 0(R1) // clear the storage + MOVD $2, R0 // R0 is the number of double words stored -1 + WORD $0xB2B01000 // STFLE 0(R1) + XOR R0, R0 // reset the value of R0 + MOVBZ z-8(SP), R1 + AND $0x40, R1 + BEQ novector + +vectorinstalled: + // check if the vector instruction has been enabled + VLEIB $0, $0xF, V16 + VLGVB $0, V16, R1 + CMPBNE R1, $0xF, novector + MOVB $1, ret+0(FP) // have vx + RET + +novector: + MOVB $0, ret+0(FP) // no vx + RET diff --git a/vendor/golang.org/x/crypto/internal/chacha20/xor.go b/vendor/golang.org/x/crypto/internal/chacha20/xor.go new file mode 100644 index 0000000000..9c5ba0b33a --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/chacha20/xor.go @@ -0,0 +1,43 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found src the LICENSE file. + +package chacha20 + +import ( + "runtime" +) + +// Platforms that have fast unaligned 32-bit little endian accesses. +const unaligned = runtime.GOARCH == "386" || + runtime.GOARCH == "amd64" || + runtime.GOARCH == "arm64" || + runtime.GOARCH == "ppc64le" || + runtime.GOARCH == "s390x" + +// xor reads a little endian uint32 from src, XORs it with u and +// places the result in little endian byte order in dst. +func xor(dst, src []byte, u uint32) { + _, _ = src[3], dst[3] // eliminate bounds checks + if unaligned { + // The compiler should optimize this code into + // 32-bit unaligned little endian loads and stores. + // TODO: delete once the compiler does a reliably + // good job with the generic code below. + // See issue #25111 for more details. + v := uint32(src[0]) + v |= uint32(src[1]) << 8 + v |= uint32(src[2]) << 16 + v |= uint32(src[3]) << 24 + v ^= u + dst[0] = byte(v) + dst[1] = byte(v >> 8) + dst[2] = byte(v >> 16) + dst[3] = byte(v >> 24) + } else { + dst[0] = src[0] ^ byte(u) + dst[1] = src[1] ^ byte(u>>8) + dst[2] = src[2] ^ byte(u>>16) + dst[3] = src[3] ^ byte(u>>24) + } +} diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go new file mode 100644 index 0000000000..f38797bfa1 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go @@ -0,0 +1,32 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !appengine + +// Package subtle implements functions that are often useful in cryptographic +// code but require careful thought to use correctly. +package subtle // import "golang.org/x/crypto/internal/subtle" + +import "unsafe" + +// AnyOverlap reports whether x and y share memory at any (not necessarily +// corresponding) index. The memory beyond the slice length is ignored. +func AnyOverlap(x, y []byte) bool { + return len(x) > 0 && len(y) > 0 && + uintptr(unsafe.Pointer(&x[0])) <= uintptr(unsafe.Pointer(&y[len(y)-1])) && + uintptr(unsafe.Pointer(&y[0])) <= uintptr(unsafe.Pointer(&x[len(x)-1])) +} + +// InexactOverlap reports whether x and y share memory at any non-corresponding +// index. The memory beyond the slice length is ignored. Note that x and y can +// have different lengths and still not have any inexact overlap. +// +// InexactOverlap can be used to implement the requirements of the crypto/cipher +// AEAD, Block, BlockMode and Stream interfaces. +func InexactOverlap(x, y []byte) bool { + if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { + return false + } + return AnyOverlap(x, y) +} diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go new file mode 100644 index 0000000000..0cc4a8a642 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go @@ -0,0 +1,35 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine + +// Package subtle implements functions that are often useful in cryptographic +// code but require careful thought to use correctly. +package subtle // import "golang.org/x/crypto/internal/subtle" + +// This is the Google App Engine standard variant based on reflect +// because the unsafe package and cgo are disallowed. + +import "reflect" + +// AnyOverlap reports whether x and y share memory at any (not necessarily +// corresponding) index. The memory beyond the slice length is ignored. +func AnyOverlap(x, y []byte) bool { + return len(x) > 0 && len(y) > 0 && + reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() && + reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer() +} + +// InexactOverlap reports whether x and y share memory at any non-corresponding +// index. The memory beyond the slice length is ignored. Note that x and y can +// have different lengths and still not have any inexact overlap. +// +// InexactOverlap can be used to implement the requirements of the crypto/cipher +// AEAD, Block, BlockMode and Stream interfaces. +func InexactOverlap(x, y []byte) bool { + if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { + return false + } + return AnyOverlap(x, y) +} diff --git a/vendor/golang.org/x/crypto/openpgp/keys.go b/vendor/golang.org/x/crypto/openpgp/keys.go index fd582a89c0..a79a8c13ae 100644 --- a/vendor/golang.org/x/crypto/openpgp/keys.go +++ b/vendor/golang.org/x/crypto/openpgp/keys.go @@ -346,22 +346,25 @@ EachPacket: switch pkt := p.(type) { case *packet.UserId: + // Make a new Identity object, that we might wind up throwing away. + // We'll only add it if we get a valid self-signature over this + // userID. current = new(Identity) current.Name = pkt.Id current.UserId = pkt - e.Identities[pkt.Id] = current for { p, err = packets.Next() if err == io.EOF { - return nil, io.ErrUnexpectedEOF + break EachPacket } else if err != nil { return nil, err } sig, ok := p.(*packet.Signature) if !ok { - return nil, errors.StructuralError("user ID packet not followed by self-signature") + packets.Unread(p) + continue EachPacket } if (sig.SigType == packet.SigTypePositiveCert || sig.SigType == packet.SigTypeGenericCert) && sig.IssuerKeyId != nil && *sig.IssuerKeyId == e.PrimaryKey.KeyId { @@ -369,9 +372,10 @@ EachPacket: return nil, errors.StructuralError("user ID self-signature invalid: " + err.Error()) } current.SelfSignature = sig - break + e.Identities[pkt.Id] = current + } else { + current.Signatures = append(current.Signatures, sig) } - current.Signatures = append(current.Signatures, sig) } case *packet.Signature: if pkt.SigType == packet.SigTypeKeyRevocation { @@ -500,6 +504,10 @@ func NewEntity(name, comment, email string, config *packet.Config) (*Entity, err IssuerKeyId: &e.PrimaryKey.KeyId, }, } + err = e.Identities[uid.Id].SelfSignature.SignUserId(uid.Id, e.PrimaryKey, e.PrivateKey, config) + if err != nil { + return nil, err + } // If the user passes in a DefaultHash via packet.Config, // set the PreferredHash for the SelfSignature. @@ -529,13 +537,16 @@ func NewEntity(name, comment, email string, config *packet.Config) (*Entity, err } e.Subkeys[0].PublicKey.IsSubkey = true e.Subkeys[0].PrivateKey.IsSubkey = true - + err = e.Subkeys[0].Sig.SignKey(e.Subkeys[0].PublicKey, e.PrivateKey, config) + if err != nil { + return nil, err + } return e, nil } -// SerializePrivate serializes an Entity, including private key material, to -// the given Writer. For now, it must only be used on an Entity returned from -// NewEntity. +// SerializePrivate serializes an Entity, including private key material, but +// excluding signatures from other entities, to the given Writer. +// Identities and subkeys are re-signed in case they changed since NewEntry. // If config is nil, sensible defaults will be used. func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) { err = e.PrivateKey.Serialize(w) @@ -573,8 +584,8 @@ func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error return nil } -// Serialize writes the public part of the given Entity to w. (No private -// key material will be output). +// Serialize writes the public part of the given Entity to w, including +// signatures from other entities. No private key material will be output. func (e *Entity) Serialize(w io.Writer) error { err := e.PrimaryKey.Serialize(w) if err != nil { diff --git a/vendor/golang.org/x/crypto/openpgp/write.go b/vendor/golang.org/x/crypto/openpgp/write.go index 65a304cc86..d6dede74e9 100644 --- a/vendor/golang.org/x/crypto/openpgp/write.go +++ b/vendor/golang.org/x/crypto/openpgp/write.go @@ -164,12 +164,12 @@ func hashToHashId(h crypto.Hash) uint8 { return v } -// Encrypt encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { +// writeAndSign writes the data as a payload package and, optionally, signs +// it. hints contains optional information, that is also encrypted, +// that aids the recipients in processing the message. The resulting +// WriteCloser must be closed after the contents of the file have been +// written. If config is nil, sensible defaults will be used. +func writeAndSign(payload io.WriteCloser, candidateHashes []uint8, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { var signer *packet.PrivateKey if signed != nil { signKey, ok := signed.signingKey(config.Now()) @@ -185,6 +185,83 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint } } + var hash crypto.Hash + for _, hashId := range candidateHashes { + if h, ok := s2k.HashIdToHash(hashId); ok && h.Available() { + hash = h + break + } + } + + // If the hash specified by config is a candidate, we'll use that. + if configuredHash := config.Hash(); configuredHash.Available() { + for _, hashId := range candidateHashes { + if h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash { + hash = h + break + } + } + } + + if hash == 0 { + hashId := candidateHashes[0] + name, ok := s2k.HashIdToString(hashId) + if !ok { + name = "#" + strconv.Itoa(int(hashId)) + } + return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") + } + + if signer != nil { + ops := &packet.OnePassSignature{ + SigType: packet.SigTypeBinary, + Hash: hash, + PubKeyAlgo: signer.PubKeyAlgo, + KeyId: signer.KeyId, + IsLast: true, + } + if err := ops.Serialize(payload); err != nil { + return nil, err + } + } + + if hints == nil { + hints = &FileHints{} + } + + w := payload + if signer != nil { + // If we need to write a signature packet after the literal + // data then we need to stop literalData from closing + // encryptedData. + w = noOpCloser{w} + + } + var epochSeconds uint32 + if !hints.ModTime.IsZero() { + epochSeconds = uint32(hints.ModTime.Unix()) + } + literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) + if err != nil { + return nil, err + } + + if signer != nil { + return signatureWriter{payload, literalData, hash, hash.New(), signer, config}, nil + } + return literalData, nil +} + +// Encrypt encrypts a message to a number of recipients and, optionally, signs +// it. hints contains optional information, that is also encrypted, that aids +// the recipients in processing the message. The resulting WriteCloser must +// be closed after the contents of the file have been written. +// If config is nil, sensible defaults will be used. +func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { + if len(to) == 0 { + return nil, errors.InvalidArgumentError("no encryption recipient provided") + } + // These are the possible ciphers that we'll use for the message. candidateCiphers := []uint8{ uint8(packet.CipherAES128), @@ -241,33 +318,6 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint } } - var hash crypto.Hash - for _, hashId := range candidateHashes { - if h, ok := s2k.HashIdToHash(hashId); ok && h.Available() { - hash = h - break - } - } - - // If the hash specified by config is a candidate, we'll use that. - if configuredHash := config.Hash(); configuredHash.Available() { - for _, hashId := range candidateHashes { - if h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash { - hash = h - break - } - } - } - - if hash == 0 { - hashId := candidateHashes[0] - name, ok := s2k.HashIdToString(hashId) - if !ok { - name = "#" + strconv.Itoa(int(hashId)) - } - return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") - } - symKey := make([]byte, cipher.KeySize()) if _, err := io.ReadFull(config.Random(), symKey); err != nil { return nil, err @@ -279,49 +329,37 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint } } - encryptedData, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config) + payload, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config) if err != nil { return } - if signer != nil { - ops := &packet.OnePassSignature{ - SigType: packet.SigTypeBinary, - Hash: hash, - PubKeyAlgo: signer.PubKeyAlgo, - KeyId: signer.KeyId, - IsLast: true, - } - if err := ops.Serialize(encryptedData); err != nil { - return nil, err - } - } + return writeAndSign(payload, candidateHashes, signed, hints, config) +} - if hints == nil { - hints = &FileHints{} +// Sign signs a message. The resulting WriteCloser must be closed after the +// contents of the file have been written. hints contains optional information +// that aids the recipients in processing the message. +// If config is nil, sensible defaults will be used. +func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Config) (input io.WriteCloser, err error) { + if signed == nil { + return nil, errors.InvalidArgumentError("no signer provided") } - w := encryptedData - if signer != nil { - // If we need to write a signature packet after the literal - // data then we need to stop literalData from closing - // encryptedData. - w = noOpCloser{encryptedData} - - } - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) - if err != nil { - return nil, err + // These are the possible hash functions that we'll use for the signature. + candidateHashes := []uint8{ + hashToHashId(crypto.SHA256), + hashToHashId(crypto.SHA512), + hashToHashId(crypto.SHA1), + hashToHashId(crypto.RIPEMD160), } - - if signer != nil { - return signatureWriter{encryptedData, literalData, hash, hash.New(), signer, config}, nil + defaultHashes := candidateHashes[len(candidateHashes)-1:] + preferredHashes := signed.primaryIdentity().SelfSignature.PreferredHash + if len(preferredHashes) == 0 { + preferredHashes = defaultHashes } - return literalData, nil + candidateHashes = intersectPreferences(candidateHashes, preferredHashes) + return writeAndSign(noOpCloser{output}, candidateHashes, signed, hints, config) } // signatureWriter hashes the contents of a message while passing it along to diff --git a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go new file mode 100644 index 0000000000..751eec5274 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go @@ -0,0 +1,14 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,!go1.11 !arm,!amd64,!s390x gccgo appengine nacl + +package poly1305 + +// Sum generates an authenticator for msg using a one-time key and puts the +// 16-byte result into out. Authenticating two different messages with the same +// key allows an attacker to forge messages at will. +func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { + sumGeneric(out, msg, key) +} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ref.go b/vendor/golang.org/x/crypto/poly1305/sum_ref.go index b2805a5ca1..c4d59bd098 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_ref.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_ref.go @@ -2,16 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !amd64,!arm gccgo appengine nacl - package poly1305 import "encoding/binary" -// Sum generates an authenticator for msg using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { +// sumGeneric generates an authenticator for msg using a one-time key and +// puts the 16-byte result into out. This is the generic implementation of +// Sum and should be called if no assembly implementation is available. +func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { var ( h0, h1, h2, h3, h4 uint32 // the hash accumulators r0, r1, r2, r3, r4 uint64 // the r part of the key diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go new file mode 100644 index 0000000000..7a266cece4 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go @@ -0,0 +1,49 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,go1.11,!gccgo,!appengine + +package poly1305 + +// hasVectorFacility reports whether the machine supports +// the vector facility (vx). +func hasVectorFacility() bool + +// hasVMSLFacility reports whether the machine supports +// Vector Multiply Sum Logical (VMSL). +func hasVMSLFacility() bool + +var hasVX = hasVectorFacility() +var hasVMSL = hasVMSLFacility() + +// poly1305vx is an assembly implementation of Poly1305 that uses vector +// instructions. It must only be called if the vector facility (vx) is +// available. +//go:noescape +func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]byte) + +// poly1305vmsl is an assembly implementation of Poly1305 that uses vector +// instructions, including VMSL. It must only be called if the vector facility (vx) is +// available and if VMSL is supported. +//go:noescape +func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) + +// Sum generates an authenticator for m using a one-time key and puts the +// 16-byte result into out. Authenticating two different messages with the same +// key allows an attacker to forge messages at will. +func Sum(out *[16]byte, m []byte, key *[32]byte) { + if hasVX { + var mPtr *byte + if len(m) > 0 { + mPtr = &m[0] + } + if hasVMSL && len(m) > 256 { + poly1305vmsl(out, mPtr, uint64(len(m)), key) + } else { + poly1305vx(out, mPtr, uint64(len(m)), key) + } + } else { + sumGeneric(out, m, key) + } +} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_s390x.s new file mode 100644 index 0000000000..356c07a6c2 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.s @@ -0,0 +1,400 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,go1.11,!gccgo,!appengine + +#include "textflag.h" + +// Implementation of Poly1305 using the vector facility (vx). + +// constants +#define MOD26 V0 +#define EX0 V1 +#define EX1 V2 +#define EX2 V3 + +// temporaries +#define T_0 V4 +#define T_1 V5 +#define T_2 V6 +#define T_3 V7 +#define T_4 V8 + +// key (r) +#define R_0 V9 +#define R_1 V10 +#define R_2 V11 +#define R_3 V12 +#define R_4 V13 +#define R5_1 V14 +#define R5_2 V15 +#define R5_3 V16 +#define R5_4 V17 +#define RSAVE_0 R5 +#define RSAVE_1 R6 +#define RSAVE_2 R7 +#define RSAVE_3 R8 +#define RSAVE_4 R9 +#define R5SAVE_1 V28 +#define R5SAVE_2 V29 +#define R5SAVE_3 V30 +#define R5SAVE_4 V31 + +// message block +#define F_0 V18 +#define F_1 V19 +#define F_2 V20 +#define F_3 V21 +#define F_4 V22 + +// accumulator +#define H_0 V23 +#define H_1 V24 +#define H_2 V25 +#define H_3 V26 +#define H_4 V27 + +GLOBL ·keyMask<>(SB), RODATA, $16 +DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f +DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f + +GLOBL ·bswapMask<>(SB), RODATA, $16 +DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 +DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 + +GLOBL ·constants<>(SB), RODATA, $64 +// MOD26 +DATA ·constants<>+0(SB)/8, $0x3ffffff +DATA ·constants<>+8(SB)/8, $0x3ffffff +// EX0 +DATA ·constants<>+16(SB)/8, $0x0006050403020100 +DATA ·constants<>+24(SB)/8, $0x1016151413121110 +// EX1 +DATA ·constants<>+32(SB)/8, $0x060c0b0a09080706 +DATA ·constants<>+40(SB)/8, $0x161c1b1a19181716 +// EX2 +DATA ·constants<>+48(SB)/8, $0x0d0d0d0d0d0f0e0d +DATA ·constants<>+56(SB)/8, $0x1d1d1d1d1d1f1e1d + +// h = (f*g) % (2**130-5) [partial reduction] +#define MULTIPLY(f0, f1, f2, f3, f4, g0, g1, g2, g3, g4, g51, g52, g53, g54, h0, h1, h2, h3, h4) \ + VMLOF f0, g0, h0 \ + VMLOF f0, g1, h1 \ + VMLOF f0, g2, h2 \ + VMLOF f0, g3, h3 \ + VMLOF f0, g4, h4 \ + VMLOF f1, g54, T_0 \ + VMLOF f1, g0, T_1 \ + VMLOF f1, g1, T_2 \ + VMLOF f1, g2, T_3 \ + VMLOF f1, g3, T_4 \ + VMALOF f2, g53, h0, h0 \ + VMALOF f2, g54, h1, h1 \ + VMALOF f2, g0, h2, h2 \ + VMALOF f2, g1, h3, h3 \ + VMALOF f2, g2, h4, h4 \ + VMALOF f3, g52, T_0, T_0 \ + VMALOF f3, g53, T_1, T_1 \ + VMALOF f3, g54, T_2, T_2 \ + VMALOF f3, g0, T_3, T_3 \ + VMALOF f3, g1, T_4, T_4 \ + VMALOF f4, g51, h0, h0 \ + VMALOF f4, g52, h1, h1 \ + VMALOF f4, g53, h2, h2 \ + VMALOF f4, g54, h3, h3 \ + VMALOF f4, g0, h4, h4 \ + VAG T_0, h0, h0 \ + VAG T_1, h1, h1 \ + VAG T_2, h2, h2 \ + VAG T_3, h3, h3 \ + VAG T_4, h4, h4 + +// carry h0->h1 h3->h4, h1->h2 h4->h0, h0->h1 h2->h3, h3->h4 +#define REDUCE(h0, h1, h2, h3, h4) \ + VESRLG $26, h0, T_0 \ + VESRLG $26, h3, T_1 \ + VN MOD26, h0, h0 \ + VN MOD26, h3, h3 \ + VAG T_0, h1, h1 \ + VAG T_1, h4, h4 \ + VESRLG $26, h1, T_2 \ + VESRLG $26, h4, T_3 \ + VN MOD26, h1, h1 \ + VN MOD26, h4, h4 \ + VESLG $2, T_3, T_4 \ + VAG T_3, T_4, T_4 \ + VAG T_2, h2, h2 \ + VAG T_4, h0, h0 \ + VESRLG $26, h2, T_0 \ + VESRLG $26, h0, T_1 \ + VN MOD26, h2, h2 \ + VN MOD26, h0, h0 \ + VAG T_0, h3, h3 \ + VAG T_1, h1, h1 \ + VESRLG $26, h3, T_2 \ + VN MOD26, h3, h3 \ + VAG T_2, h4, h4 + +// expand in0 into d[0] and in1 into d[1] +#define EXPAND(in0, in1, d0, d1, d2, d3, d4) \ + VGBM $0x0707, d1 \ // d1=tmp + VPERM in0, in1, EX2, d4 \ + VPERM in0, in1, EX0, d0 \ + VPERM in0, in1, EX1, d2 \ + VN d1, d4, d4 \ + VESRLG $26, d0, d1 \ + VESRLG $30, d2, d3 \ + VESRLG $4, d2, d2 \ + VN MOD26, d0, d0 \ + VN MOD26, d1, d1 \ + VN MOD26, d2, d2 \ + VN MOD26, d3, d3 + +// pack h4:h0 into h1:h0 (no carry) +#define PACK(h0, h1, h2, h3, h4) \ + VESLG $26, h1, h1 \ + VESLG $26, h3, h3 \ + VO h0, h1, h0 \ + VO h2, h3, h2 \ + VESLG $4, h2, h2 \ + VLEIB $7, $48, h1 \ + VSLB h1, h2, h2 \ + VO h0, h2, h0 \ + VLEIB $7, $104, h1 \ + VSLB h1, h4, h3 \ + VO h3, h0, h0 \ + VLEIB $7, $24, h1 \ + VSRLB h1, h4, h1 + +// if h > 2**130-5 then h -= 2**130-5 +#define MOD(h0, h1, t0, t1, t2) \ + VZERO t0 \ + VLEIG $1, $5, t0 \ + VACCQ h0, t0, t1 \ + VAQ h0, t0, t0 \ + VONE t2 \ + VLEIG $1, $-4, t2 \ + VAQ t2, t1, t1 \ + VACCQ h1, t1, t1 \ + VONE t2 \ + VAQ t2, t1, t1 \ + VN h0, t1, t2 \ + VNC t0, t1, t1 \ + VO t1, t2, h0 + +// func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]key) +TEXT ·poly1305vx(SB), $0-32 + // This code processes up to 2 blocks (32 bytes) per iteration + // using the algorithm described in: + // NEON crypto, Daniel J. Bernstein & Peter Schwabe + // https://cryptojedi.org/papers/neoncrypto-20120320.pdf + LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key + + // load MOD26, EX0, EX1 and EX2 + MOVD $·constants<>(SB), R5 + VLM (R5), MOD26, EX2 + + // setup r + VL (R4), T_0 + MOVD $·keyMask<>(SB), R6 + VL (R6), T_1 + VN T_0, T_1, T_0 + EXPAND(T_0, T_0, R_0, R_1, R_2, R_3, R_4) + + // setup r*5 + VLEIG $0, $5, T_0 + VLEIG $1, $5, T_0 + + // store r (for final block) + VMLOF T_0, R_1, R5SAVE_1 + VMLOF T_0, R_2, R5SAVE_2 + VMLOF T_0, R_3, R5SAVE_3 + VMLOF T_0, R_4, R5SAVE_4 + VLGVG $0, R_0, RSAVE_0 + VLGVG $0, R_1, RSAVE_1 + VLGVG $0, R_2, RSAVE_2 + VLGVG $0, R_3, RSAVE_3 + VLGVG $0, R_4, RSAVE_4 + + // skip r**2 calculation + CMPBLE R3, $16, skip + + // calculate r**2 + MULTIPLY(R_0, R_1, R_2, R_3, R_4, R_0, R_1, R_2, R_3, R_4, R5SAVE_1, R5SAVE_2, R5SAVE_3, R5SAVE_4, H_0, H_1, H_2, H_3, H_4) + REDUCE(H_0, H_1, H_2, H_3, H_4) + VLEIG $0, $5, T_0 + VLEIG $1, $5, T_0 + VMLOF T_0, H_1, R5_1 + VMLOF T_0, H_2, R5_2 + VMLOF T_0, H_3, R5_3 + VMLOF T_0, H_4, R5_4 + VLR H_0, R_0 + VLR H_1, R_1 + VLR H_2, R_2 + VLR H_3, R_3 + VLR H_4, R_4 + + // initialize h + VZERO H_0 + VZERO H_1 + VZERO H_2 + VZERO H_3 + VZERO H_4 + +loop: + CMPBLE R3, $32, b2 + VLM (R2), T_0, T_1 + SUB $32, R3 + MOVD $32(R2), R2 + EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) + VLEIB $4, $1, F_4 + VLEIB $12, $1, F_4 + +multiply: + VAG H_0, F_0, F_0 + VAG H_1, F_1, F_1 + VAG H_2, F_2, F_2 + VAG H_3, F_3, F_3 + VAG H_4, F_4, F_4 + MULTIPLY(F_0, F_1, F_2, F_3, F_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, H_0, H_1, H_2, H_3, H_4) + REDUCE(H_0, H_1, H_2, H_3, H_4) + CMPBNE R3, $0, loop + +finish: + // sum vectors + VZERO T_0 + VSUMQG H_0, T_0, H_0 + VSUMQG H_1, T_0, H_1 + VSUMQG H_2, T_0, H_2 + VSUMQG H_3, T_0, H_3 + VSUMQG H_4, T_0, H_4 + + // h may be >= 2*(2**130-5) so we need to reduce it again + REDUCE(H_0, H_1, H_2, H_3, H_4) + + // carry h1->h4 + VESRLG $26, H_1, T_1 + VN MOD26, H_1, H_1 + VAQ T_1, H_2, H_2 + VESRLG $26, H_2, T_2 + VN MOD26, H_2, H_2 + VAQ T_2, H_3, H_3 + VESRLG $26, H_3, T_3 + VN MOD26, H_3, H_3 + VAQ T_3, H_4, H_4 + + // h is now < 2*(2**130-5) + // pack h into h1 (hi) and h0 (lo) + PACK(H_0, H_1, H_2, H_3, H_4) + + // if h > 2**130-5 then h -= 2**130-5 + MOD(H_0, H_1, T_0, T_1, T_2) + + // h += s + MOVD $·bswapMask<>(SB), R5 + VL (R5), T_1 + VL 16(R4), T_0 + VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) + VAQ T_0, H_0, H_0 + VPERM H_0, H_0, T_1, H_0 // reverse bytes (to little) + VST H_0, (R1) + + RET + +b2: + CMPBLE R3, $16, b1 + + // 2 blocks remaining + SUB $17, R3 + VL (R2), T_0 + VLL R3, 16(R2), T_1 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, T_1 + EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) + CMPBNE R3, $16, 2(PC) + VLEIB $12, $1, F_4 + VLEIB $4, $1, F_4 + + // setup [r²,r] + VLVGG $1, RSAVE_0, R_0 + VLVGG $1, RSAVE_1, R_1 + VLVGG $1, RSAVE_2, R_2 + VLVGG $1, RSAVE_3, R_3 + VLVGG $1, RSAVE_4, R_4 + VPDI $0, R5_1, R5SAVE_1, R5_1 + VPDI $0, R5_2, R5SAVE_2, R5_2 + VPDI $0, R5_3, R5SAVE_3, R5_3 + VPDI $0, R5_4, R5SAVE_4, R5_4 + + MOVD $0, R3 + BR multiply + +skip: + VZERO H_0 + VZERO H_1 + VZERO H_2 + VZERO H_3 + VZERO H_4 + + CMPBEQ R3, $0, finish + +b1: + // 1 block remaining + SUB $1, R3 + VLL R3, (R2), T_0 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, T_0 + VZERO T_1 + EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) + CMPBNE R3, $16, 2(PC) + VLEIB $4, $1, F_4 + VLEIG $1, $1, R_0 + VZERO R_1 + VZERO R_2 + VZERO R_3 + VZERO R_4 + VZERO R5_1 + VZERO R5_2 + VZERO R5_3 + VZERO R5_4 + + // setup [r, 1] + VLVGG $0, RSAVE_0, R_0 + VLVGG $0, RSAVE_1, R_1 + VLVGG $0, RSAVE_2, R_2 + VLVGG $0, RSAVE_3, R_3 + VLVGG $0, RSAVE_4, R_4 + VPDI $0, R5SAVE_1, R5_1, R5_1 + VPDI $0, R5SAVE_2, R5_2, R5_2 + VPDI $0, R5SAVE_3, R5_3, R5_3 + VPDI $0, R5SAVE_4, R5_4, R5_4 + + MOVD $0, R3 + BR multiply + +TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1 + MOVD $x-24(SP), R1 + XC $24, 0(R1), 0(R1) // clear the storage + MOVD $2, R0 // R0 is the number of double words stored -1 + WORD $0xB2B01000 // STFLE 0(R1) + XOR R0, R0 // reset the value of R0 + MOVBZ z-8(SP), R1 + AND $0x40, R1 + BEQ novector + +vectorinstalled: + // check if the vector instruction has been enabled + VLEIB $0, $0xF, V16 + VLGVB $0, V16, R1 + CMPBNE R1, $0xF, novector + MOVB $1, ret+0(FP) // have vx + RET + +novector: + MOVB $0, ret+0(FP) // no vx + RET diff --git a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s new file mode 100644 index 0000000000..e548020b14 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s @@ -0,0 +1,931 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build s390x,go1.11,!gccgo,!appengine + +#include "textflag.h" + +// Implementation of Poly1305 using the vector facility (vx) and the VMSL instruction. + +// constants +#define EX0 V1 +#define EX1 V2 +#define EX2 V3 + +// temporaries +#define T_0 V4 +#define T_1 V5 +#define T_2 V6 +#define T_3 V7 +#define T_4 V8 +#define T_5 V9 +#define T_6 V10 +#define T_7 V11 +#define T_8 V12 +#define T_9 V13 +#define T_10 V14 + +// r**2 & r**4 +#define R_0 V15 +#define R_1 V16 +#define R_2 V17 +#define R5_1 V18 +#define R5_2 V19 +// key (r) +#define RSAVE_0 R7 +#define RSAVE_1 R8 +#define RSAVE_2 R9 +#define R5SAVE_1 R10 +#define R5SAVE_2 R11 + +// message block +#define M0 V20 +#define M1 V21 +#define M2 V22 +#define M3 V23 +#define M4 V24 +#define M5 V25 + +// accumulator +#define H0_0 V26 +#define H1_0 V27 +#define H2_0 V28 +#define H0_1 V29 +#define H1_1 V30 +#define H2_1 V31 + +GLOBL ·keyMask<>(SB), RODATA, $16 +DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f +DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f + +GLOBL ·bswapMask<>(SB), RODATA, $16 +DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 +DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 + +GLOBL ·constants<>(SB), RODATA, $48 +// EX0 +DATA ·constants<>+0(SB)/8, $0x18191a1b1c1d1e1f +DATA ·constants<>+8(SB)/8, $0x0000050403020100 +// EX1 +DATA ·constants<>+16(SB)/8, $0x18191a1b1c1d1e1f +DATA ·constants<>+24(SB)/8, $0x00000a0908070605 +// EX2 +DATA ·constants<>+32(SB)/8, $0x18191a1b1c1d1e1f +DATA ·constants<>+40(SB)/8, $0x0000000f0e0d0c0b + +GLOBL ·c<>(SB), RODATA, $48 +// EX0 +DATA ·c<>+0(SB)/8, $0x0000050403020100 +DATA ·c<>+8(SB)/8, $0x0000151413121110 +// EX1 +DATA ·c<>+16(SB)/8, $0x00000a0908070605 +DATA ·c<>+24(SB)/8, $0x00001a1918171615 +// EX2 +DATA ·c<>+32(SB)/8, $0x0000000f0e0d0c0b +DATA ·c<>+40(SB)/8, $0x0000001f1e1d1c1b + +GLOBL ·reduce<>(SB), RODATA, $32 +// 44 bit +DATA ·reduce<>+0(SB)/8, $0x0 +DATA ·reduce<>+8(SB)/8, $0xfffffffffff +// 42 bit +DATA ·reduce<>+16(SB)/8, $0x0 +DATA ·reduce<>+24(SB)/8, $0x3ffffffffff + +// h = (f*g) % (2**130-5) [partial reduction] +// uses T_0...T_9 temporary registers +// input: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2 +// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9 +// output: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2 +#define MULTIPLY(m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) \ + \ // Eliminate the dependency for the last 2 VMSLs + VMSLG m02_0, r_2, m4_2, m4_2 \ + VMSLG m13_0, r_2, m5_2, m5_2 \ // 8 VMSLs pipelined + VMSLG m02_0, r_0, m4_0, m4_0 \ + VMSLG m02_1, r5_2, V0, T_0 \ + VMSLG m02_0, r_1, m4_1, m4_1 \ + VMSLG m02_1, r_0, V0, T_1 \ + VMSLG m02_1, r_1, V0, T_2 \ + VMSLG m02_2, r5_1, V0, T_3 \ + VMSLG m02_2, r5_2, V0, T_4 \ + VMSLG m13_0, r_0, m5_0, m5_0 \ + VMSLG m13_1, r5_2, V0, T_5 \ + VMSLG m13_0, r_1, m5_1, m5_1 \ + VMSLG m13_1, r_0, V0, T_6 \ + VMSLG m13_1, r_1, V0, T_7 \ + VMSLG m13_2, r5_1, V0, T_8 \ + VMSLG m13_2, r5_2, V0, T_9 \ + VMSLG m02_2, r_0, m4_2, m4_2 \ + VMSLG m13_2, r_0, m5_2, m5_2 \ + VAQ m4_0, T_0, m02_0 \ + VAQ m4_1, T_1, m02_1 \ + VAQ m5_0, T_5, m13_0 \ + VAQ m5_1, T_6, m13_1 \ + VAQ m02_0, T_3, m02_0 \ + VAQ m02_1, T_4, m02_1 \ + VAQ m13_0, T_8, m13_0 \ + VAQ m13_1, T_9, m13_1 \ + VAQ m4_2, T_2, m02_2 \ + VAQ m5_2, T_7, m13_2 \ + +// SQUARE uses three limbs of r and r_2*5 to output square of r +// uses T_1, T_5 and T_7 temporary registers +// input: r_0, r_1, r_2, r5_2 +// temp: TEMP0, TEMP1, TEMP2 +// output: p0, p1, p2 +#define SQUARE(r_0, r_1, r_2, r5_2, p0, p1, p2, TEMP0, TEMP1, TEMP2) \ + VMSLG r_0, r_0, p0, p0 \ + VMSLG r_1, r5_2, V0, TEMP0 \ + VMSLG r_2, r5_2, p1, p1 \ + VMSLG r_0, r_1, V0, TEMP1 \ + VMSLG r_1, r_1, p2, p2 \ + VMSLG r_0, r_2, V0, TEMP2 \ + VAQ TEMP0, p0, p0 \ + VAQ TEMP1, p1, p1 \ + VAQ TEMP2, p2, p2 \ + VAQ TEMP0, p0, p0 \ + VAQ TEMP1, p1, p1 \ + VAQ TEMP2, p2, p2 \ + +// carry h0->h1->h2->h0 || h3->h4->h5->h3 +// uses T_2, T_4, T_5, T_7, T_8, T_9 +// t6, t7, t8, t9, t10, t11 +// input: h0, h1, h2, h3, h4, h5 +// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 +// output: h0, h1, h2, h3, h4, h5 +#define REDUCE(h0, h1, h2, h3, h4, h5, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) \ + VLM (R12), t6, t7 \ // 44 and 42 bit clear mask + VLEIB $7, $0x28, t10 \ // 5 byte shift mask + VREPIB $4, t8 \ // 4 bit shift mask + VREPIB $2, t11 \ // 2 bit shift mask + VSRLB t10, h0, t0 \ // h0 byte shift + VSRLB t10, h1, t1 \ // h1 byte shift + VSRLB t10, h2, t2 \ // h2 byte shift + VSRLB t10, h3, t3 \ // h3 byte shift + VSRLB t10, h4, t4 \ // h4 byte shift + VSRLB t10, h5, t5 \ // h5 byte shift + VSRL t8, t0, t0 \ // h0 bit shift + VSRL t8, t1, t1 \ // h2 bit shift + VSRL t11, t2, t2 \ // h2 bit shift + VSRL t8, t3, t3 \ // h3 bit shift + VSRL t8, t4, t4 \ // h4 bit shift + VESLG $2, t2, t9 \ // h2 carry x5 + VSRL t11, t5, t5 \ // h5 bit shift + VN t6, h0, h0 \ // h0 clear carry + VAQ t2, t9, t2 \ // h2 carry x5 + VESLG $2, t5, t9 \ // h5 carry x5 + VN t6, h1, h1 \ // h1 clear carry + VN t7, h2, h2 \ // h2 clear carry + VAQ t5, t9, t5 \ // h5 carry x5 + VN t6, h3, h3 \ // h3 clear carry + VN t6, h4, h4 \ // h4 clear carry + VN t7, h5, h5 \ // h5 clear carry + VAQ t0, h1, h1 \ // h0->h1 + VAQ t3, h4, h4 \ // h3->h4 + VAQ t1, h2, h2 \ // h1->h2 + VAQ t4, h5, h5 \ // h4->h5 + VAQ t2, h0, h0 \ // h2->h0 + VAQ t5, h3, h3 \ // h5->h3 + VREPG $1, t6, t6 \ // 44 and 42 bit masks across both halves + VREPG $1, t7, t7 \ + VSLDB $8, h0, h0, h0 \ // set up [h0/1/2, h3/4/5] + VSLDB $8, h1, h1, h1 \ + VSLDB $8, h2, h2, h2 \ + VO h0, h3, h3 \ + VO h1, h4, h4 \ + VO h2, h5, h5 \ + VESRLG $44, h3, t0 \ // 44 bit shift right + VESRLG $44, h4, t1 \ + VESRLG $42, h5, t2 \ + VN t6, h3, h3 \ // clear carry bits + VN t6, h4, h4 \ + VN t7, h5, h5 \ + VESLG $2, t2, t9 \ // multiply carry by 5 + VAQ t9, t2, t2 \ + VAQ t0, h4, h4 \ + VAQ t1, h5, h5 \ + VAQ t2, h3, h3 \ + +// carry h0->h1->h2->h0 +// input: h0, h1, h2 +// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8 +// output: h0, h1, h2 +#define REDUCE2(h0, h1, h2, t0, t1, t2, t3, t4, t5, t6, t7, t8) \ + VLEIB $7, $0x28, t3 \ // 5 byte shift mask + VREPIB $4, t4 \ // 4 bit shift mask + VREPIB $2, t7 \ // 2 bit shift mask + VGBM $0x003F, t5 \ // mask to clear carry bits + VSRLB t3, h0, t0 \ + VSRLB t3, h1, t1 \ + VSRLB t3, h2, t2 \ + VESRLG $4, t5, t5 \ // 44 bit clear mask + VSRL t4, t0, t0 \ + VSRL t4, t1, t1 \ + VSRL t7, t2, t2 \ + VESRLG $2, t5, t6 \ // 42 bit clear mask + VESLG $2, t2, t8 \ + VAQ t8, t2, t2 \ + VN t5, h0, h0 \ + VN t5, h1, h1 \ + VN t6, h2, h2 \ + VAQ t0, h1, h1 \ + VAQ t1, h2, h2 \ + VAQ t2, h0, h0 \ + VSRLB t3, h0, t0 \ + VSRLB t3, h1, t1 \ + VSRLB t3, h2, t2 \ + VSRL t4, t0, t0 \ + VSRL t4, t1, t1 \ + VSRL t7, t2, t2 \ + VN t5, h0, h0 \ + VN t5, h1, h1 \ + VESLG $2, t2, t8 \ + VN t6, h2, h2 \ + VAQ t0, h1, h1 \ + VAQ t8, t2, t2 \ + VAQ t1, h2, h2 \ + VAQ t2, h0, h0 \ + +// expands two message blocks into the lower halfs of the d registers +// moves the contents of the d registers into upper halfs +// input: in1, in2, d0, d1, d2, d3, d4, d5 +// temp: TEMP0, TEMP1, TEMP2, TEMP3 +// output: d0, d1, d2, d3, d4, d5 +#define EXPACC(in1, in2, d0, d1, d2, d3, d4, d5, TEMP0, TEMP1, TEMP2, TEMP3) \ + VGBM $0xff3f, TEMP0 \ + VGBM $0xff1f, TEMP1 \ + VESLG $4, d1, TEMP2 \ + VESLG $4, d4, TEMP3 \ + VESRLG $4, TEMP0, TEMP0 \ + VPERM in1, d0, EX0, d0 \ + VPERM in2, d3, EX0, d3 \ + VPERM in1, d2, EX2, d2 \ + VPERM in2, d5, EX2, d5 \ + VPERM in1, TEMP2, EX1, d1 \ + VPERM in2, TEMP3, EX1, d4 \ + VN TEMP0, d0, d0 \ + VN TEMP0, d3, d3 \ + VESRLG $4, d1, d1 \ + VESRLG $4, d4, d4 \ + VN TEMP1, d2, d2 \ + VN TEMP1, d5, d5 \ + VN TEMP0, d1, d1 \ + VN TEMP0, d4, d4 \ + +// expands one message block into the lower halfs of the d registers +// moves the contents of the d registers into upper halfs +// input: in, d0, d1, d2 +// temp: TEMP0, TEMP1, TEMP2 +// output: d0, d1, d2 +#define EXPACC2(in, d0, d1, d2, TEMP0, TEMP1, TEMP2) \ + VGBM $0xff3f, TEMP0 \ + VESLG $4, d1, TEMP2 \ + VGBM $0xff1f, TEMP1 \ + VPERM in, d0, EX0, d0 \ + VESRLG $4, TEMP0, TEMP0 \ + VPERM in, d2, EX2, d2 \ + VPERM in, TEMP2, EX1, d1 \ + VN TEMP0, d0, d0 \ + VN TEMP1, d2, d2 \ + VESRLG $4, d1, d1 \ + VN TEMP0, d1, d1 \ + +// pack h2:h0 into h1:h0 (no carry) +// input: h0, h1, h2 +// output: h0, h1, h2 +#define PACK(h0, h1, h2) \ + VMRLG h1, h2, h2 \ // copy h1 to upper half h2 + VESLG $44, h1, h1 \ // shift limb 1 44 bits, leaving 20 + VO h0, h1, h0 \ // combine h0 with 20 bits from limb 1 + VESRLG $20, h2, h1 \ // put top 24 bits of limb 1 into h1 + VLEIG $1, $0, h1 \ // clear h2 stuff from lower half of h1 + VO h0, h1, h0 \ // h0 now has 88 bits (limb 0 and 1) + VLEIG $0, $0, h2 \ // clear upper half of h2 + VESRLG $40, h2, h1 \ // h1 now has upper two bits of result + VLEIB $7, $88, h1 \ // for byte shift (11 bytes) + VSLB h1, h2, h2 \ // shift h2 11 bytes to the left + VO h0, h2, h0 \ // combine h0 with 20 bits from limb 1 + VLEIG $0, $0, h1 \ // clear upper half of h1 + +// if h > 2**130-5 then h -= 2**130-5 +// input: h0, h1 +// temp: t0, t1, t2 +// output: h0 +#define MOD(h0, h1, t0, t1, t2) \ + VZERO t0 \ + VLEIG $1, $5, t0 \ + VACCQ h0, t0, t1 \ + VAQ h0, t0, t0 \ + VONE t2 \ + VLEIG $1, $-4, t2 \ + VAQ t2, t1, t1 \ + VACCQ h1, t1, t1 \ + VONE t2 \ + VAQ t2, t1, t1 \ + VN h0, t1, t2 \ + VNC t0, t1, t1 \ + VO t1, t2, h0 \ + +// func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]key) +TEXT ·poly1305vmsl(SB), $0-32 + // This code processes 6 + up to 4 blocks (32 bytes) per iteration + // using the algorithm described in: + // NEON crypto, Daniel J. Bernstein & Peter Schwabe + // https://cryptojedi.org/papers/neoncrypto-20120320.pdf + // And as moddified for VMSL as described in + // Accelerating Poly1305 Cryptographic Message Authentication on the z14 + // O'Farrell et al, CASCON 2017, p48-55 + // https://ibm.ent.box.com/s/jf9gedj0e9d2vjctfyh186shaztavnht + + LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key + VZERO V0 // c + + // load EX0, EX1 and EX2 + MOVD $·constants<>(SB), R5 + VLM (R5), EX0, EX2 // c + + // setup r + VL (R4), T_0 + MOVD $·keyMask<>(SB), R6 + VL (R6), T_1 + VN T_0, T_1, T_0 + VZERO T_2 // limbs for r + VZERO T_3 + VZERO T_4 + EXPACC2(T_0, T_2, T_3, T_4, T_1, T_5, T_7) + + // T_2, T_3, T_4: [0, r] + + // setup r*20 + VLEIG $0, $0, T_0 + VLEIG $1, $20, T_0 // T_0: [0, 20] + VZERO T_5 + VZERO T_6 + VMSLG T_0, T_3, T_5, T_5 + VMSLG T_0, T_4, T_6, T_6 + + // store r for final block in GR + VLGVG $1, T_2, RSAVE_0 // c + VLGVG $1, T_3, RSAVE_1 // c + VLGVG $1, T_4, RSAVE_2 // c + VLGVG $1, T_5, R5SAVE_1 // c + VLGVG $1, T_6, R5SAVE_2 // c + + // initialize h + VZERO H0_0 + VZERO H1_0 + VZERO H2_0 + VZERO H0_1 + VZERO H1_1 + VZERO H2_1 + + // initialize pointer for reduce constants + MOVD $·reduce<>(SB), R12 + + // calculate r**2 and 20*(r**2) + VZERO R_0 + VZERO R_1 + VZERO R_2 + SQUARE(T_2, T_3, T_4, T_6, R_0, R_1, R_2, T_1, T_5, T_7) + REDUCE2(R_0, R_1, R_2, M0, M1, M2, M3, M4, R5_1, R5_2, M5, T_1) + VZERO R5_1 + VZERO R5_2 + VMSLG T_0, R_1, R5_1, R5_1 + VMSLG T_0, R_2, R5_2, R5_2 + + // skip r**4 calculation if 3 blocks or less + CMPBLE R3, $48, b4 + + // calculate r**4 and 20*(r**4) + VZERO T_8 + VZERO T_9 + VZERO T_10 + SQUARE(R_0, R_1, R_2, R5_2, T_8, T_9, T_10, T_1, T_5, T_7) + REDUCE2(T_8, T_9, T_10, M0, M1, M2, M3, M4, T_2, T_3, M5, T_1) + VZERO T_2 + VZERO T_3 + VMSLG T_0, T_9, T_2, T_2 + VMSLG T_0, T_10, T_3, T_3 + + // put r**2 to the right and r**4 to the left of R_0, R_1, R_2 + VSLDB $8, T_8, T_8, T_8 + VSLDB $8, T_9, T_9, T_9 + VSLDB $8, T_10, T_10, T_10 + VSLDB $8, T_2, T_2, T_2 + VSLDB $8, T_3, T_3, T_3 + + VO T_8, R_0, R_0 + VO T_9, R_1, R_1 + VO T_10, R_2, R_2 + VO T_2, R5_1, R5_1 + VO T_3, R5_2, R5_2 + + CMPBLE R3, $80, load // less than or equal to 5 blocks in message + + // 6(or 5+1) blocks + SUB $81, R3 + VLM (R2), M0, M4 + VLL R3, 80(R2), M5 + ADD $1, R3 + MOVBZ $1, R0 + CMPBGE R3, $16, 2(PC) + VLVGB R3, R0, M5 + MOVD $96(R2), R2 + EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) + EXPACC(M2, M3, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) + VLEIB $2, $1, H2_0 + VLEIB $2, $1, H2_1 + VLEIB $10, $1, H2_0 + VLEIB $10, $1, H2_1 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO T_4 + VZERO T_10 + EXPACC(M4, M5, M0, M1, M2, M3, T_4, T_10, T_0, T_1, T_2, T_3) + VLR T_4, M4 + VLEIB $10, $1, M2 + CMPBLT R3, $16, 2(PC) + VLEIB $10, $1, T_10 + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) + VMRHG V0, H0_1, H0_0 + VMRHG V0, H1_1, H1_0 + VMRHG V0, H2_1, H2_0 + VMRLG V0, H0_1, H0_1 + VMRLG V0, H1_1, H1_1 + VMRLG V0, H2_1, H2_1 + + SUB $16, R3 + CMPBLE R3, $0, square + +load: + // load EX0, EX1 and EX2 + MOVD $·c<>(SB), R5 + VLM (R5), EX0, EX2 + +loop: + CMPBLE R3, $64, add // b4 // last 4 or less blocks left + + // next 4 full blocks + VLM (R2), M2, M5 + SUB $64, R3 + MOVD $64(R2), R2 + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, T_0, T_1, T_3, T_4, T_5, T_2, T_7, T_8, T_9) + + // expacc in-lined to create [m2, m3] limbs + VGBM $0x3f3f, T_0 // 44 bit clear mask + VGBM $0x1f1f, T_1 // 40 bit clear mask + VPERM M2, M3, EX0, T_3 + VESRLG $4, T_0, T_0 // 44 bit clear mask ready + VPERM M2, M3, EX1, T_4 + VPERM M2, M3, EX2, T_5 + VN T_0, T_3, T_3 + VESRLG $4, T_4, T_4 + VN T_1, T_5, T_5 + VN T_0, T_4, T_4 + VMRHG H0_1, T_3, H0_0 + VMRHG H1_1, T_4, H1_0 + VMRHG H2_1, T_5, H2_0 + VMRLG H0_1, T_3, H0_1 + VMRLG H1_1, T_4, H1_1 + VMRLG H2_1, T_5, H2_1 + VLEIB $10, $1, H2_0 + VLEIB $10, $1, H2_1 + VPERM M4, M5, EX0, T_3 + VPERM M4, M5, EX1, T_4 + VPERM M4, M5, EX2, T_5 + VN T_0, T_3, T_3 + VESRLG $4, T_4, T_4 + VN T_1, T_5, T_5 + VN T_0, T_4, T_4 + VMRHG V0, T_3, M0 + VMRHG V0, T_4, M1 + VMRHG V0, T_5, M2 + VMRLG V0, T_3, M3 + VMRLG V0, T_4, M4 + VMRLG V0, T_5, M5 + VLEIB $10, $1, M2 + VLEIB $10, $1, M5 + + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + CMPBNE R3, $0, loop + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) + VMRHG V0, H0_1, H0_0 + VMRHG V0, H1_1, H1_0 + VMRHG V0, H2_1, H2_0 + VMRLG V0, H0_1, H0_1 + VMRLG V0, H1_1, H1_1 + VMRLG V0, H2_1, H2_1 + + // load EX0, EX1, EX2 + MOVD $·constants<>(SB), R5 + VLM (R5), EX0, EX2 + + // sum vectors + VAQ H0_0, H0_1, H0_0 + VAQ H1_0, H1_1, H1_0 + VAQ H2_0, H2_1, H2_0 + + // h may be >= 2*(2**130-5) so we need to reduce it again + // M0...M4 are used as temps here + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) + +next: // carry h1->h2 + VLEIB $7, $0x28, T_1 + VREPIB $4, T_2 + VGBM $0x003F, T_3 + VESRLG $4, T_3 + + // byte shift + VSRLB T_1, H1_0, T_4 + + // bit shift + VSRL T_2, T_4, T_4 + + // clear h1 carry bits + VN T_3, H1_0, H1_0 + + // add carry + VAQ T_4, H2_0, H2_0 + + // h is now < 2*(2**130-5) + // pack h into h1 (hi) and h0 (lo) + PACK(H0_0, H1_0, H2_0) + + // if h > 2**130-5 then h -= 2**130-5 + MOD(H0_0, H1_0, T_0, T_1, T_2) + + // h += s + MOVD $·bswapMask<>(SB), R5 + VL (R5), T_1 + VL 16(R4), T_0 + VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) + VAQ T_0, H0_0, H0_0 + VPERM H0_0, H0_0, T_1, H0_0 // reverse bytes (to little) + VST H0_0, (R1) + RET + +add: + // load EX0, EX1, EX2 + MOVD $·constants<>(SB), R5 + VLM (R5), EX0, EX2 + + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) + VMRHG V0, H0_1, H0_0 + VMRHG V0, H1_1, H1_0 + VMRHG V0, H2_1, H2_0 + VMRLG V0, H0_1, H0_1 + VMRLG V0, H1_1, H1_1 + VMRLG V0, H2_1, H2_1 + CMPBLE R3, $64, b4 + +b4: + CMPBLE R3, $48, b3 // 3 blocks or less + + // 4(3+1) blocks remaining + SUB $49, R3 + VLM (R2), M0, M2 + VLL R3, 48(R2), M3 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, M3 + MOVD $64(R2), R2 + EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) + VLEIB $10, $1, H2_0 + VLEIB $10, $1, H2_1 + VZERO M0 + VZERO M1 + VZERO M4 + VZERO M5 + VZERO T_4 + VZERO T_10 + EXPACC(M2, M3, M0, M1, M4, M5, T_4, T_10, T_0, T_1, T_2, T_3) + VLR T_4, M2 + VLEIB $10, $1, M4 + CMPBNE R3, $16, 2(PC) + VLEIB $10, $1, T_10 + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M4, M5, M2, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) + VMRHG V0, H0_1, H0_0 + VMRHG V0, H1_1, H1_0 + VMRHG V0, H2_1, H2_0 + VMRLG V0, H0_1, H0_1 + VMRLG V0, H1_1, H1_1 + VMRLG V0, H2_1, H2_1 + SUB $16, R3 + CMPBLE R3, $0, square // this condition must always hold true! + +b3: + CMPBLE R3, $32, b2 + + // 3 blocks remaining + + // setup [r²,r] + VSLDB $8, R_0, R_0, R_0 + VSLDB $8, R_1, R_1, R_1 + VSLDB $8, R_2, R_2, R_2 + VSLDB $8, R5_1, R5_1, R5_1 + VSLDB $8, R5_2, R5_2, R5_2 + + VLVGG $1, RSAVE_0, R_0 + VLVGG $1, RSAVE_1, R_1 + VLVGG $1, RSAVE_2, R_2 + VLVGG $1, R5SAVE_1, R5_1 + VLVGG $1, R5SAVE_2, R5_2 + + // setup [h0, h1] + VSLDB $8, H0_0, H0_0, H0_0 + VSLDB $8, H1_0, H1_0, H1_0 + VSLDB $8, H2_0, H2_0, H2_0 + VO H0_1, H0_0, H0_0 + VO H1_1, H1_0, H1_0 + VO H2_1, H2_0, H2_0 + VZERO H0_1 + VZERO H1_1 + VZERO H2_1 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + + // H*[r**2, r] + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, T_10, M5) + + SUB $33, R3 + VLM (R2), M0, M1 + VLL R3, 32(R2), M2 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, M2 + + // H += m0 + VZERO T_1 + VZERO T_2 + VZERO T_3 + EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6) + VLEIB $10, $1, T_3 + VAG H0_0, T_1, H0_0 + VAG H1_0, T_2, H1_0 + VAG H2_0, T_3, H2_0 + + VZERO M0 + VZERO M3 + VZERO M4 + VZERO M5 + VZERO T_10 + + // (H+m0)*r + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M3, M4, M5, V0, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_10, H0_1, H1_1, H2_1, T_9) + + // H += m1 + VZERO V0 + VZERO T_1 + VZERO T_2 + VZERO T_3 + EXPACC2(M1, T_1, T_2, T_3, T_4, T_5, T_6) + VLEIB $10, $1, T_3 + VAQ H0_0, T_1, H0_0 + VAQ H1_0, T_2, H1_0 + VAQ H2_0, T_3, H2_0 + REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) + + // [H, m2] * [r**2, r] + EXPACC2(M2, H0_0, H1_0, H2_0, T_1, T_2, T_3) + CMPBNE R3, $16, 2(PC) + VLEIB $10, $1, H2_0 + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, M5, T_10) + SUB $16, R3 + CMPBLE R3, $0, next // this condition must always hold true! + +b2: + CMPBLE R3, $16, b1 + + // 2 blocks remaining + + // setup [r²,r] + VSLDB $8, R_0, R_0, R_0 + VSLDB $8, R_1, R_1, R_1 + VSLDB $8, R_2, R_2, R_2 + VSLDB $8, R5_1, R5_1, R5_1 + VSLDB $8, R5_2, R5_2, R5_2 + + VLVGG $1, RSAVE_0, R_0 + VLVGG $1, RSAVE_1, R_1 + VLVGG $1, RSAVE_2, R_2 + VLVGG $1, R5SAVE_1, R5_1 + VLVGG $1, R5SAVE_2, R5_2 + + // setup [h0, h1] + VSLDB $8, H0_0, H0_0, H0_0 + VSLDB $8, H1_0, H1_0, H1_0 + VSLDB $8, H2_0, H2_0, H2_0 + VO H0_1, H0_0, H0_0 + VO H1_1, H1_0, H1_0 + VO H2_1, H2_0, H2_0 + VZERO H0_1 + VZERO H1_1 + VZERO H2_1 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + + // H*[r**2, r] + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) + VMRHG V0, H0_1, H0_0 + VMRHG V0, H1_1, H1_0 + VMRHG V0, H2_1, H2_0 + VMRLG V0, H0_1, H0_1 + VMRLG V0, H1_1, H1_1 + VMRLG V0, H2_1, H2_1 + + // move h to the left and 0s at the right + VSLDB $8, H0_0, H0_0, H0_0 + VSLDB $8, H1_0, H1_0, H1_0 + VSLDB $8, H2_0, H2_0, H2_0 + + // get message blocks and append 1 to start + SUB $17, R3 + VL (R2), M0 + VLL R3, 16(R2), M1 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, M1 + VZERO T_6 + VZERO T_7 + VZERO T_8 + EXPACC2(M0, T_6, T_7, T_8, T_1, T_2, T_3) + EXPACC2(M1, T_6, T_7, T_8, T_1, T_2, T_3) + VLEIB $2, $1, T_8 + CMPBNE R3, $16, 2(PC) + VLEIB $10, $1, T_8 + + // add [m0, m1] to h + VAG H0_0, T_6, H0_0 + VAG H1_0, T_7, H1_0 + VAG H2_0, T_8, H2_0 + + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + VZERO T_10 + VZERO M0 + + // at this point R_0 .. R5_2 look like [r**2, r] + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M2, M3, M4, M5, T_10, M0, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M2, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) + SUB $16, R3, R3 + CMPBLE R3, $0, next + +b1: + CMPBLE R3, $0, next + + // 1 block remaining + + // setup [r²,r] + VSLDB $8, R_0, R_0, R_0 + VSLDB $8, R_1, R_1, R_1 + VSLDB $8, R_2, R_2, R_2 + VSLDB $8, R5_1, R5_1, R5_1 + VSLDB $8, R5_2, R5_2, R5_2 + + VLVGG $1, RSAVE_0, R_0 + VLVGG $1, RSAVE_1, R_1 + VLVGG $1, RSAVE_2, R_2 + VLVGG $1, R5SAVE_1, R5_1 + VLVGG $1, R5SAVE_2, R5_2 + + // setup [h0, h1] + VSLDB $8, H0_0, H0_0, H0_0 + VSLDB $8, H1_0, H1_0, H1_0 + VSLDB $8, H2_0, H2_0, H2_0 + VO H0_1, H0_0, H0_0 + VO H1_1, H1_0, H1_0 + VO H2_1, H2_0, H2_0 + VZERO H0_1 + VZERO H1_1 + VZERO H2_1 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + + // H*[r**2, r] + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) + + // set up [0, m0] limbs + SUB $1, R3 + VLL R3, (R2), M0 + ADD $1, R3 + MOVBZ $1, R0 + CMPBEQ R3, $16, 2(PC) + VLVGB R3, R0, M0 + VZERO T_1 + VZERO T_2 + VZERO T_3 + EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)// limbs: [0, m] + CMPBNE R3, $16, 2(PC) + VLEIB $10, $1, T_3 + + // h+m0 + VAQ H0_0, T_1, H0_0 + VAQ H1_0, T_2, H1_0 + VAQ H2_0, T_3, H2_0 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) + + BR next + +square: + // setup [r²,r] + VSLDB $8, R_0, R_0, R_0 + VSLDB $8, R_1, R_1, R_1 + VSLDB $8, R_2, R_2, R_2 + VSLDB $8, R5_1, R5_1, R5_1 + VSLDB $8, R5_2, R5_2, R5_2 + + VLVGG $1, RSAVE_0, R_0 + VLVGG $1, RSAVE_1, R_1 + VLVGG $1, RSAVE_2, R_2 + VLVGG $1, R5SAVE_1, R5_1 + VLVGG $1, R5SAVE_2, R5_2 + + // setup [h0, h1] + VSLDB $8, H0_0, H0_0, H0_0 + VSLDB $8, H1_0, H1_0, H1_0 + VSLDB $8, H2_0, H2_0, H2_0 + VO H0_1, H0_0, H0_0 + VO H1_1, H1_0, H1_0 + VO H2_1, H2_0, H2_0 + VZERO H0_1 + VZERO H1_1 + VZERO H2_1 + + VZERO M0 + VZERO M1 + VZERO M2 + VZERO M3 + VZERO M4 + VZERO M5 + + // (h0*r**2) + (h1*r) + MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) + REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) + BR next + +TEXT ·hasVMSLFacility(SB), NOSPLIT, $24-1 + MOVD $x-24(SP), R1 + XC $24, 0(R1), 0(R1) // clear the storage + MOVD $2, R0 // R0 is the number of double words stored -1 + WORD $0xB2B01000 // STFLE 0(R1) + XOR R0, R0 // reset the value of R0 + MOVBZ z-8(SP), R1 + AND $0x01, R1 + BEQ novmsl + +vectorinstalled: + // check if the vector instruction has been enabled + VLEIB $0, $0xF, V16 + VLGVB $0, V16, R1 + CMPBNE R1, $0xF, novmsl + MOVB $1, ret+0(FP) // have vx + RET + +novmsl: + MOVB $0, ret+0(FP) // no vx + RET diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index 30a49fdf27..67b0126105 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -16,6 +16,7 @@ import ( "hash" "io" "io/ioutil" + "math/bits" "golang.org/x/crypto/internal/chacha20" "golang.org/x/crypto/poly1305" @@ -641,8 +642,8 @@ const chacha20Poly1305ID = "chacha20-poly1305@openssh.com" // the methods here also implement padding, which RFC4253 Section 6 // also requires of stream ciphers. type chacha20Poly1305Cipher struct { - lengthKey [32]byte - contentKey [32]byte + lengthKey [8]uint32 + contentKey [8]uint32 buf []byte } @@ -655,20 +656,21 @@ func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionA buf: make([]byte, 256), } - copy(c.contentKey[:], key[:32]) - copy(c.lengthKey[:], key[32:]) + for i := range c.contentKey { + c.contentKey[i] = binary.LittleEndian.Uint32(key[i*4 : (i+1)*4]) + } + for i := range c.lengthKey { + c.lengthKey[i] = binary.LittleEndian.Uint32(key[(i+8)*4 : (i+9)*4]) + } return c, nil } -// The Poly1305 key is obtained by encrypting 32 0-bytes. -var chacha20PolyKeyInput [32]byte - func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { - var counter [16]byte - binary.BigEndian.PutUint64(counter[8:], uint64(seqNum)) - + nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} + s := chacha20.New(c.contentKey, nonce) var polyKey [32]byte - chacha20.XORKeyStream(polyKey[:], chacha20PolyKeyInput[:], &counter, &c.contentKey) + s.XORKeyStream(polyKey[:], polyKey[:]) + s.Advance() // skip next 32 bytes encryptedLength := c.buf[:4] if _, err := io.ReadFull(r, encryptedLength); err != nil { @@ -676,7 +678,7 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, } var lenBytes [4]byte - chacha20.XORKeyStream(lenBytes[:], encryptedLength, &counter, &c.lengthKey) + chacha20.New(c.lengthKey, nonce).XORKeyStream(lenBytes[:], encryptedLength) length := binary.BigEndian.Uint32(lenBytes[:]) if length > maxPacket { @@ -702,10 +704,8 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, return nil, errors.New("ssh: MAC failure") } - counter[0] = 1 - plain := c.buf[4:contentEnd] - chacha20.XORKeyStream(plain, plain, &counter, &c.contentKey) + s.XORKeyStream(plain, plain) padding := plain[0] if padding < 4 { @@ -724,11 +724,11 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, } func (c *chacha20Poly1305Cipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, payload []byte) error { - var counter [16]byte - binary.BigEndian.PutUint64(counter[8:], uint64(seqNum)) - + nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} + s := chacha20.New(c.contentKey, nonce) var polyKey [32]byte - chacha20.XORKeyStream(polyKey[:], chacha20PolyKeyInput[:], &counter, &c.contentKey) + s.XORKeyStream(polyKey[:], polyKey[:]) + s.Advance() // skip next 32 bytes // There is no blocksize, so fall back to multiple of 8 byte // padding, as described in RFC 4253, Sec 6. @@ -748,7 +748,7 @@ func (c *chacha20Poly1305Cipher) writePacket(seqNum uint32, w io.Writer, rand io } binary.BigEndian.PutUint32(c.buf, uint32(1+len(payload)+padding)) - chacha20.XORKeyStream(c.buf, c.buf[:4], &counter, &c.lengthKey) + chacha20.New(c.lengthKey, nonce).XORKeyStream(c.buf, c.buf[:4]) c.buf[4] = byte(padding) copy(c.buf[5:], payload) packetEnd := 5 + len(payload) + padding @@ -756,8 +756,7 @@ func (c *chacha20Poly1305Cipher) writePacket(seqNum uint32, w io.Writer, rand io return err } - counter[0] = 1 - chacha20.XORKeyStream(c.buf[4:], c.buf[4:packetEnd], &counter, &c.contentKey) + s.XORKeyStream(c.buf[4:], c.buf[4:packetEnd]) var mac [poly1305.TagSize]byte poly1305.Sum(&mac, c.buf[:packetEnd], &polyKey) diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index 6fd1994553..ae6ca775ee 100644 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ b/vendor/golang.org/x/crypto/ssh/client.go @@ -19,6 +19,8 @@ import ( type Client struct { Conn + handleForwardsOnce sync.Once // guards calling (*Client).handleForwards + forwards forwardList // forwarded tcpip connections from the remote side mu sync.Mutex channelHandlers map[string]chan NewChannel @@ -60,8 +62,6 @@ func NewClient(c Conn, chans <-chan NewChannel, reqs <-chan *Request) *Client { conn.Wait() conn.forwards.closeAll() }() - go conn.forwards.handleChannels(conn.HandleChannelOpen("forwarded-tcpip")) - go conn.forwards.handleChannels(conn.HandleChannelOpen("forwarded-streamlocal@openssh.com")) return conn } diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index 73697deda6..34d95822fc 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -803,7 +803,7 @@ func encryptedBlock(block *pem.Block) bool { } // ParseRawPrivateKey returns a private key from a PEM encoded private key. It -// supports RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys. +// supports RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { @@ -817,6 +817,9 @@ func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { switch block.Type { case "RSA PRIVATE KEY": return x509.ParsePKCS1PrivateKey(block.Bytes) + // RFC5208 - https://tools.ietf.org/html/rfc5208 + case "PRIVATE KEY": + return x509.ParsePKCS8PrivateKey(block.Bytes) case "EC PRIVATE KEY": return x509.ParseECPrivateKey(block.Bytes) case "DSA PRIVATE KEY": diff --git a/vendor/golang.org/x/crypto/ssh/streamlocal.go b/vendor/golang.org/x/crypto/ssh/streamlocal.go index a2dccc64c7..b171b330bc 100644 --- a/vendor/golang.org/x/crypto/ssh/streamlocal.go +++ b/vendor/golang.org/x/crypto/ssh/streamlocal.go @@ -32,6 +32,7 @@ type streamLocalChannelForwardMsg struct { // ListenUnix is similar to ListenTCP but uses a Unix domain socket. func (c *Client) ListenUnix(socketPath string) (net.Listener, error) { + c.handleForwardsOnce.Do(c.handleForwards) m := streamLocalChannelForwardMsg{ socketPath, } diff --git a/vendor/golang.org/x/crypto/ssh/tcpip.go b/vendor/golang.org/x/crypto/ssh/tcpip.go index acf17175df..80d35f5ec1 100644 --- a/vendor/golang.org/x/crypto/ssh/tcpip.go +++ b/vendor/golang.org/x/crypto/ssh/tcpip.go @@ -90,10 +90,19 @@ type channelForwardMsg struct { rport uint32 } +// handleForwards starts goroutines handling forwarded connections. +// It's called on first use by (*Client).ListenTCP to not launch +// goroutines until needed. +func (c *Client) handleForwards() { + go c.forwards.handleChannels(c.HandleChannelOpen("forwarded-tcpip")) + go c.forwards.handleChannels(c.HandleChannelOpen("forwarded-streamlocal@openssh.com")) +} + // ListenTCP requests the remote peer open a listening socket // on laddr. Incoming connections will be available by calling // Accept on the returned net.Listener. func (c *Client) ListenTCP(laddr *net.TCPAddr) (net.Listener, error) { + c.handleForwardsOnce.Do(c.handleForwards) if laddr.Port == 0 && isBrokenOpenSSHVersion(string(c.ServerVersion())) { return c.autoPortListenWorkaround(laddr) } diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go index d23e05e064..4b1fa42747 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -209,27 +209,6 @@ loop: p.oe = p.oe[:i+1] } -// generateAllImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of caption, colgroup, dd, div, dt, li, optgroup, option, p, rb, -// rp, rt, rtc, span, tbody, td, tfoot, th, thead or tr. -func (p *parser) generateAllImpliedEndTags() { - var i int - for i = len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if n.Type == ElementNode { - switch n.DataAtom { - // TODO: remove this divergence from the HTML5 spec - case a.Caption, a.Colgroup, a.Dd, a.Div, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, - a.Rp, a.Rt, a.Rtc, a.Span, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: - continue - } - } - break - } - - p.oe = p.oe[:i+1] -} - // addChild adds a child node n to the top element, and pushes n onto the stack // of open elements if it is an element node. func (p *parser) addChild(n *Node) { @@ -276,7 +255,7 @@ func (p *parser) fosterParent(n *Node) { } } - if template != nil && (table == nil || j < i) { + if template != nil && (table == nil || j > i) { template.AppendChild(n) return } @@ -679,11 +658,16 @@ func inHeadIM(p *parser) bool { if !p.oe.contains(a.Template) { return true } - p.generateAllImpliedEndTags() - if n := p.oe.top(); n.DataAtom != a.Template { - return true + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + p.generateImpliedEndTags() + for i := len(p.oe) - 1; i >= 0; i-- { + if n := p.oe[i]; n.Namespace == "" && n.DataAtom == a.Template { + p.oe = p.oe[:i] + break + } } - p.popUntil(defaultScope, a.Template) p.clearActiveFormattingElements() p.templateStack.pop() p.resetInsertionMode() @@ -860,9 +844,13 @@ func inBodyIM(p *parser) bool { // The newline, if any, will be dealt with by the TextToken case. p.framesetOK = false case a.Form: - if p.oe.contains(a.Template) || p.form == nil { - p.popUntil(buttonScope, a.P) - p.addElement() + if p.form != nil && !p.oe.contains(a.Template) { + // Ignore the token + return true + } + p.popUntil(buttonScope, a.P) + p.addElement() + if !p.oe.contains(a.Template) { p.form = p.top() } case a.Li: @@ -1070,13 +1058,7 @@ func inBodyIM(p *parser) bool { p.acknowledgeSelfClosingTag() } return true - case a.Frame: - // TODO: remove this divergence from the HTML5 spec. - if p.oe.contains(a.Template) { - p.addElement() - return true - } - case a.Caption, a.Col, a.Colgroup, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: + case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: // Ignore the token. default: p.reconstructActiveFormattingElements() @@ -1098,12 +1080,13 @@ func inBodyIM(p *parser) bool { p.popUntil(defaultScope, p.tok.DataAtom) case a.Form: if p.oe.contains(a.Template) { - if !p.oe.contains(a.Form) { + i := p.indexOfElementInScope(defaultScope, a.Form) + if i == -1 { // Ignore the token. return true } p.generateImpliedEndTags() - if p.tok.DataAtom == a.Form { + if p.oe[i].DataAtom != a.Form { // Ignore the token. return true } @@ -1346,9 +1329,6 @@ func textIM(p *parser) bool { // Section 12.2.6.4.9. func inTableIM(p *parser) bool { switch p.tok.Type { - case ErrorToken: - // Stop parsing. - return true case TextToken: p.tok.Data = strings.Replace(p.tok.Data, "\x00", "", -1) switch p.oe.top().DataAtom { @@ -1443,6 +1423,8 @@ func inTableIM(p *parser) bool { case DoctypeToken: // Ignore the token. return true + case ErrorToken: + return inBodyIM(p) } p.fosterParenting = true @@ -1545,6 +1527,8 @@ func inColumnGroupIM(p *parser) bool { case a.Template: return inHeadIM(p) } + case ErrorToken: + return inBodyIM(p) } if p.oe.top().DataAtom != a.Colgroup { return true @@ -1709,9 +1693,6 @@ func inCellIM(p *parser) bool { // Section 12.2.6.4.16. func inSelectIM(p *parser) bool { switch p.tok.Type { - case ErrorToken: - // Stop parsing. - return true case TextToken: p.addText(strings.Replace(p.tok.Data, "\x00", "", -1)) case StartTagToken: @@ -1775,6 +1756,8 @@ func inSelectIM(p *parser) bool { case DoctypeToken: // Ignore the token. return true + case ErrorToken: + return inBodyIM(p) } return true @@ -1841,15 +1824,26 @@ func inTemplateIM(p *parser) bool { // Ignore the token. return true } + case ErrorToken: + if !p.oe.contains(a.Template) { + // Ignore the token. + return true + } + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + p.generateImpliedEndTags() + for i := len(p.oe) - 1; i >= 0; i-- { + if n := p.oe[i]; n.Namespace == "" && n.DataAtom == a.Template { + p.oe = p.oe[:i] + break + } + } + p.clearActiveFormattingElements() + p.templateStack.pop() + p.resetInsertionMode() + return false } - if !p.oe.contains(a.Template) { - // Ignore the token. - return true - } - p.popUntil(defaultScope, a.Template) - p.clearActiveFormattingElements() - p.templateStack.pop() - p.resetInsertionMode() return false } @@ -1923,11 +1917,6 @@ func inFramesetIM(p *parser) bool { p.acknowledgeSelfClosingTag() case a.Noframes: return inHeadIM(p) - case a.Template: - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - return inTemplateIM(p) } case EndTagToken: switch p.tok.DataAtom { diff --git a/vendor/golang.org/x/net/http/httpguts/guts.go b/vendor/golang.org/x/net/http/httpguts/guts.go index 8255fd49b4..e6cd0ced39 100644 --- a/vendor/golang.org/x/net/http/httpguts/guts.go +++ b/vendor/golang.org/x/net/http/httpguts/guts.go @@ -14,21 +14,6 @@ import ( "strings" ) -// SniffedContentType reports whether ct is a Content-Type that is known -// to cause client-side content sniffing. -// -// This provides just a partial implementation of mime.ParseMediaType -// with the assumption that the Content-Type is not attacker controlled. -func SniffedContentType(ct string) bool { - if i := strings.Index(ct, ";"); i != -1 { - ct = ct[:i] - } - ct = strings.ToLower(strings.TrimSpace(ct)) - return ct == "text/plain" || ct == "application/octet-stream" || - ct == "application/unknown" || ct == "unknown/unknown" || ct == "*/*" || - !strings.Contains(ct, "/") -} - // ValidTrailerHeader reports whether name is a valid header field name to appear // in trailers. // See RFC 7230, Section 4.1.2 diff --git a/vendor/golang.org/x/net/http2/client_conn_pool.go b/vendor/golang.org/x/net/http2/client_conn_pool.go index bdf5652b01..f4d9b5ece3 100644 --- a/vendor/golang.org/x/net/http2/client_conn_pool.go +++ b/vendor/golang.org/x/net/http2/client_conn_pool.go @@ -52,9 +52,31 @@ const ( noDialOnMiss = false ) +// shouldTraceGetConn reports whether getClientConn should call any +// ClientTrace.GetConn hook associated with the http.Request. +// +// This complexity is needed to avoid double calls of the GetConn hook +// during the back-and-forth between net/http and x/net/http2 (when the +// net/http.Transport is upgraded to also speak http2), as well as support +// the case where x/net/http2 is being used directly. +func (p *clientConnPool) shouldTraceGetConn(st clientConnIdleState) bool { + // If our Transport wasn't made via ConfigureTransport, always + // trace the GetConn hook if provided, because that means the + // http2 package is being used directly and it's the one + // dialing, as opposed to net/http. + if _, ok := p.t.ConnPool.(noDialClientConnPool); !ok { + return true + } + // Otherwise, only use the GetConn hook if this connection has + // been used previously for other requests. For fresh + // connections, the net/http package does the dialing. + return !st.freshConn +} + func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { if isConnectionCloseRequest(req) && dialOnMiss { // It gets its own connection. + traceGetConn(req, addr) const singleUse = true cc, err := p.t.dialClientConn(addr, singleUse) if err != nil { @@ -64,7 +86,10 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis } p.mu.Lock() for _, cc := range p.conns[addr] { - if cc.CanTakeNewRequest() { + if st := cc.idleState(); st.canTakeNewRequest { + if p.shouldTraceGetConn(st) { + traceGetConn(req, addr) + } p.mu.Unlock() return cc, nil } @@ -73,6 +98,7 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis p.mu.Unlock() return nil, ErrNoCachedConn } + traceGetConn(req, addr) call := p.getStartDialLocked(addr) p.mu.Unlock() <-call.done diff --git a/vendor/golang.org/x/net/http2/configure_transport.go b/vendor/golang.org/x/net/http2/configure_transport.go index 088d6e2bdb..6356b32872 100644 --- a/vendor/golang.org/x/net/http2/configure_transport.go +++ b/vendor/golang.org/x/net/http2/configure_transport.go @@ -57,7 +57,7 @@ func configureTransport(t1 *http.Transport) (*Transport, error) { // registerHTTPSProtocol calls Transport.RegisterProtocol but // converting panics into errors. -func registerHTTPSProtocol(t *http.Transport, rt http.RoundTripper) (err error) { +func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) { defer func() { if e := recover(); e != nil { err = fmt.Errorf("%v", e) @@ -69,10 +69,12 @@ func registerHTTPSProtocol(t *http.Transport, rt http.RoundTripper) (err error) // noDialH2RoundTripper is a RoundTripper which only tries to complete the request // if there's already has a cached connection to the host. -type noDialH2RoundTripper struct{ t *Transport } +// (The field is exported so it can be accessed via reflect from net/http; tested +// by TestNoDialH2RoundTripperType) +type noDialH2RoundTripper struct{ *Transport } func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - res, err := rt.t.RoundTrip(req) + res, err := rt.Transport.RoundTrip(req) if isNoCachedConnError(err) { return nil, http.ErrSkipAltProtocol } diff --git a/vendor/golang.org/x/net/http2/flow.go b/vendor/golang.org/x/net/http2/flow.go index 957de25420..cea601fcdf 100644 --- a/vendor/golang.org/x/net/http2/flow.go +++ b/vendor/golang.org/x/net/http2/flow.go @@ -41,10 +41,10 @@ func (f *flow) take(n int32) { // add adds n bytes (positive or negative) to the flow control window. // It returns false if the sum would exceed 2^31-1. func (f *flow) add(n int32) bool { - remain := (1<<31 - 1) - f.n - if n > remain { - return false + sum := f.n + n + if (sum > n) == (f.n > 0) { + f.n = sum + return true } - f.n += n - return true + return false } diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index e32500779a..c85e31f264 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -733,32 +733,67 @@ func (f *SettingsFrame) IsAck() bool { return f.FrameHeader.Flags.Has(FlagSettingsAck) } -func (f *SettingsFrame) Value(s SettingID) (v uint32, ok bool) { +func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) { f.checkValid() - buf := f.p - for len(buf) > 0 { - settingID := SettingID(binary.BigEndian.Uint16(buf[:2])) - if settingID == s { - return binary.BigEndian.Uint32(buf[2:6]), true + for i := 0; i < f.NumSettings(); i++ { + if s := f.Setting(i); s.ID == id { + return s.Val, true } - buf = buf[6:] } return 0, false } +// Setting returns the setting from the frame at the given 0-based index. +// The index must be >= 0 and less than f.NumSettings(). +func (f *SettingsFrame) Setting(i int) Setting { + buf := f.p + return Setting{ + ID: SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])), + Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]), + } +} + +func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 } + +// HasDuplicates reports whether f contains any duplicate setting IDs. +func (f *SettingsFrame) HasDuplicates() bool { + num := f.NumSettings() + if num == 0 { + return false + } + // If it's small enough (the common case), just do the n^2 + // thing and avoid a map allocation. + if num < 10 { + for i := 0; i < num; i++ { + idi := f.Setting(i).ID + for j := i + 1; j < num; j++ { + idj := f.Setting(j).ID + if idi == idj { + return true + } + } + } + return false + } + seen := map[SettingID]bool{} + for i := 0; i < num; i++ { + id := f.Setting(i).ID + if seen[id] { + return true + } + seen[id] = true + } + return false +} + // ForeachSetting runs fn for each setting. // It stops and returns the first error. func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error { f.checkValid() - buf := f.p - for len(buf) > 0 { - if err := fn(Setting{ - SettingID(binary.BigEndian.Uint16(buf[:2])), - binary.BigEndian.Uint32(buf[2:6]), - }); err != nil { + for i := 0; i < f.NumSettings(); i++ { + if err := fn(f.Setting(i)); err != nil { return err } - buf = buf[6:] } return nil } diff --git a/vendor/golang.org/x/net/http2/go111.go b/vendor/golang.org/x/net/http2/go111.go new file mode 100644 index 0000000000..9749dc0be5 --- /dev/null +++ b/vendor/golang.org/x/net/http2/go111.go @@ -0,0 +1,26 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.11 + +package http2 + +import "net/textproto" + +func traceHasWroteHeaderField(trace *clientTrace) bool { + return trace != nil && trace.WroteHeaderField != nil +} + +func traceWroteHeaderField(trace *clientTrace, k, v string) { + if trace != nil && trace.WroteHeaderField != nil { + trace.WroteHeaderField(k, []string{v}) + } +} + +func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error { + if trace != nil { + return trace.Got1xxResponse + } + return nil +} diff --git a/vendor/golang.org/x/net/http2/go17.go b/vendor/golang.org/x/net/http2/go17.go index 47b7fae081..d957b7bc52 100644 --- a/vendor/golang.org/x/net/http2/go17.go +++ b/vendor/golang.org/x/net/http2/go17.go @@ -18,6 +18,8 @@ type contextContext interface { context.Context } +var errCanceled = context.Canceled + func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx contextContext, cancel func()) { ctx, cancel = context.WithCancel(context.Background()) ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr()) @@ -48,6 +50,14 @@ func (t *Transport) idleConnTimeout() time.Duration { func setResponseUncompressed(res *http.Response) { res.Uncompressed = true } +func traceGetConn(req *http.Request, hostPort string) { + trace := httptrace.ContextClientTrace(req.Context()) + if trace == nil || trace.GetConn == nil { + return + } + trace.GetConn(hostPort) +} + func traceGotConn(req *http.Request, cc *ClientConn) { trace := httptrace.ContextClientTrace(req.Context()) if trace == nil || trace.GotConn == nil { @@ -104,3 +114,8 @@ func requestTrace(req *http.Request) *clientTrace { func (cc *ClientConn) Ping(ctx context.Context) error { return cc.ping(ctx) } + +// Shutdown gracefully closes the client connection, waiting for running streams to complete. +func (cc *ClientConn) Shutdown(ctx context.Context) error { + return cc.shutdown(ctx) +} diff --git a/vendor/golang.org/x/net/http2/headermap.go b/vendor/golang.org/x/net/http2/headermap.go index c2805f6ac4..c3ff3fa1c7 100644 --- a/vendor/golang.org/x/net/http2/headermap.go +++ b/vendor/golang.org/x/net/http2/headermap.go @@ -7,15 +7,21 @@ package http2 import ( "net/http" "strings" + "sync" ) var ( - commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case - commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case + commonBuildOnce sync.Once + commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case + commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case ) -func init() { - for _, v := range []string{ +func buildCommonHeaderMapsOnce() { + commonBuildOnce.Do(buildCommonHeaderMaps) +} + +func buildCommonHeaderMaps() { + common := []string{ "accept", "accept-charset", "accept-encoding", @@ -63,7 +69,10 @@ func init() { "vary", "via", "www-authenticate", - } { + } + commonLowerHeader = make(map[string]string, len(common)) + commonCanonHeader = make(map[string]string, len(common)) + for _, v := range common { chk := http.CanonicalHeaderKey(v) commonLowerHeader[chk] = v commonCanonHeader[v] = chk @@ -71,6 +80,7 @@ func init() { } func lowerHeader(v string) string { + buildCommonHeaderMapsOnce() if s, ok := commonLowerHeader[v]; ok { return s } diff --git a/vendor/golang.org/x/net/http2/hpack/huffman.go b/vendor/golang.org/x/net/http2/hpack/huffman.go index 8850e39467..b412a96c50 100644 --- a/vendor/golang.org/x/net/http2/hpack/huffman.go +++ b/vendor/golang.org/x/net/http2/hpack/huffman.go @@ -47,6 +47,7 @@ var ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data") // If maxLen is greater than 0, attempts to write more to buf than // maxLen bytes will return ErrStringLength. func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error { + rootHuffmanNode := getRootHuffmanNode() n := rootHuffmanNode // cur is the bit buffer that has not been fed into n. // cbits is the number of low order bits in cur that are valid. @@ -106,7 +107,7 @@ func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error { type node struct { // children is non-nil for internal nodes - children []*node + children *[256]*node // The following are only valid if children is nil: codeLen uint8 // number of bits that led to the output of sym @@ -114,22 +115,31 @@ type node struct { } func newInternalNode() *node { - return &node{children: make([]*node, 256)} + return &node{children: new([256]*node)} } -var rootHuffmanNode = newInternalNode() +var ( + buildRootOnce sync.Once + lazyRootHuffmanNode *node +) + +func getRootHuffmanNode() *node { + buildRootOnce.Do(buildRootHuffmanNode) + return lazyRootHuffmanNode +} -func init() { +func buildRootHuffmanNode() { if len(huffmanCodes) != 256 { panic("unexpected size") } + lazyRootHuffmanNode = newInternalNode() for i, code := range huffmanCodes { addDecoderNode(byte(i), code, huffmanCodeLen[i]) } } func addDecoderNode(sym byte, code uint32, codeLen uint8) { - cur := rootHuffmanNode + cur := lazyRootHuffmanNode for codeLen > 8 { codeLen -= 8 i := uint8(code >> codeLen) diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index c82428254a..bdaba1d46b 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -201,19 +201,12 @@ func validWireHeaderFieldName(v string) bool { return true } -var httpCodeStringCommon = map[int]string{} // n -> strconv.Itoa(n) - -func init() { - for i := 100; i <= 999; i++ { - if v := http.StatusText(i); v != "" { - httpCodeStringCommon[i] = strconv.Itoa(i) - } - } -} - func httpCodeString(code int) string { - if s, ok := httpCodeStringCommon[code]; ok { - return s + switch code { + case 200: + return "200" + case 404: + return "404" } return strconv.Itoa(code) } diff --git a/vendor/golang.org/x/net/http2/not_go111.go b/vendor/golang.org/x/net/http2/not_go111.go new file mode 100644 index 0000000000..0df34e6d99 --- /dev/null +++ b/vendor/golang.org/x/net/http2/not_go111.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.11 + +package http2 + +import "net/textproto" + +func traceHasWroteHeaderField(trace *clientTrace) bool { return false } + +func traceWroteHeaderField(trace *clientTrace, k, v string) {} + +func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error { + return nil +} diff --git a/vendor/golang.org/x/net/http2/not_go17.go b/vendor/golang.org/x/net/http2/not_go17.go index 140434a791..7ffb25046a 100644 --- a/vendor/golang.org/x/net/http2/not_go17.go +++ b/vendor/golang.org/x/net/http2/not_go17.go @@ -8,6 +8,7 @@ package http2 import ( "crypto/tls" + "errors" "net" "net/http" "time" @@ -18,6 +19,8 @@ type contextContext interface { Err() error } +var errCanceled = errors.New("canceled") + type fakeContext struct{} func (fakeContext) Done() <-chan struct{} { return nil } @@ -34,6 +37,7 @@ func setResponseUncompressed(res *http.Response) { type clientTrace struct{} func requestTrace(*http.Request) *clientTrace { return nil } +func traceGetConn(*http.Request, string) {} func traceGotConn(*http.Request, *ClientConn) {} func traceFirstResponseByte(*clientTrace) {} func traceWroteHeaders(*clientTrace) {} @@ -84,4 +88,8 @@ func (cc *ClientConn) Ping(ctx contextContext) error { return cc.ping(ctx) } +func (cc *ClientConn) Shutdown(ctx contextContext) error { + return cc.shutdown(ctx) +} + func (t *Transport) idleConnTimeout() time.Duration { return 0 } diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index abf94e8d36..56859d1f86 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -663,6 +663,7 @@ func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { func (sc *serverConn) canonicalHeader(v string) string { sc.serveG.check() + buildCommonHeaderMapsOnce() cv, ok := commonCanonHeader[v] if ok { return cv @@ -1487,6 +1488,12 @@ func (sc *serverConn) processSettings(f *SettingsFrame) error { } return nil } + if f.NumSettings() > 100 || f.HasDuplicates() { + // This isn't actually in the spec, but hang up on + // suspiciously large settings frames or those with + // duplicate entries. + return ConnectionError(ErrCodeProtocol) + } if err := f.ForeachSetting(sc.processSetting); err != nil { return err } @@ -1575,6 +1582,12 @@ func (sc *serverConn) processData(f *DataFrame) error { // type PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } + // RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in + // "open" or "half-closed (local)" state, the recipient MUST respond with a + // stream error (Section 5.4.2) of type STREAM_CLOSED. + if state == stateClosed { + return streamError(id, ErrCodeStreamClosed) + } if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued { // This includes sending a RST_STREAM if the stream is // in stateHalfClosedLocal (which currently means that @@ -1608,7 +1621,10 @@ func (sc *serverConn) processData(f *DataFrame) error { // Sender sending more than they'd declared? if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) - return streamError(id, ErrCodeStreamClosed) + // RFC 7540, sec 8.1.2.6: A request or response is also malformed if the + // value of a content-length header field does not equal the sum of the + // DATA frame payload lengths that form the body. + return streamError(id, ErrCodeProtocol) } if f.Length > 0 { // Check whether the client has flow control quota. @@ -1718,6 +1734,13 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // processing this frame. return nil } + // RFC 7540, sec 5.1: If an endpoint receives additional frames, other than + // WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in + // this state, it MUST respond with a stream error (Section 5.4.2) of + // type STREAM_CLOSED. + if st.state == stateHalfClosedRemote { + return streamError(id, ErrCodeStreamClosed) + } return st.processTrailerHeaders(f) } @@ -2309,7 +2332,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { isHeadResp := rws.req.Method == "HEAD" if !rws.sentHeader { rws.sentHeader = true - var ctype, clen string if clen = rws.snapHeader.Get("Content-Length"); clen != "" { rws.snapHeader.Del("Content-Length") @@ -2323,33 +2345,10 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { if clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { clen = strconv.Itoa(len(p)) } - _, hasContentType := rws.snapHeader["Content-Type"] if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { - if cto := rws.snapHeader.Get("X-Content-Type-Options"); strings.EqualFold("nosniff", cto) { - // nosniff is an explicit directive not to guess a content-type. - // Content-sniffing is no less susceptible to polyglot attacks via - // hosted content when done on the server. - ctype = "application/octet-stream" - rws.conn.logf("http2: WriteHeader called with X-Content-Type-Options:nosniff but no Content-Type") - } else { - ctype = http.DetectContentType(p) - } - } - - var noSniff bool - if bodyAllowedForStatus(rws.status) && (rws.sentContentLen > 0 || len(p) > 0) { - // If the content type triggers client-side sniffing on old browsers, - // attach a X-Content-Type-Options header if not present (or explicitly nil). - if _, ok := rws.snapHeader["X-Content-Type-Options"]; !ok { - if hasContentType { - noSniff = httpguts.SniffedContentType(rws.snapHeader.Get("Content-Type")) - } else if ctype != "" { - noSniff = httpguts.SniffedContentType(ctype) - } - } + ctype = http.DetectContentType(p) } - var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. @@ -2360,6 +2359,19 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { foreachHeaderElement(v, rws.declareTrailer) } + // "Connection" headers aren't allowed in HTTP/2 (RFC 7540, 8.1.2.2), + // but respect "Connection" == "close" to mean sending a GOAWAY and tearing + // down the TCP connection when idle, like we do for HTTP/1. + // TODO: remove more Connection-specific header fields here, in addition + // to "Connection". + if _, ok := rws.snapHeader["Connection"]; ok { + v := rws.snapHeader.Get("Connection") + delete(rws.snapHeader, "Connection") + if v == "close" { + rws.conn.startGracefulShutdown() + } + } + endStream := (rws.handlerDone && !rws.hasTrailers() && len(p) == 0) || isHeadResp err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, @@ -2368,7 +2380,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { endStream: endStream, contentType: ctype, contentLength: clen, - noSniff: noSniff, date: date, }) if err != nil { diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index d23a226251..9d1f2fadd3 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -21,6 +21,7 @@ import ( mathrand "math/rand" "net" "net/http" + "net/textproto" "sort" "strconv" "strings" @@ -159,6 +160,7 @@ type ClientConn struct { cond *sync.Cond // hold mu; broadcast on flow/closed changes flow flow // our conn-level flow control quota (cs.flow is per stream) inflow flow // peer's conn-level flow control + closing bool closed bool wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received @@ -211,9 +213,10 @@ type clientStream struct { done chan struct{} // closed when stream remove from cc.streams map; close calls guarded by cc.mu // owned by clientConnReadLoop: - firstByte bool // got the first response byte - pastHeaders bool // got first MetaHeadersFrame (actual headers) - pastTrailers bool // got optional second MetaHeadersFrame (trailers) + firstByte bool // got the first response byte + pastHeaders bool // got first MetaHeadersFrame (actual headers) + pastTrailers bool // got optional second MetaHeadersFrame (trailers) + num1xx uint8 // number of 1xx responses seen trailer http.Header // accumulated trailers resTrailer *http.Header // client's Response.Trailer @@ -237,6 +240,17 @@ func awaitRequestCancel(req *http.Request, done <-chan struct{}) error { } } +var got1xxFuncForTests func(int, textproto.MIMEHeader) error + +// get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, +// if any. It returns nil if not set or if the Go version is too old. +func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error { + if fn := got1xxFuncForTests; fn != nil { + return fn + } + return traceGot1xxResponseFunc(cs.trace) +} + // awaitRequestCancel waits for the user to cancel a request, its context to // expire, or for the request to be done (any way it might be removed from the // cc.streams map: peer reset, successful completion, TCP connection breakage, @@ -423,27 +437,36 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt if !canRetryError(err) { return nil, err } - if !afterBodyWrite { - return req, nil - } // If the Body is nil (or http.NoBody), it's safe to reuse // this request and its Body. if req.Body == nil || reqBodyIsNoBody(req.Body) { return req, nil } - // Otherwise we depend on the Request having its GetBody - // func defined. + + // If the request body can be reset back to its original + // state via the optional req.GetBody, do that. getBody := reqGetBody(req) // Go 1.8: getBody = req.GetBody - if getBody == nil { - return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) + if getBody != nil { + // TODO: consider a req.Body.Close here? or audit that all caller paths do? + body, err := getBody() + if err != nil { + return nil, err + } + newReq := *req + newReq.Body = body + return &newReq, nil } - body, err := getBody() - if err != nil { - return nil, err + + // The Request.Body can't reset back to the beginning, but we + // don't seem to have started to read from it yet, so reuse + // the request directly. The "afterBodyWrite" means the + // bodyWrite process has started, which becomes true before + // the first Read. + if !afterBodyWrite { + return req, nil } - newReq := *req - newReq.Body = body - return &newReq, nil + + return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) } func canRetryError(err error) bool { @@ -630,12 +653,32 @@ func (cc *ClientConn) CanTakeNewRequest() bool { return cc.canTakeNewRequestLocked() } -func (cc *ClientConn) canTakeNewRequestLocked() bool { +// clientConnIdleState describes the suitability of a client +// connection to initiate a new RoundTrip request. +type clientConnIdleState struct { + canTakeNewRequest bool + freshConn bool // whether it's unused by any previous request +} + +func (cc *ClientConn) idleState() clientConnIdleState { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.idleStateLocked() +} + +func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { if cc.singleUse && cc.nextStreamID > 1 { - return false + return } - return cc.goAway == nil && !cc.closed && + st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && int64(cc.nextStreamID)+int64(cc.pendingRequests) < math.MaxInt32 + st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest + return +} + +func (cc *ClientConn) canTakeNewRequestLocked() bool { + st := cc.idleStateLocked() + return st.canTakeNewRequest } // onIdleTimeout is called from a time.AfterFunc goroutine. It will @@ -665,6 +708,88 @@ func (cc *ClientConn) closeIfIdle() { cc.tconn.Close() } +var shutdownEnterWaitStateHook = func() {} + +// Shutdown gracefully close the client connection, waiting for running streams to complete. +// Public implementation is in go17.go and not_go17.go +func (cc *ClientConn) shutdown(ctx contextContext) error { + if err := cc.sendGoAway(); err != nil { + return err + } + // Wait for all in-flight streams to complete or connection to close + done := make(chan error, 1) + cancelled := false // guarded by cc.mu + go func() { + cc.mu.Lock() + defer cc.mu.Unlock() + for { + if len(cc.streams) == 0 || cc.closed { + cc.closed = true + done <- cc.tconn.Close() + break + } + if cancelled { + break + } + cc.cond.Wait() + } + }() + shutdownEnterWaitStateHook() + select { + case err := <-done: + return err + case <-ctx.Done(): + cc.mu.Lock() + // Free the goroutine above + cancelled = true + cc.cond.Broadcast() + cc.mu.Unlock() + return ctx.Err() + } +} + +func (cc *ClientConn) sendGoAway() error { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.wmu.Lock() + defer cc.wmu.Unlock() + if cc.closing { + // GOAWAY sent already + return nil + } + // Send a graceful shutdown frame to server + maxStreamID := cc.nextStreamID + if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { + return err + } + if err := cc.bw.Flush(); err != nil { + return err + } + // Prevent new requests + cc.closing = true + return nil +} + +// Close closes the client connection immediately. +// +// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. +func (cc *ClientConn) Close() error { + cc.mu.Lock() + defer cc.cond.Broadcast() + defer cc.mu.Unlock() + err := errors.New("http2: client connection force closed via ClientConn.Close") + for id, cs := range cc.streams { + select { + case cs.resc <- resAndError{err: err}: + default: + } + cs.bufPipe.CloseWithError(err) + delete(cc.streams, id) + } + cc.closed = true + return cc.tconn.Close() +} + const maxAllocFrameSize = 512 << 10 // frameBuffer returns a scratch buffer suitable for writing DATA frames. @@ -747,7 +872,7 @@ func checkConnHeaders(req *http.Request) error { if vv := req.Header["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { return fmt.Errorf("http2: invalid Transfer-Encoding request header: %q", vv) } - if vv := req.Header["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "close" && vv[0] != "keep-alive") { + if vv := req.Header["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !strings.EqualFold(vv[0], "close") && !strings.EqualFold(vv[0], "keep-alive")) { return fmt.Errorf("http2: invalid Connection request header: %q", vv) } return nil @@ -1291,9 +1416,16 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail return nil, errRequestHeaderListSize } + trace := requestTrace(req) + traceHeaders := traceHasWroteHeaderField(trace) + // Header list size is ok. Write the headers. enumerateHeaders(func(name, value string) { - cc.writeHeader(strings.ToLower(name), value) + name = strings.ToLower(name) + cc.writeHeader(name, value) + if traceHeaders { + traceWroteHeaderField(trace, name, value) + } }) return cc.hbuf.Bytes(), nil @@ -1615,8 +1747,7 @@ func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { // is the detail. // // As a special case, handleResponse may return (nil, nil) to skip the -// frame (currently only used for 100 expect continue). This special -// case is going away after Issue 13851 is fixed. +// frame (currently only used for 1xx responses). func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFrame) (*http.Response, error) { if f.Truncated { return nil, errResponseHeaderListSize @@ -1631,15 +1762,6 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra return nil, errors.New("malformed response from server: malformed non-numeric status pseudo header") } - if statusCode == 100 { - traceGot100Continue(cs.trace) - if cs.on100 != nil { - cs.on100() // forces any write delay timer to fire - } - cs.pastHeaders = false // do it all again - return nil, nil - } - header := make(http.Header) res := &http.Response{ Proto: "HTTP/2.0", @@ -1664,6 +1786,27 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra } } + if statusCode >= 100 && statusCode <= 199 { + cs.num1xx++ + const max1xxResponses = 5 // arbitrary bound on number of informational responses, same as net/http + if cs.num1xx > max1xxResponses { + return nil, errors.New("http2: too many 1xx informational responses") + } + if fn := cs.get1xxTraceFunc(); fn != nil { + if err := fn(statusCode, textproto.MIMEHeader(header)); err != nil { + return nil, err + } + } + if statusCode == 100 { + traceGot100Continue(cs.trace) + if cs.on100 != nil { + cs.on100() // forces any write delay timer to fire + } + } + cs.pastHeaders = false // do it all again + return nil, nil + } + streamEnded := f.StreamEnded() isHead := cs.req.Method == "HEAD" if !streamEnded || isHead { diff --git a/vendor/golang.org/x/net/http2/write.go b/vendor/golang.org/x/net/http2/write.go index a5120412e6..8a9711f6e4 100644 --- a/vendor/golang.org/x/net/http2/write.go +++ b/vendor/golang.org/x/net/http2/write.go @@ -186,7 +186,6 @@ type writeResHeaders struct { date string contentType string contentLength string - noSniff bool } func encKV(enc *hpack.Encoder, k, v string) { @@ -223,9 +222,6 @@ func (w *writeResHeaders) writeFrame(ctx writeContext) error { if w.contentLength != "" { encKV(enc, "content-length", w.contentLength) } - if w.noSniff { - encKV(enc, "x-content-type-options", "nosniff") - } if w.date != "" { encKV(enc, "date", w.date) } diff --git a/vendor/golang.org/x/net/trace/trace.go b/vendor/golang.org/x/net/trace/trace.go index a46ee0eaa3..f00d869ff7 100644 --- a/vendor/golang.org/x/net/trace/trace.go +++ b/vendor/golang.org/x/net/trace/trace.go @@ -70,6 +70,7 @@ import ( "log" "net" "net/http" + "net/url" "runtime" "sort" "strconv" @@ -110,6 +111,13 @@ var AuthRequest = func(req *http.Request) (any, sensitive bool) { } func init() { + _, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: "/debug/requests"}}) + if pat != "" { + panic("/debug/requests is already registered. You may have two independent copies of " + + "golang.org/x/net/trace in your binary, trying to maintain separate state. This may " + + "involve a vendored copy of golang.org/x/net/trace.") + } + // TODO(jbd): Serve Traces from /debug/traces in the future? // There is no requirement for a request to be present to have traces. http.HandleFunc("/debug/requests", Traces) diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go index 30fb315d13..5c5451ad8d 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -101,7 +101,9 @@ var brokenAuthHeaderProviders = []string{ "https://api.pushbullet.com/", "https://api.soundcloud.com/", "https://api.twitch.tv/", + "https://id.twitch.tv/", "https://app.box.com/", + "https://api.box.com/", "https://connect.stripe.com/", "https://login.mailchimp.com/", "https://login.microsoftonline.com/", @@ -128,6 +130,8 @@ var brokenAuthHeaderProviders = []string{ "https://log.finalsurge.com/oauth/token", "https://multisport.todaysplan.com.au/rest/oauth/access_token", "https://whats.todaysplan.com.au/rest/oauth/access_token", + "https://stackoverflow.com/oauth/access_token", + "https://account.health.nokia.com", } // brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints. diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go index a047a5f98b..16775d081b 100644 --- a/vendor/golang.org/x/oauth2/oauth2.go +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -3,7 +3,8 @@ // license that can be found in the LICENSE file. // Package oauth2 provides support for making -// OAuth2 authorized and authenticated HTTP requests. +// OAuth2 authorized and authenticated HTTP requests, +// as specified in RFC 6749. // It can additionally grant authorization with Bearer JWT. package oauth2 // import "golang.org/x/oauth2" @@ -123,6 +124,8 @@ func SetAuthURLParam(key, value string) AuthCodeOption { // // Opts may include AccessTypeOnline or AccessTypeOffline, as well // as ApprovalForce. +// It can also be used to pass the PKCE challange. +// See https://www.oauth.com/oauth2-servers/pkce/ for more info. func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { var buf bytes.Buffer buf.WriteString(c.Endpoint.AuthURL) @@ -185,7 +188,10 @@ func (c *Config) PasswordCredentialsToken(ctx context.Context, username, passwor // // The code will be in the *http.Request.FormValue("code"). Before // calling Exchange, be sure to validate FormValue("state"). -func (c *Config) Exchange(ctx context.Context, code string) (*Token, error) { +// +// Opts may include the PKCE verifier code if previously used in AuthCodeURL. +// See https://www.oauth.com/oauth2-servers/pkce/ for more info. +func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) { v := url.Values{ "grant_type": {"authorization_code"}, "code": {code}, @@ -193,6 +199,9 @@ func (c *Config) Exchange(ctx context.Context, code string) (*Token, error) { if c.RedirectURL != "" { v.Set("redirect_uri", c.RedirectURL) } + for _, opt := range opts { + opt.setValue(v) + } return retrieveToken(ctx, c, v) } diff --git a/vendor/golang.org/x/oauth2/transport.go b/vendor/golang.org/x/oauth2/transport.go index 92ac7e2531..aa0d34f1e0 100644 --- a/vendor/golang.org/x/oauth2/transport.go +++ b/vendor/golang.org/x/oauth2/transport.go @@ -31,9 +31,17 @@ type Transport struct { } // RoundTrip authorizes and authenticates the request with an -// access token. If no token exists or token is expired, -// tries to refresh/fetch a new token. +// access token from Transport's Source. func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + reqBodyClosed := false + if req.Body != nil { + defer func() { + if !reqBodyClosed { + req.Body.Close() + } + }() + } + if t.Source == nil { return nil, errors.New("oauth2: Transport's Source is nil") } @@ -46,6 +54,10 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { token.SetAuthHeader(req2) t.setModReq(req, req2) res, err := t.base().RoundTrip(req2) + + // req.Body is assumed to have been closed by the base RoundTripper. + reqBodyClosed = true + if err != nil { t.setModReq(req, nil) return nil, err diff --git a/vendor/google.golang.org/appengine/internal/api.go b/vendor/google.golang.org/appengine/internal/api.go index ec5aa59b39..16f87c5d37 100644 --- a/vendor/google.golang.org/appengine/internal/api.go +++ b/vendor/google.golang.org/appengine/internal/api.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build !appengine +// +build go1.7 package internal @@ -32,7 +33,8 @@ import ( ) const ( - apiPath = "/rpc_http" + apiPath = "/rpc_http" + defaultTicketSuffix = "/default.20150612t184001.0" ) var ( @@ -60,6 +62,11 @@ var ( Dial: limitDial, }, } + + defaultTicketOnce sync.Once + defaultTicket string + backgroundContextOnce sync.Once + backgroundContext netcontext.Context ) func apiURL() *url.URL { @@ -83,16 +90,10 @@ func handleHTTP(w http.ResponseWriter, r *http.Request) { outHeader: w.Header(), apiURL: apiURL(), } - stopFlushing := make(chan int) + r = r.WithContext(withContext(r.Context(), c)) + c.req = r - ctxs.Lock() - ctxs.m[r] = c - ctxs.Unlock() - defer func() { - ctxs.Lock() - delete(ctxs.m, r) - ctxs.Unlock() - }() + stopFlushing := make(chan int) // Patch up RemoteAddr so it looks reasonable. if addr := r.Header.Get(userIPHeader); addr != "" { @@ -191,18 +192,6 @@ func renderPanic(x interface{}) string { return string(buf) } -var ctxs = struct { - sync.Mutex - m map[*http.Request]*context - bg *context // background context, lazily initialized - // dec is used by tests to decorate the netcontext.Context returned - // for a given request. This allows tests to add overrides (such as - // WithAppIDOverride) to the context. The map is nil outside tests. - dec map[*http.Request]func(netcontext.Context) netcontext.Context -}{ - m: make(map[*http.Request]*context), -} - // context represents the context of an in-flight HTTP request. // It implements the appengine.Context and http.ResponseWriter interfaces. type context struct { @@ -223,6 +212,34 @@ type context struct { var contextKey = "holds a *context" +// jointContext joins two contexts in a superficial way. +// It takes values and timeouts from a base context, and only values from another context. +type jointContext struct { + base netcontext.Context + valuesOnly netcontext.Context +} + +func (c jointContext) Deadline() (time.Time, bool) { + return c.base.Deadline() +} + +func (c jointContext) Done() <-chan struct{} { + return c.base.Done() +} + +func (c jointContext) Err() error { + return c.base.Err() +} + +func (c jointContext) Value(key interface{}) interface{} { + if val := c.base.Value(key); val != nil { + return val + } + return c.valuesOnly.Value(key) +} + +// fromContext returns the App Engine context or nil if ctx is not +// derived from an App Engine context. func fromContext(ctx netcontext.Context) *context { c, _ := ctx.Value(&contextKey).(*context) return c @@ -247,86 +264,70 @@ func IncomingHeaders(ctx netcontext.Context) http.Header { return nil } -func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context { - ctxs.Lock() - c := ctxs.m[req] - d := ctxs.dec[req] - ctxs.Unlock() +func ReqContext(req *http.Request) netcontext.Context { + return req.Context() +} - if d != nil { - parent = d(parent) +func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context { + return jointContext{ + base: parent, + valuesOnly: req.Context(), } +} - if c == nil { - // Someone passed in an http.Request that is not in-flight. - // We panic here rather than panicking at a later point - // so that stack traces will be more sensible. - log.Panic("appengine: NewContext passed an unknown http.Request") - } - return withContext(parent, c) +// DefaultTicket returns a ticket used for background context or dev_appserver. +func DefaultTicket() string { + defaultTicketOnce.Do(func() { + if IsDevAppServer() { + defaultTicket = "testapp" + defaultTicketSuffix + return + } + appID := partitionlessAppID() + escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1) + majVersion := VersionID(nil) + if i := strings.Index(majVersion, "."); i > 0 { + majVersion = majVersion[:i] + } + defaultTicket = fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID()) + }) + return defaultTicket } func BackgroundContext() netcontext.Context { - ctxs.Lock() - defer ctxs.Unlock() - - if ctxs.bg != nil { - return toContext(ctxs.bg) - } - - // Compute background security ticket. - appID := partitionlessAppID() - escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1) - majVersion := VersionID(nil) - if i := strings.Index(majVersion, "."); i > 0 { - majVersion = majVersion[:i] - } - ticket := fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID()) - - ctxs.bg = &context{ - req: &http.Request{ - Header: http.Header{ - ticketHeader: []string{ticket}, + backgroundContextOnce.Do(func() { + // Compute background security ticket. + ticket := DefaultTicket() + + c := &context{ + req: &http.Request{ + Header: http.Header{ + ticketHeader: []string{ticket}, + }, }, - }, - apiURL: apiURL(), - } + apiURL: apiURL(), + } + backgroundContext = toContext(c) - // TODO(dsymonds): Wire up the shutdown handler to do a final flush. - go ctxs.bg.logFlusher(make(chan int)) + // TODO(dsymonds): Wire up the shutdown handler to do a final flush. + go c.logFlusher(make(chan int)) + }) - return toContext(ctxs.bg) + return backgroundContext } // RegisterTestRequest registers the HTTP request req for testing, such that // any API calls are sent to the provided URL. It returns a closure to delete // the registration. // It should only be used by aetest package. -func RegisterTestRequest(req *http.Request, apiURL *url.URL, decorate func(netcontext.Context) netcontext.Context) func() { +func RegisterTestRequest(req *http.Request, apiURL *url.URL, decorate func(netcontext.Context) netcontext.Context) (*http.Request, func()) { c := &context{ req: req, apiURL: apiURL, } - ctxs.Lock() - defer ctxs.Unlock() - if _, ok := ctxs.m[req]; ok { - log.Panic("req already associated with context") - } - if _, ok := ctxs.dec[req]; ok { - log.Panic("req already associated with context") - } - if ctxs.dec == nil { - ctxs.dec = make(map[*http.Request]func(netcontext.Context) netcontext.Context) - } - ctxs.m[req] = c - ctxs.dec[req] = decorate - - return func() { - ctxs.Lock() - delete(ctxs.m, req) - delete(ctxs.dec, req) - ctxs.Unlock() - } + ctx := withContext(decorate(req.Context()), c) + req = req.WithContext(ctx) + c.req = req + return req, func() {} } var errTimeout = &CallError{ @@ -452,7 +453,7 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message) c := fromContext(ctx) if c == nil { // Give a good error message rather than a panic lower down. - return errors.New("not an App Engine context") + return errNotAppEngineContext } // Apply transaction modifications if we're in a transaction. @@ -475,6 +476,16 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message) } ticket := c.req.Header.Get(ticketHeader) + // Use a test ticket under test environment. + if ticket == "" { + if appid := ctx.Value(&appIDOverrideKey); appid != nil { + ticket = appid.(string) + defaultTicketSuffix + } + } + // Fall back to use background ticket when the request ticket is not available in Flex or dev_appserver. + if ticket == "" { + ticket = DefaultTicket() + } req := &remotepb.Request{ ServiceName: &service, Method: &method, @@ -550,6 +561,9 @@ var logLevelName = map[int64]string{ } func logf(c *context, level int64, format string, args ...interface{}) { + if c == nil { + panic("not an App Engine context") + } s := fmt.Sprintf(format, args...) s = strings.TrimRight(s, "\n") // Remove any trailing newline characters. c.addLogLine(&logpb.UserAppLogLine{ diff --git a/vendor/google.golang.org/appengine/internal/api_classic.go b/vendor/google.golang.org/appengine/internal/api_classic.go index 597f66e6ea..f0f40b2e35 100644 --- a/vendor/google.golang.org/appengine/internal/api_classic.go +++ b/vendor/google.golang.org/appengine/internal/api_classic.go @@ -22,14 +22,20 @@ import ( var contextKey = "holds an appengine.Context" +// fromContext returns the App Engine context or nil if ctx is not +// derived from an App Engine context. func fromContext(ctx netcontext.Context) appengine.Context { c, _ := ctx.Value(&contextKey).(appengine.Context) return c } // This is only for classic App Engine adapters. -func ClassicContextFromContext(ctx netcontext.Context) appengine.Context { - return fromContext(ctx) +func ClassicContextFromContext(ctx netcontext.Context) (appengine.Context, error) { + c := fromContext(ctx) + if c == nil { + return nil, errNotAppEngineContext + } + return c, nil } func withContext(parent netcontext.Context, c appengine.Context) netcontext.Context { @@ -53,6 +59,10 @@ func IncomingHeaders(ctx netcontext.Context) http.Header { return nil } +func ReqContext(req *http.Request) netcontext.Context { + return WithContext(netcontext.Background(), req) +} + func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context { c := appengine.NewContext(req) return withContext(parent, c) @@ -98,7 +108,7 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message) c := fromContext(ctx) if c == nil { // Give a good error message rather than a panic lower down. - return errors.New("not an App Engine context") + return errNotAppEngineContext } // Apply transaction modifications if we're in a transaction. diff --git a/vendor/google.golang.org/appengine/internal/api_common.go b/vendor/google.golang.org/appengine/internal/api_common.go index 2db33a774b..e0c0b214b7 100644 --- a/vendor/google.golang.org/appengine/internal/api_common.go +++ b/vendor/google.golang.org/appengine/internal/api_common.go @@ -5,10 +5,15 @@ package internal import ( + "errors" + "os" + "github.com/golang/protobuf/proto" netcontext "golang.org/x/net/context" ) +var errNotAppEngineContext = errors.New("not an App Engine context") + type CallOverrideFunc func(ctx netcontext.Context, service, method string, in, out proto.Message) error var callOverrideKey = "holds []CallOverrideFunc" @@ -77,10 +82,42 @@ func Logf(ctx netcontext.Context, level int64, format string, args ...interface{ f(level, format, args...) return } - logf(fromContext(ctx), level, format, args...) + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + logf(c, level, format, args...) } // NamespacedContext wraps a Context to support namespaces. func NamespacedContext(ctx netcontext.Context, namespace string) netcontext.Context { return withNamespace(ctx, namespace) } + +// SetTestEnv sets the env variables for testing background ticket in Flex. +func SetTestEnv() func() { + var environ = []struct { + key, value string + }{ + {"GAE_LONG_APP_ID", "my-app-id"}, + {"GAE_MINOR_VERSION", "067924799508853122"}, + {"GAE_MODULE_INSTANCE", "0"}, + {"GAE_MODULE_NAME", "default"}, + {"GAE_MODULE_VERSION", "20150612t184001"}, + } + + for _, v := range environ { + old := os.Getenv(v.key) + os.Setenv(v.key, v.value) + v.value = old + } + return func() { // Restore old environment after the test completes. + for _, v := range environ { + if v.value == "" { + os.Unsetenv(v.key) + continue + } + os.Setenv(v.key, v.value) + } + } +} diff --git a/vendor/google.golang.org/appengine/internal/api_pre17.go b/vendor/google.golang.org/appengine/internal/api_pre17.go new file mode 100644 index 0000000000..028b4f056e --- /dev/null +++ b/vendor/google.golang.org/appengine/internal/api_pre17.go @@ -0,0 +1,682 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +// +build !appengine +// +build !go1.7 + +package internal + +import ( + "bytes" + "errors" + "fmt" + "io/ioutil" + "log" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" + + "github.com/golang/protobuf/proto" + netcontext "golang.org/x/net/context" + + basepb "google.golang.org/appengine/internal/base" + logpb "google.golang.org/appengine/internal/log" + remotepb "google.golang.org/appengine/internal/remote_api" +) + +const ( + apiPath = "/rpc_http" + defaultTicketSuffix = "/default.20150612t184001.0" +) + +var ( + // Incoming headers. + ticketHeader = http.CanonicalHeaderKey("X-AppEngine-API-Ticket") + dapperHeader = http.CanonicalHeaderKey("X-Google-DapperTraceInfo") + traceHeader = http.CanonicalHeaderKey("X-Cloud-Trace-Context") + curNamespaceHeader = http.CanonicalHeaderKey("X-AppEngine-Current-Namespace") + userIPHeader = http.CanonicalHeaderKey("X-AppEngine-User-IP") + remoteAddrHeader = http.CanonicalHeaderKey("X-AppEngine-Remote-Addr") + + // Outgoing headers. + apiEndpointHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Endpoint") + apiEndpointHeaderValue = []string{"app-engine-apis"} + apiMethodHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Method") + apiMethodHeaderValue = []string{"/VMRemoteAPI.CallRemoteAPI"} + apiDeadlineHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Deadline") + apiContentType = http.CanonicalHeaderKey("Content-Type") + apiContentTypeValue = []string{"application/octet-stream"} + logFlushHeader = http.CanonicalHeaderKey("X-AppEngine-Log-Flush-Count") + + apiHTTPClient = &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: limitDial, + }, + } + + defaultTicketOnce sync.Once + defaultTicket string +) + +func apiURL() *url.URL { + host, port := "appengine.googleapis.internal", "10001" + if h := os.Getenv("API_HOST"); h != "" { + host = h + } + if p := os.Getenv("API_PORT"); p != "" { + port = p + } + return &url.URL{ + Scheme: "http", + Host: host + ":" + port, + Path: apiPath, + } +} + +func handleHTTP(w http.ResponseWriter, r *http.Request) { + c := &context{ + req: r, + outHeader: w.Header(), + apiURL: apiURL(), + } + stopFlushing := make(chan int) + + ctxs.Lock() + ctxs.m[r] = c + ctxs.Unlock() + defer func() { + ctxs.Lock() + delete(ctxs.m, r) + ctxs.Unlock() + }() + + // Patch up RemoteAddr so it looks reasonable. + if addr := r.Header.Get(userIPHeader); addr != "" { + r.RemoteAddr = addr + } else if addr = r.Header.Get(remoteAddrHeader); addr != "" { + r.RemoteAddr = addr + } else { + // Should not normally reach here, but pick a sensible default anyway. + r.RemoteAddr = "127.0.0.1" + } + // The address in the headers will most likely be of these forms: + // 123.123.123.123 + // 2001:db8::1 + // net/http.Request.RemoteAddr is specified to be in "IP:port" form. + if _, _, err := net.SplitHostPort(r.RemoteAddr); err != nil { + // Assume the remote address is only a host; add a default port. + r.RemoteAddr = net.JoinHostPort(r.RemoteAddr, "80") + } + + // Start goroutine responsible for flushing app logs. + // This is done after adding c to ctx.m (and stopped before removing it) + // because flushing logs requires making an API call. + go c.logFlusher(stopFlushing) + + executeRequestSafely(c, r) + c.outHeader = nil // make sure header changes aren't respected any more + + stopFlushing <- 1 // any logging beyond this point will be dropped + + // Flush any pending logs asynchronously. + c.pendingLogs.Lock() + flushes := c.pendingLogs.flushes + if len(c.pendingLogs.lines) > 0 { + flushes++ + } + c.pendingLogs.Unlock() + go c.flushLog(false) + w.Header().Set(logFlushHeader, strconv.Itoa(flushes)) + + // Avoid nil Write call if c.Write is never called. + if c.outCode != 0 { + w.WriteHeader(c.outCode) + } + if c.outBody != nil { + w.Write(c.outBody) + } +} + +func executeRequestSafely(c *context, r *http.Request) { + defer func() { + if x := recover(); x != nil { + logf(c, 4, "%s", renderPanic(x)) // 4 == critical + c.outCode = 500 + } + }() + + http.DefaultServeMux.ServeHTTP(c, r) +} + +func renderPanic(x interface{}) string { + buf := make([]byte, 16<<10) // 16 KB should be plenty + buf = buf[:runtime.Stack(buf, false)] + + // Remove the first few stack frames: + // this func + // the recover closure in the caller + // That will root the stack trace at the site of the panic. + const ( + skipStart = "internal.renderPanic" + skipFrames = 2 + ) + start := bytes.Index(buf, []byte(skipStart)) + p := start + for i := 0; i < skipFrames*2 && p+1 < len(buf); i++ { + p = bytes.IndexByte(buf[p+1:], '\n') + p + 1 + if p < 0 { + break + } + } + if p >= 0 { + // buf[start:p+1] is the block to remove. + // Copy buf[p+1:] over buf[start:] and shrink buf. + copy(buf[start:], buf[p+1:]) + buf = buf[:len(buf)-(p+1-start)] + } + + // Add panic heading. + head := fmt.Sprintf("panic: %v\n\n", x) + if len(head) > len(buf) { + // Extremely unlikely to happen. + return head + } + copy(buf[len(head):], buf) + copy(buf, head) + + return string(buf) +} + +var ctxs = struct { + sync.Mutex + m map[*http.Request]*context + bg *context // background context, lazily initialized + // dec is used by tests to decorate the netcontext.Context returned + // for a given request. This allows tests to add overrides (such as + // WithAppIDOverride) to the context. The map is nil outside tests. + dec map[*http.Request]func(netcontext.Context) netcontext.Context +}{ + m: make(map[*http.Request]*context), +} + +// context represents the context of an in-flight HTTP request. +// It implements the appengine.Context and http.ResponseWriter interfaces. +type context struct { + req *http.Request + + outCode int + outHeader http.Header + outBody []byte + + pendingLogs struct { + sync.Mutex + lines []*logpb.UserAppLogLine + flushes int + } + + apiURL *url.URL +} + +var contextKey = "holds a *context" + +// fromContext returns the App Engine context or nil if ctx is not +// derived from an App Engine context. +func fromContext(ctx netcontext.Context) *context { + c, _ := ctx.Value(&contextKey).(*context) + return c +} + +func withContext(parent netcontext.Context, c *context) netcontext.Context { + ctx := netcontext.WithValue(parent, &contextKey, c) + if ns := c.req.Header.Get(curNamespaceHeader); ns != "" { + ctx = withNamespace(ctx, ns) + } + return ctx +} + +func toContext(c *context) netcontext.Context { + return withContext(netcontext.Background(), c) +} + +func IncomingHeaders(ctx netcontext.Context) http.Header { + if c := fromContext(ctx); c != nil { + return c.req.Header + } + return nil +} + +func ReqContext(req *http.Request) netcontext.Context { + return WithContext(netcontext.Background(), req) +} + +func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context { + ctxs.Lock() + c := ctxs.m[req] + d := ctxs.dec[req] + ctxs.Unlock() + + if d != nil { + parent = d(parent) + } + + if c == nil { + // Someone passed in an http.Request that is not in-flight. + // We panic here rather than panicking at a later point + // so that stack traces will be more sensible. + log.Panic("appengine: NewContext passed an unknown http.Request") + } + return withContext(parent, c) +} + +// DefaultTicket returns a ticket used for background context or dev_appserver. +func DefaultTicket() string { + defaultTicketOnce.Do(func() { + if IsDevAppServer() { + defaultTicket = "testapp" + defaultTicketSuffix + return + } + appID := partitionlessAppID() + escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1) + majVersion := VersionID(nil) + if i := strings.Index(majVersion, "."); i > 0 { + majVersion = majVersion[:i] + } + defaultTicket = fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID()) + }) + return defaultTicket +} + +func BackgroundContext() netcontext.Context { + ctxs.Lock() + defer ctxs.Unlock() + + if ctxs.bg != nil { + return toContext(ctxs.bg) + } + + // Compute background security ticket. + ticket := DefaultTicket() + + ctxs.bg = &context{ + req: &http.Request{ + Header: http.Header{ + ticketHeader: []string{ticket}, + }, + }, + apiURL: apiURL(), + } + + // TODO(dsymonds): Wire up the shutdown handler to do a final flush. + go ctxs.bg.logFlusher(make(chan int)) + + return toContext(ctxs.bg) +} + +// RegisterTestRequest registers the HTTP request req for testing, such that +// any API calls are sent to the provided URL. It returns a closure to delete +// the registration. +// It should only be used by aetest package. +func RegisterTestRequest(req *http.Request, apiURL *url.URL, decorate func(netcontext.Context) netcontext.Context) (*http.Request, func()) { + c := &context{ + req: req, + apiURL: apiURL, + } + ctxs.Lock() + defer ctxs.Unlock() + if _, ok := ctxs.m[req]; ok { + log.Panic("req already associated with context") + } + if _, ok := ctxs.dec[req]; ok { + log.Panic("req already associated with context") + } + if ctxs.dec == nil { + ctxs.dec = make(map[*http.Request]func(netcontext.Context) netcontext.Context) + } + ctxs.m[req] = c + ctxs.dec[req] = decorate + + return req, func() { + ctxs.Lock() + delete(ctxs.m, req) + delete(ctxs.dec, req) + ctxs.Unlock() + } +} + +var errTimeout = &CallError{ + Detail: "Deadline exceeded", + Code: int32(remotepb.RpcError_CANCELLED), + Timeout: true, +} + +func (c *context) Header() http.Header { return c.outHeader } + +// Copied from $GOROOT/src/pkg/net/http/transfer.go. Some response status +// codes do not permit a response body (nor response entity headers such as +// Content-Length, Content-Type, etc). +func bodyAllowedForStatus(status int) bool { + switch { + case status >= 100 && status <= 199: + return false + case status == 204: + return false + case status == 304: + return false + } + return true +} + +func (c *context) Write(b []byte) (int, error) { + if c.outCode == 0 { + c.WriteHeader(http.StatusOK) + } + if len(b) > 0 && !bodyAllowedForStatus(c.outCode) { + return 0, http.ErrBodyNotAllowed + } + c.outBody = append(c.outBody, b...) + return len(b), nil +} + +func (c *context) WriteHeader(code int) { + if c.outCode != 0 { + logf(c, 3, "WriteHeader called multiple times on request.") // error level + return + } + c.outCode = code +} + +func (c *context) post(body []byte, timeout time.Duration) (b []byte, err error) { + hreq := &http.Request{ + Method: "POST", + URL: c.apiURL, + Header: http.Header{ + apiEndpointHeader: apiEndpointHeaderValue, + apiMethodHeader: apiMethodHeaderValue, + apiContentType: apiContentTypeValue, + apiDeadlineHeader: []string{strconv.FormatFloat(timeout.Seconds(), 'f', -1, 64)}, + }, + Body: ioutil.NopCloser(bytes.NewReader(body)), + ContentLength: int64(len(body)), + Host: c.apiURL.Host, + } + if info := c.req.Header.Get(dapperHeader); info != "" { + hreq.Header.Set(dapperHeader, info) + } + if info := c.req.Header.Get(traceHeader); info != "" { + hreq.Header.Set(traceHeader, info) + } + + tr := apiHTTPClient.Transport.(*http.Transport) + + var timedOut int32 // atomic; set to 1 if timed out + t := time.AfterFunc(timeout, func() { + atomic.StoreInt32(&timedOut, 1) + tr.CancelRequest(hreq) + }) + defer t.Stop() + defer func() { + // Check if timeout was exceeded. + if atomic.LoadInt32(&timedOut) != 0 { + err = errTimeout + } + }() + + hresp, err := apiHTTPClient.Do(hreq) + if err != nil { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge HTTP failed: %v", err), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + defer hresp.Body.Close() + hrespBody, err := ioutil.ReadAll(hresp.Body) + if hresp.StatusCode != 200 { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge returned HTTP %d (%q)", hresp.StatusCode, hrespBody), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + if err != nil { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge response bad: %v", err), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + return hrespBody, nil +} + +func Call(ctx netcontext.Context, service, method string, in, out proto.Message) error { + if ns := NamespaceFromContext(ctx); ns != "" { + if fn, ok := NamespaceMods[service]; ok { + fn(in, ns) + } + } + + if f, ctx, ok := callOverrideFromContext(ctx); ok { + return f(ctx, service, method, in, out) + } + + // Handle already-done contexts quickly. + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + c := fromContext(ctx) + if c == nil { + // Give a good error message rather than a panic lower down. + return errNotAppEngineContext + } + + // Apply transaction modifications if we're in a transaction. + if t := transactionFromContext(ctx); t != nil { + if t.finished { + return errors.New("transaction context has expired") + } + applyTransaction(in, &t.transaction) + } + + // Default RPC timeout is 60s. + timeout := 60 * time.Second + if deadline, ok := ctx.Deadline(); ok { + timeout = deadline.Sub(time.Now()) + } + + data, err := proto.Marshal(in) + if err != nil { + return err + } + + ticket := c.req.Header.Get(ticketHeader) + // Use a test ticket under test environment. + if ticket == "" { + if appid := ctx.Value(&appIDOverrideKey); appid != nil { + ticket = appid.(string) + defaultTicketSuffix + } + } + // Fall back to use background ticket when the request ticket is not available in Flex or dev_appserver. + if ticket == "" { + ticket = DefaultTicket() + } + req := &remotepb.Request{ + ServiceName: &service, + Method: &method, + Request: data, + RequestId: &ticket, + } + hreqBody, err := proto.Marshal(req) + if err != nil { + return err + } + + hrespBody, err := c.post(hreqBody, timeout) + if err != nil { + return err + } + + res := &remotepb.Response{} + if err := proto.Unmarshal(hrespBody, res); err != nil { + return err + } + if res.RpcError != nil { + ce := &CallError{ + Detail: res.RpcError.GetDetail(), + Code: *res.RpcError.Code, + } + switch remotepb.RpcError_ErrorCode(ce.Code) { + case remotepb.RpcError_CANCELLED, remotepb.RpcError_DEADLINE_EXCEEDED: + ce.Timeout = true + } + return ce + } + if res.ApplicationError != nil { + return &APIError{ + Service: *req.ServiceName, + Detail: res.ApplicationError.GetDetail(), + Code: *res.ApplicationError.Code, + } + } + if res.Exception != nil || res.JavaException != nil { + // This shouldn't happen, but let's be defensive. + return &CallError{ + Detail: "service bridge returned exception", + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + return proto.Unmarshal(res.Response, out) +} + +func (c *context) Request() *http.Request { + return c.req +} + +func (c *context) addLogLine(ll *logpb.UserAppLogLine) { + // Truncate long log lines. + // TODO(dsymonds): Check if this is still necessary. + const lim = 8 << 10 + if len(*ll.Message) > lim { + suffix := fmt.Sprintf("...(length %d)", len(*ll.Message)) + ll.Message = proto.String((*ll.Message)[:lim-len(suffix)] + suffix) + } + + c.pendingLogs.Lock() + c.pendingLogs.lines = append(c.pendingLogs.lines, ll) + c.pendingLogs.Unlock() +} + +var logLevelName = map[int64]string{ + 0: "DEBUG", + 1: "INFO", + 2: "WARNING", + 3: "ERROR", + 4: "CRITICAL", +} + +func logf(c *context, level int64, format string, args ...interface{}) { + if c == nil { + panic("not an App Engine context") + } + s := fmt.Sprintf(format, args...) + s = strings.TrimRight(s, "\n") // Remove any trailing newline characters. + c.addLogLine(&logpb.UserAppLogLine{ + TimestampUsec: proto.Int64(time.Now().UnixNano() / 1e3), + Level: &level, + Message: &s, + }) + log.Print(logLevelName[level] + ": " + s) +} + +// flushLog attempts to flush any pending logs to the appserver. +// It should not be called concurrently. +func (c *context) flushLog(force bool) (flushed bool) { + c.pendingLogs.Lock() + // Grab up to 30 MB. We can get away with up to 32 MB, but let's be cautious. + n, rem := 0, 30<<20 + for ; n < len(c.pendingLogs.lines); n++ { + ll := c.pendingLogs.lines[n] + // Each log line will require about 3 bytes of overhead. + nb := proto.Size(ll) + 3 + if nb > rem { + break + } + rem -= nb + } + lines := c.pendingLogs.lines[:n] + c.pendingLogs.lines = c.pendingLogs.lines[n:] + c.pendingLogs.Unlock() + + if len(lines) == 0 && !force { + // Nothing to flush. + return false + } + + rescueLogs := false + defer func() { + if rescueLogs { + c.pendingLogs.Lock() + c.pendingLogs.lines = append(lines, c.pendingLogs.lines...) + c.pendingLogs.Unlock() + } + }() + + buf, err := proto.Marshal(&logpb.UserAppLogGroup{ + LogLine: lines, + }) + if err != nil { + log.Printf("internal.flushLog: marshaling UserAppLogGroup: %v", err) + rescueLogs = true + return false + } + + req := &logpb.FlushRequest{ + Logs: buf, + } + res := &basepb.VoidProto{} + c.pendingLogs.Lock() + c.pendingLogs.flushes++ + c.pendingLogs.Unlock() + if err := Call(toContext(c), "logservice", "Flush", req, res); err != nil { + log.Printf("internal.flushLog: Flush RPC: %v", err) + rescueLogs = true + return false + } + return true +} + +const ( + // Log flushing parameters. + flushInterval = 1 * time.Second + forceFlushInterval = 60 * time.Second +) + +func (c *context) logFlusher(stop <-chan int) { + lastFlush := time.Now() + tick := time.NewTicker(flushInterval) + for { + select { + case <-stop: + // Request finished. + tick.Stop() + return + case <-tick.C: + force := time.Now().Sub(lastFlush) > forceFlushInterval + if c.flushLog(force) { + lastFlush = time.Now() + } + } + } +} + +func ContextForTesting(req *http.Request) netcontext.Context { + return toContext(&context{req: req}) +} diff --git a/vendor/google.golang.org/appengine/internal/base/api_base.pb.go b/vendor/google.golang.org/appengine/internal/base/api_base.pb.go index 36a195650a..6205a7aee5 100644 --- a/vendor/google.golang.org/appengine/internal/base/api_base.pb.go +++ b/vendor/google.golang.org/appengine/internal/base/api_base.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: google.golang.org/appengine/internal/base/api_base.proto -// DO NOT EDIT! /* Package base is a generated protocol buffer package. @@ -28,14 +27,21 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type StringProto struct { Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *StringProto) Reset() { *m = StringProto{} } -func (m *StringProto) String() string { return proto.CompactTextString(m) } -func (*StringProto) ProtoMessage() {} +func (m *StringProto) Reset() { *m = StringProto{} } +func (m *StringProto) String() string { return proto.CompactTextString(m) } +func (*StringProto) ProtoMessage() {} +func (*StringProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *StringProto) GetValue() string { if m != nil && m.Value != nil { @@ -49,9 +55,10 @@ type Integer32Proto struct { XXX_unrecognized []byte `json:"-"` } -func (m *Integer32Proto) Reset() { *m = Integer32Proto{} } -func (m *Integer32Proto) String() string { return proto.CompactTextString(m) } -func (*Integer32Proto) ProtoMessage() {} +func (m *Integer32Proto) Reset() { *m = Integer32Proto{} } +func (m *Integer32Proto) String() string { return proto.CompactTextString(m) } +func (*Integer32Proto) ProtoMessage() {} +func (*Integer32Proto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Integer32Proto) GetValue() int32 { if m != nil && m.Value != nil { @@ -65,9 +72,10 @@ type Integer64Proto struct { XXX_unrecognized []byte `json:"-"` } -func (m *Integer64Proto) Reset() { *m = Integer64Proto{} } -func (m *Integer64Proto) String() string { return proto.CompactTextString(m) } -func (*Integer64Proto) ProtoMessage() {} +func (m *Integer64Proto) Reset() { *m = Integer64Proto{} } +func (m *Integer64Proto) String() string { return proto.CompactTextString(m) } +func (*Integer64Proto) ProtoMessage() {} +func (*Integer64Proto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *Integer64Proto) GetValue() int64 { if m != nil && m.Value != nil { @@ -81,9 +89,10 @@ type BoolProto struct { XXX_unrecognized []byte `json:"-"` } -func (m *BoolProto) Reset() { *m = BoolProto{} } -func (m *BoolProto) String() string { return proto.CompactTextString(m) } -func (*BoolProto) ProtoMessage() {} +func (m *BoolProto) Reset() { *m = BoolProto{} } +func (m *BoolProto) String() string { return proto.CompactTextString(m) } +func (*BoolProto) ProtoMessage() {} +func (*BoolProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *BoolProto) GetValue() bool { if m != nil && m.Value != nil { @@ -97,9 +106,10 @@ type DoubleProto struct { XXX_unrecognized []byte `json:"-"` } -func (m *DoubleProto) Reset() { *m = DoubleProto{} } -func (m *DoubleProto) String() string { return proto.CompactTextString(m) } -func (*DoubleProto) ProtoMessage() {} +func (m *DoubleProto) Reset() { *m = DoubleProto{} } +func (m *DoubleProto) String() string { return proto.CompactTextString(m) } +func (*DoubleProto) ProtoMessage() {} +func (*DoubleProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *DoubleProto) GetValue() float64 { if m != nil && m.Value != nil { @@ -113,9 +123,10 @@ type BytesProto struct { XXX_unrecognized []byte `json:"-"` } -func (m *BytesProto) Reset() { *m = BytesProto{} } -func (m *BytesProto) String() string { return proto.CompactTextString(m) } -func (*BytesProto) ProtoMessage() {} +func (m *BytesProto) Reset() { *m = BytesProto{} } +func (m *BytesProto) String() string { return proto.CompactTextString(m) } +func (*BytesProto) ProtoMessage() {} +func (*BytesProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *BytesProto) GetValue() []byte { if m != nil { @@ -128,6 +139,38 @@ type VoidProto struct { XXX_unrecognized []byte `json:"-"` } -func (m *VoidProto) Reset() { *m = VoidProto{} } -func (m *VoidProto) String() string { return proto.CompactTextString(m) } -func (*VoidProto) ProtoMessage() {} +func (m *VoidProto) Reset() { *m = VoidProto{} } +func (m *VoidProto) String() string { return proto.CompactTextString(m) } +func (*VoidProto) ProtoMessage() {} +func (*VoidProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func init() { + proto.RegisterType((*StringProto)(nil), "appengine.base.StringProto") + proto.RegisterType((*Integer32Proto)(nil), "appengine.base.Integer32Proto") + proto.RegisterType((*Integer64Proto)(nil), "appengine.base.Integer64Proto") + proto.RegisterType((*BoolProto)(nil), "appengine.base.BoolProto") + proto.RegisterType((*DoubleProto)(nil), "appengine.base.DoubleProto") + proto.RegisterType((*BytesProto)(nil), "appengine.base.BytesProto") + proto.RegisterType((*VoidProto)(nil), "appengine.base.VoidProto") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/base/api_base.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 199 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xcf, 0x3f, 0x4b, 0xc6, 0x30, + 0x10, 0x06, 0x70, 0x5a, 0xad, 0xb4, 0x57, 0xe9, 0x20, 0x0e, 0x1d, 0xb5, 0x05, 0x71, 0x4a, 0x40, + 0x45, 0x9c, 0x83, 0x8b, 0x9b, 0x28, 0x38, 0xb8, 0x48, 0x8a, 0xc7, 0x11, 0x08, 0xb9, 0x90, 0xa6, + 0x82, 0xdf, 0x5e, 0xda, 0xd2, 0xfa, 0xc2, 0x9b, 0xed, 0xfe, 0xfc, 0xe0, 0xe1, 0x81, 0x27, 0x62, + 0x26, 0x8b, 0x82, 0xd8, 0x6a, 0x47, 0x82, 0x03, 0x49, 0xed, 0x3d, 0x3a, 0x32, 0x0e, 0xa5, 0x71, + 0x11, 0x83, 0xd3, 0x56, 0x0e, 0x7a, 0x44, 0xa9, 0xbd, 0xf9, 0x9a, 0x07, 0xe1, 0x03, 0x47, 0xbe, + 0x68, 0x76, 0x27, 0xe6, 0x6b, 0xd7, 0x43, 0xfd, 0x1e, 0x83, 0x71, 0xf4, 0xba, 0xbc, 0x2f, 0xa1, + 0xf8, 0xd1, 0x76, 0xc2, 0x36, 0xbb, 0xca, 0x6f, 0xab, 0xb7, 0x75, 0xe9, 0x6e, 0xa0, 0x79, 0x71, + 0x11, 0x09, 0xc3, 0xfd, 0x5d, 0xc2, 0x15, 0xc7, 0xee, 0xf1, 0x21, 0xe1, 0x4e, 0x36, 0x77, 0x0d, + 0x95, 0x62, 0xb6, 0x09, 0x52, 0x6e, 0xa4, 0x87, 0xfa, 0x99, 0xa7, 0xc1, 0x62, 0x02, 0x65, 0xff, + 0x79, 0xa0, 0x7e, 0x23, 0x8e, 0xab, 0x69, 0x0f, 0xcd, 0xb9, 0xca, 0xcb, 0xdd, 0xd5, 0x50, 0x7d, + 0xb0, 0xf9, 0x5e, 0x98, 0x3a, 0xfb, 0x3c, 0x9d, 0x9b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xba, + 0x37, 0x25, 0xea, 0x44, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go b/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go index 8613cb7311..393342c131 100644 --- a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go +++ b/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: google.golang.org/appengine/internal/datastore/datastore_v3.proto -// DO NOT EDIT! /* Package datastore is a generated protocol buffer package. @@ -59,6 +58,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type Property_Meaning int32 const ( @@ -145,6 +150,7 @@ func (x *Property_Meaning) UnmarshalJSON(data []byte) error { *x = Property_Meaning(value) return nil } +func (Property_Meaning) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } type Property_FtsTokenizationOption int32 @@ -178,6 +184,9 @@ func (x *Property_FtsTokenizationOption) UnmarshalJSON(data []byte) error { *x = Property_FtsTokenizationOption(value) return nil } +func (Property_FtsTokenizationOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 1} +} type EntityProto_Kind int32 @@ -214,6 +223,7 @@ func (x *EntityProto_Kind) UnmarshalJSON(data []byte) error { *x = EntityProto_Kind(value) return nil } +func (EntityProto_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } type Index_Property_Direction int32 @@ -247,6 +257,9 @@ func (x *Index_Property_Direction) UnmarshalJSON(data []byte) error { *x = Index_Property_Direction(value) return nil } +func (Index_Property_Direction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0, 0} +} type CompositeIndex_State int32 @@ -286,6 +299,7 @@ func (x *CompositeIndex_State) UnmarshalJSON(data []byte) error { *x = CompositeIndex_State(value) return nil } +func (CompositeIndex_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 0} } type Snapshot_Status int32 @@ -319,6 +333,7 @@ func (x *Snapshot_Status) UnmarshalJSON(data []byte) error { *x = Snapshot_Status(value) return nil } +func (Snapshot_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{12, 0} } type Query_Hint int32 @@ -355,6 +370,7 @@ func (x *Query_Hint) UnmarshalJSON(data []byte) error { *x = Query_Hint(value) return nil } +func (Query_Hint) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0} } type Query_Filter_Operator int32 @@ -403,6 +419,7 @@ func (x *Query_Filter_Operator) UnmarshalJSON(data []byte) error { *x = Query_Filter_Operator(value) return nil } +func (Query_Filter_Operator) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0, 0} } type Query_Order_Direction int32 @@ -436,6 +453,7 @@ func (x *Query_Order_Direction) UnmarshalJSON(data []byte) error { *x = Query_Order_Direction(value) return nil } +func (Query_Order_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 1, 0} } type Error_ErrorCode int32 @@ -496,6 +514,7 @@ func (x *Error_ErrorCode) UnmarshalJSON(data []byte) error { *x = Error_ErrorCode(value) return nil } +func (Error_ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{19, 0} } type PutRequest_AutoIdPolicy int32 @@ -529,29 +548,71 @@ func (x *PutRequest_AutoIdPolicy) UnmarshalJSON(data []byte) error { *x = PutRequest_AutoIdPolicy(value) return nil } +func (PutRequest_AutoIdPolicy) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{23, 0} } + +type BeginTransactionRequest_TransactionMode int32 + +const ( + BeginTransactionRequest_UNKNOWN BeginTransactionRequest_TransactionMode = 0 + BeginTransactionRequest_READ_ONLY BeginTransactionRequest_TransactionMode = 1 + BeginTransactionRequest_READ_WRITE BeginTransactionRequest_TransactionMode = 2 +) + +var BeginTransactionRequest_TransactionMode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "READ_ONLY", + 2: "READ_WRITE", +} +var BeginTransactionRequest_TransactionMode_value = map[string]int32{ + "UNKNOWN": 0, + "READ_ONLY": 1, + "READ_WRITE": 2, +} + +func (x BeginTransactionRequest_TransactionMode) Enum() *BeginTransactionRequest_TransactionMode { + p := new(BeginTransactionRequest_TransactionMode) + *p = x + return p +} +func (x BeginTransactionRequest_TransactionMode) String() string { + return proto.EnumName(BeginTransactionRequest_TransactionMode_name, int32(x)) +} +func (x *BeginTransactionRequest_TransactionMode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(BeginTransactionRequest_TransactionMode_value, data, "BeginTransactionRequest_TransactionMode") + if err != nil { + return err + } + *x = BeginTransactionRequest_TransactionMode(value) + return nil +} +func (BeginTransactionRequest_TransactionMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{36, 0} +} type Action struct { XXX_unrecognized []byte `json:"-"` } -func (m *Action) Reset() { *m = Action{} } -func (m *Action) String() string { return proto.CompactTextString(m) } -func (*Action) ProtoMessage() {} +func (m *Action) Reset() { *m = Action{} } +func (m *Action) String() string { return proto.CompactTextString(m) } +func (*Action) ProtoMessage() {} +func (*Action) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type PropertyValue struct { Int64Value *int64 `protobuf:"varint,1,opt,name=int64Value" json:"int64Value,omitempty"` BooleanValue *bool `protobuf:"varint,2,opt,name=booleanValue" json:"booleanValue,omitempty"` StringValue *string `protobuf:"bytes,3,opt,name=stringValue" json:"stringValue,omitempty"` DoubleValue *float64 `protobuf:"fixed64,4,opt,name=doubleValue" json:"doubleValue,omitempty"` - Pointvalue *PropertyValue_PointValue `protobuf:"group,5,opt,name=PointValue" json:"pointvalue,omitempty"` - Uservalue *PropertyValue_UserValue `protobuf:"group,8,opt,name=UserValue" json:"uservalue,omitempty"` - Referencevalue *PropertyValue_ReferenceValue `protobuf:"group,12,opt,name=ReferenceValue" json:"referencevalue,omitempty"` + Pointvalue *PropertyValue_PointValue `protobuf:"group,5,opt,name=PointValue,json=pointvalue" json:"pointvalue,omitempty"` + Uservalue *PropertyValue_UserValue `protobuf:"group,8,opt,name=UserValue,json=uservalue" json:"uservalue,omitempty"` + Referencevalue *PropertyValue_ReferenceValue `protobuf:"group,12,opt,name=ReferenceValue,json=referencevalue" json:"referencevalue,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *PropertyValue) Reset() { *m = PropertyValue{} } -func (m *PropertyValue) String() string { return proto.CompactTextString(m) } -func (*PropertyValue) ProtoMessage() {} +func (m *PropertyValue) Reset() { *m = PropertyValue{} } +func (m *PropertyValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue) ProtoMessage() {} +func (*PropertyValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *PropertyValue) GetInt64Value() int64 { if m != nil && m.Int64Value != nil { @@ -608,9 +669,10 @@ type PropertyValue_PointValue struct { XXX_unrecognized []byte `json:"-"` } -func (m *PropertyValue_PointValue) Reset() { *m = PropertyValue_PointValue{} } -func (m *PropertyValue_PointValue) String() string { return proto.CompactTextString(m) } -func (*PropertyValue_PointValue) ProtoMessage() {} +func (m *PropertyValue_PointValue) Reset() { *m = PropertyValue_PointValue{} } +func (m *PropertyValue_PointValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_PointValue) ProtoMessage() {} +func (*PropertyValue_PointValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } func (m *PropertyValue_PointValue) GetX() float64 { if m != nil && m.X != nil { @@ -628,16 +690,17 @@ func (m *PropertyValue_PointValue) GetY() float64 { type PropertyValue_UserValue struct { Email *string `protobuf:"bytes,9,req,name=email" json:"email,omitempty"` - AuthDomain *string `protobuf:"bytes,10,req,name=auth_domain" json:"auth_domain,omitempty"` + AuthDomain *string `protobuf:"bytes,10,req,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"` Nickname *string `protobuf:"bytes,11,opt,name=nickname" json:"nickname,omitempty"` - FederatedIdentity *string `protobuf:"bytes,21,opt,name=federated_identity" json:"federated_identity,omitempty"` - FederatedProvider *string `protobuf:"bytes,22,opt,name=federated_provider" json:"federated_provider,omitempty"` + FederatedIdentity *string `protobuf:"bytes,21,opt,name=federated_identity,json=federatedIdentity" json:"federated_identity,omitempty"` + FederatedProvider *string `protobuf:"bytes,22,opt,name=federated_provider,json=federatedProvider" json:"federated_provider,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *PropertyValue_UserValue) Reset() { *m = PropertyValue_UserValue{} } -func (m *PropertyValue_UserValue) String() string { return proto.CompactTextString(m) } -func (*PropertyValue_UserValue) ProtoMessage() {} +func (m *PropertyValue_UserValue) Reset() { *m = PropertyValue_UserValue{} } +func (m *PropertyValue_UserValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_UserValue) ProtoMessage() {} +func (*PropertyValue_UserValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 1} } func (m *PropertyValue_UserValue) GetEmail() string { if m != nil && m.Email != nil { @@ -676,14 +739,15 @@ func (m *PropertyValue_UserValue) GetFederatedProvider() string { type PropertyValue_ReferenceValue struct { App *string `protobuf:"bytes,13,req,name=app" json:"app,omitempty"` - NameSpace *string `protobuf:"bytes,20,opt,name=name_space" json:"name_space,omitempty"` - Pathelement []*PropertyValue_ReferenceValue_PathElement `protobuf:"group,14,rep,name=PathElement" json:"pathelement,omitempty"` + NameSpace *string `protobuf:"bytes,20,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` + Pathelement []*PropertyValue_ReferenceValue_PathElement `protobuf:"group,14,rep,name=PathElement,json=pathelement" json:"pathelement,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *PropertyValue_ReferenceValue) Reset() { *m = PropertyValue_ReferenceValue{} } -func (m *PropertyValue_ReferenceValue) String() string { return proto.CompactTextString(m) } -func (*PropertyValue_ReferenceValue) ProtoMessage() {} +func (m *PropertyValue_ReferenceValue) Reset() { *m = PropertyValue_ReferenceValue{} } +func (m *PropertyValue_ReferenceValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_ReferenceValue) ProtoMessage() {} +func (*PropertyValue_ReferenceValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 2} } func (m *PropertyValue_ReferenceValue) GetApp() string { if m != nil && m.App != nil { @@ -718,6 +782,9 @@ func (m *PropertyValue_ReferenceValue_PathElement) Reset() { } func (m *PropertyValue_ReferenceValue_PathElement) String() string { return proto.CompactTextString(m) } func (*PropertyValue_ReferenceValue_PathElement) ProtoMessage() {} +func (*PropertyValue_ReferenceValue_PathElement) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 2, 0} +} func (m *PropertyValue_ReferenceValue_PathElement) GetType() string { if m != nil && m.Type != nil { @@ -742,19 +809,20 @@ func (m *PropertyValue_ReferenceValue_PathElement) GetName() string { type Property struct { Meaning *Property_Meaning `protobuf:"varint,1,opt,name=meaning,enum=appengine.Property_Meaning,def=0" json:"meaning,omitempty"` - MeaningUri *string `protobuf:"bytes,2,opt,name=meaning_uri" json:"meaning_uri,omitempty"` + MeaningUri *string `protobuf:"bytes,2,opt,name=meaning_uri,json=meaningUri" json:"meaning_uri,omitempty"` Name *string `protobuf:"bytes,3,req,name=name" json:"name,omitempty"` Value *PropertyValue `protobuf:"bytes,5,req,name=value" json:"value,omitempty"` Multiple *bool `protobuf:"varint,4,req,name=multiple" json:"multiple,omitempty"` Searchable *bool `protobuf:"varint,6,opt,name=searchable,def=0" json:"searchable,omitempty"` - FtsTokenizationOption *Property_FtsTokenizationOption `protobuf:"varint,8,opt,name=fts_tokenization_option,enum=appengine.Property_FtsTokenizationOption" json:"fts_tokenization_option,omitempty"` + FtsTokenizationOption *Property_FtsTokenizationOption `protobuf:"varint,8,opt,name=fts_tokenization_option,json=ftsTokenizationOption,enum=appengine.Property_FtsTokenizationOption" json:"fts_tokenization_option,omitempty"` Locale *string `protobuf:"bytes,9,opt,name=locale,def=en" json:"locale,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Property) Reset() { *m = Property{} } -func (m *Property) String() string { return proto.CompactTextString(m) } -func (*Property) ProtoMessage() {} +func (m *Property) Reset() { *m = Property{} } +func (m *Property) String() string { return proto.CompactTextString(m) } +func (*Property) ProtoMessage() {} +func (*Property) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } const Default_Property_Meaning Property_Meaning = Property_NO_MEANING const Default_Property_Searchable bool = false @@ -817,13 +885,14 @@ func (m *Property) GetLocale() string { } type Path struct { - Element []*Path_Element `protobuf:"group,1,rep,name=Element" json:"element,omitempty"` + Element []*Path_Element `protobuf:"group,1,rep,name=Element,json=element" json:"element,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Path) Reset() { *m = Path{} } -func (m *Path) String() string { return proto.CompactTextString(m) } -func (*Path) ProtoMessage() {} +func (m *Path) Reset() { *m = Path{} } +func (m *Path) String() string { return proto.CompactTextString(m) } +func (*Path) ProtoMessage() {} +func (*Path) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *Path) GetElement() []*Path_Element { if m != nil { @@ -839,9 +908,10 @@ type Path_Element struct { XXX_unrecognized []byte `json:"-"` } -func (m *Path_Element) Reset() { *m = Path_Element{} } -func (m *Path_Element) String() string { return proto.CompactTextString(m) } -func (*Path_Element) ProtoMessage() {} +func (m *Path_Element) Reset() { *m = Path_Element{} } +func (m *Path_Element) String() string { return proto.CompactTextString(m) } +func (*Path_Element) ProtoMessage() {} +func (*Path_Element) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } func (m *Path_Element) GetType() string { if m != nil && m.Type != nil { @@ -866,14 +936,15 @@ func (m *Path_Element) GetName() string { type Reference struct { App *string `protobuf:"bytes,13,req,name=app" json:"app,omitempty"` - NameSpace *string `protobuf:"bytes,20,opt,name=name_space" json:"name_space,omitempty"` + NameSpace *string `protobuf:"bytes,20,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` Path *Path `protobuf:"bytes,14,req,name=path" json:"path,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Reference) Reset() { *m = Reference{} } -func (m *Reference) String() string { return proto.CompactTextString(m) } -func (*Reference) ProtoMessage() {} +func (m *Reference) Reset() { *m = Reference{} } +func (m *Reference) String() string { return proto.CompactTextString(m) } +func (*Reference) ProtoMessage() {} +func (*Reference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *Reference) GetApp() string { if m != nil && m.App != nil { @@ -898,16 +969,17 @@ func (m *Reference) GetPath() *Path { type User struct { Email *string `protobuf:"bytes,1,req,name=email" json:"email,omitempty"` - AuthDomain *string `protobuf:"bytes,2,req,name=auth_domain" json:"auth_domain,omitempty"` + AuthDomain *string `protobuf:"bytes,2,req,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"` Nickname *string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"` - FederatedIdentity *string `protobuf:"bytes,6,opt,name=federated_identity" json:"federated_identity,omitempty"` - FederatedProvider *string `protobuf:"bytes,7,opt,name=federated_provider" json:"federated_provider,omitempty"` + FederatedIdentity *string `protobuf:"bytes,6,opt,name=federated_identity,json=federatedIdentity" json:"federated_identity,omitempty"` + FederatedProvider *string `protobuf:"bytes,7,opt,name=federated_provider,json=federatedProvider" json:"federated_provider,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *User) GetEmail() string { if m != nil && m.Email != nil { @@ -946,19 +1018,20 @@ func (m *User) GetFederatedProvider() string { type EntityProto struct { Key *Reference `protobuf:"bytes,13,req,name=key" json:"key,omitempty"` - EntityGroup *Path `protobuf:"bytes,16,req,name=entity_group" json:"entity_group,omitempty"` + EntityGroup *Path `protobuf:"bytes,16,req,name=entity_group,json=entityGroup" json:"entity_group,omitempty"` Owner *User `protobuf:"bytes,17,opt,name=owner" json:"owner,omitempty"` Kind *EntityProto_Kind `protobuf:"varint,4,opt,name=kind,enum=appengine.EntityProto_Kind" json:"kind,omitempty"` - KindUri *string `protobuf:"bytes,5,opt,name=kind_uri" json:"kind_uri,omitempty"` + KindUri *string `protobuf:"bytes,5,opt,name=kind_uri,json=kindUri" json:"kind_uri,omitempty"` Property []*Property `protobuf:"bytes,14,rep,name=property" json:"property,omitempty"` - RawProperty []*Property `protobuf:"bytes,15,rep,name=raw_property" json:"raw_property,omitempty"` + RawProperty []*Property `protobuf:"bytes,15,rep,name=raw_property,json=rawProperty" json:"raw_property,omitempty"` Rank *int32 `protobuf:"varint,18,opt,name=rank" json:"rank,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *EntityProto) Reset() { *m = EntityProto{} } -func (m *EntityProto) String() string { return proto.CompactTextString(m) } -func (*EntityProto) ProtoMessage() {} +func (m *EntityProto) Reset() { *m = EntityProto{} } +func (m *EntityProto) String() string { return proto.CompactTextString(m) } +func (*EntityProto) ProtoMessage() {} +func (*EntityProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *EntityProto) GetKey() *Reference { if m != nil { @@ -1017,14 +1090,15 @@ func (m *EntityProto) GetRank() int32 { } type CompositeProperty struct { - IndexId *int64 `protobuf:"varint,1,req,name=index_id" json:"index_id,omitempty"` + IndexId *int64 `protobuf:"varint,1,req,name=index_id,json=indexId" json:"index_id,omitempty"` Value []string `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompositeProperty) Reset() { *m = CompositeProperty{} } -func (m *CompositeProperty) String() string { return proto.CompactTextString(m) } -func (*CompositeProperty) ProtoMessage() {} +func (m *CompositeProperty) Reset() { *m = CompositeProperty{} } +func (m *CompositeProperty) String() string { return proto.CompactTextString(m) } +func (*CompositeProperty) ProtoMessage() {} +func (*CompositeProperty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *CompositeProperty) GetIndexId() int64 { if m != nil && m.IndexId != nil { @@ -1041,15 +1115,16 @@ func (m *CompositeProperty) GetValue() []string { } type Index struct { - EntityType *string `protobuf:"bytes,1,req,name=entity_type" json:"entity_type,omitempty"` + EntityType *string `protobuf:"bytes,1,req,name=entity_type,json=entityType" json:"entity_type,omitempty"` Ancestor *bool `protobuf:"varint,5,req,name=ancestor" json:"ancestor,omitempty"` - Property []*Index_Property `protobuf:"group,2,rep,name=Property" json:"property,omitempty"` + Property []*Index_Property `protobuf:"group,2,rep,name=Property,json=property" json:"property,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Index) Reset() { *m = Index{} } -func (m *Index) String() string { return proto.CompactTextString(m) } -func (*Index) ProtoMessage() {} +func (m *Index) Reset() { *m = Index{} } +func (m *Index) String() string { return proto.CompactTextString(m) } +func (*Index) ProtoMessage() {} +func (*Index) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *Index) GetEntityType() string { if m != nil && m.EntityType != nil { @@ -1078,9 +1153,10 @@ type Index_Property struct { XXX_unrecognized []byte `json:"-"` } -func (m *Index_Property) Reset() { *m = Index_Property{} } -func (m *Index_Property) String() string { return proto.CompactTextString(m) } -func (*Index_Property) ProtoMessage() {} +func (m *Index_Property) Reset() { *m = Index_Property{} } +func (m *Index_Property) String() string { return proto.CompactTextString(m) } +func (*Index_Property) ProtoMessage() {} +func (*Index_Property) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8, 0} } const Default_Index_Property_Direction Index_Property_Direction = Index_Property_ASCENDING @@ -1099,17 +1175,18 @@ func (m *Index_Property) GetDirection() Index_Property_Direction { } type CompositeIndex struct { - AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` Id *int64 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` Definition *Index `protobuf:"bytes,3,req,name=definition" json:"definition,omitempty"` State *CompositeIndex_State `protobuf:"varint,4,req,name=state,enum=appengine.CompositeIndex_State" json:"state,omitempty"` - OnlyUseIfRequired *bool `protobuf:"varint,6,opt,name=only_use_if_required,def=0" json:"only_use_if_required,omitempty"` + OnlyUseIfRequired *bool `protobuf:"varint,6,opt,name=only_use_if_required,json=onlyUseIfRequired,def=0" json:"only_use_if_required,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompositeIndex) Reset() { *m = CompositeIndex{} } -func (m *CompositeIndex) String() string { return proto.CompactTextString(m) } -func (*CompositeIndex) ProtoMessage() {} +func (m *CompositeIndex) Reset() { *m = CompositeIndex{} } +func (m *CompositeIndex) String() string { return proto.CompactTextString(m) } +func (*CompositeIndex) ProtoMessage() {} +func (*CompositeIndex) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } const Default_CompositeIndex_OnlyUseIfRequired bool = false @@ -1149,15 +1226,16 @@ func (m *CompositeIndex) GetOnlyUseIfRequired() bool { } type IndexPostfix struct { - IndexValue []*IndexPostfix_IndexValue `protobuf:"bytes,1,rep,name=index_value" json:"index_value,omitempty"` + IndexValue []*IndexPostfix_IndexValue `protobuf:"bytes,1,rep,name=index_value,json=indexValue" json:"index_value,omitempty"` Key *Reference `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` Before *bool `protobuf:"varint,3,opt,name=before,def=1" json:"before,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *IndexPostfix) Reset() { *m = IndexPostfix{} } -func (m *IndexPostfix) String() string { return proto.CompactTextString(m) } -func (*IndexPostfix) ProtoMessage() {} +func (m *IndexPostfix) Reset() { *m = IndexPostfix{} } +func (m *IndexPostfix) String() string { return proto.CompactTextString(m) } +func (*IndexPostfix) ProtoMessage() {} +func (*IndexPostfix) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } const Default_IndexPostfix_Before bool = true @@ -1183,14 +1261,15 @@ func (m *IndexPostfix) GetBefore() bool { } type IndexPostfix_IndexValue struct { - PropertyName *string `protobuf:"bytes,1,req,name=property_name" json:"property_name,omitempty"` + PropertyName *string `protobuf:"bytes,1,req,name=property_name,json=propertyName" json:"property_name,omitempty"` Value *PropertyValue `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *IndexPostfix_IndexValue) Reset() { *m = IndexPostfix_IndexValue{} } -func (m *IndexPostfix_IndexValue) String() string { return proto.CompactTextString(m) } -func (*IndexPostfix_IndexValue) ProtoMessage() {} +func (m *IndexPostfix_IndexValue) Reset() { *m = IndexPostfix_IndexValue{} } +func (m *IndexPostfix_IndexValue) String() string { return proto.CompactTextString(m) } +func (*IndexPostfix_IndexValue) ProtoMessage() {} +func (*IndexPostfix_IndexValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } func (m *IndexPostfix_IndexValue) GetPropertyName() string { if m != nil && m.PropertyName != nil { @@ -1212,9 +1291,10 @@ type IndexPosition struct { XXX_unrecognized []byte `json:"-"` } -func (m *IndexPosition) Reset() { *m = IndexPosition{} } -func (m *IndexPosition) String() string { return proto.CompactTextString(m) } -func (*IndexPosition) ProtoMessage() {} +func (m *IndexPosition) Reset() { *m = IndexPosition{} } +func (m *IndexPosition) String() string { return proto.CompactTextString(m) } +func (*IndexPosition) ProtoMessage() {} +func (*IndexPosition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } const Default_IndexPosition_Before bool = true @@ -1237,9 +1317,10 @@ type Snapshot struct { XXX_unrecognized []byte `json:"-"` } -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (m *Snapshot) String() string { return proto.CompactTextString(m) } -func (*Snapshot) ProtoMessage() {} +func (m *Snapshot) Reset() { *m = Snapshot{} } +func (m *Snapshot) String() string { return proto.CompactTextString(m) } +func (*Snapshot) ProtoMessage() {} +func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *Snapshot) GetTs() int64 { if m != nil && m.Ts != nil { @@ -1253,9 +1334,10 @@ type InternalHeader struct { XXX_unrecognized []byte `json:"-"` } -func (m *InternalHeader) Reset() { *m = InternalHeader{} } -func (m *InternalHeader) String() string { return proto.CompactTextString(m) } -func (*InternalHeader) ProtoMessage() {} +func (m *InternalHeader) Reset() { *m = InternalHeader{} } +func (m *InternalHeader) String() string { return proto.CompactTextString(m) } +func (*InternalHeader) ProtoMessage() {} +func (*InternalHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *InternalHeader) GetQos() string { if m != nil && m.Qos != nil { @@ -1268,13 +1350,14 @@ type Transaction struct { Header *InternalHeader `protobuf:"bytes,4,opt,name=header" json:"header,omitempty"` Handle *uint64 `protobuf:"fixed64,1,req,name=handle" json:"handle,omitempty"` App *string `protobuf:"bytes,2,req,name=app" json:"app,omitempty"` - MarkChanges *bool `protobuf:"varint,3,opt,name=mark_changes,def=0" json:"mark_changes,omitempty"` + MarkChanges *bool `protobuf:"varint,3,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Transaction) Reset() { *m = Transaction{} } -func (m *Transaction) String() string { return proto.CompactTextString(m) } -func (*Transaction) ProtoMessage() {} +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } const Default_Transaction_MarkChanges bool = false @@ -1309,37 +1392,38 @@ func (m *Transaction) GetMarkChanges() bool { type Query struct { Header *InternalHeader `protobuf:"bytes,39,opt,name=header" json:"header,omitempty"` App *string `protobuf:"bytes,1,req,name=app" json:"app,omitempty"` - NameSpace *string `protobuf:"bytes,29,opt,name=name_space" json:"name_space,omitempty"` + NameSpace *string `protobuf:"bytes,29,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` Kind *string `protobuf:"bytes,3,opt,name=kind" json:"kind,omitempty"` Ancestor *Reference `protobuf:"bytes,17,opt,name=ancestor" json:"ancestor,omitempty"` - Filter []*Query_Filter `protobuf:"group,4,rep,name=Filter" json:"filter,omitempty"` - SearchQuery *string `protobuf:"bytes,8,opt,name=search_query" json:"search_query,omitempty"` - Order []*Query_Order `protobuf:"group,9,rep,name=Order" json:"order,omitempty"` + Filter []*Query_Filter `protobuf:"group,4,rep,name=Filter,json=filter" json:"filter,omitempty"` + SearchQuery *string `protobuf:"bytes,8,opt,name=search_query,json=searchQuery" json:"search_query,omitempty"` + Order []*Query_Order `protobuf:"group,9,rep,name=Order,json=order" json:"order,omitempty"` Hint *Query_Hint `protobuf:"varint,18,opt,name=hint,enum=appengine.Query_Hint" json:"hint,omitempty"` Count *int32 `protobuf:"varint,23,opt,name=count" json:"count,omitempty"` Offset *int32 `protobuf:"varint,12,opt,name=offset,def=0" json:"offset,omitempty"` Limit *int32 `protobuf:"varint,16,opt,name=limit" json:"limit,omitempty"` - CompiledCursor *CompiledCursor `protobuf:"bytes,30,opt,name=compiled_cursor" json:"compiled_cursor,omitempty"` - EndCompiledCursor *CompiledCursor `protobuf:"bytes,31,opt,name=end_compiled_cursor" json:"end_compiled_cursor,omitempty"` - CompositeIndex []*CompositeIndex `protobuf:"bytes,19,rep,name=composite_index" json:"composite_index,omitempty"` - RequirePerfectPlan *bool `protobuf:"varint,20,opt,name=require_perfect_plan,def=0" json:"require_perfect_plan,omitempty"` - KeysOnly *bool `protobuf:"varint,21,opt,name=keys_only,def=0" json:"keys_only,omitempty"` + CompiledCursor *CompiledCursor `protobuf:"bytes,30,opt,name=compiled_cursor,json=compiledCursor" json:"compiled_cursor,omitempty"` + EndCompiledCursor *CompiledCursor `protobuf:"bytes,31,opt,name=end_compiled_cursor,json=endCompiledCursor" json:"end_compiled_cursor,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,19,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` + RequirePerfectPlan *bool `protobuf:"varint,20,opt,name=require_perfect_plan,json=requirePerfectPlan,def=0" json:"require_perfect_plan,omitempty"` + KeysOnly *bool `protobuf:"varint,21,opt,name=keys_only,json=keysOnly,def=0" json:"keys_only,omitempty"` Transaction *Transaction `protobuf:"bytes,22,opt,name=transaction" json:"transaction,omitempty"` Compile *bool `protobuf:"varint,25,opt,name=compile,def=0" json:"compile,omitempty"` - FailoverMs *int64 `protobuf:"varint,26,opt,name=failover_ms" json:"failover_ms,omitempty"` + FailoverMs *int64 `protobuf:"varint,26,opt,name=failover_ms,json=failoverMs" json:"failover_ms,omitempty"` Strong *bool `protobuf:"varint,32,opt,name=strong" json:"strong,omitempty"` - PropertyName []string `protobuf:"bytes,33,rep,name=property_name" json:"property_name,omitempty"` - GroupByPropertyName []string `protobuf:"bytes,34,rep,name=group_by_property_name" json:"group_by_property_name,omitempty"` + PropertyName []string `protobuf:"bytes,33,rep,name=property_name,json=propertyName" json:"property_name,omitempty"` + GroupByPropertyName []string `protobuf:"bytes,34,rep,name=group_by_property_name,json=groupByPropertyName" json:"group_by_property_name,omitempty"` Distinct *bool `protobuf:"varint,24,opt,name=distinct" json:"distinct,omitempty"` - MinSafeTimeSeconds *int64 `protobuf:"varint,35,opt,name=min_safe_time_seconds" json:"min_safe_time_seconds,omitempty"` - SafeReplicaName []string `protobuf:"bytes,36,rep,name=safe_replica_name" json:"safe_replica_name,omitempty"` - PersistOffset *bool `protobuf:"varint,37,opt,name=persist_offset,def=0" json:"persist_offset,omitempty"` + MinSafeTimeSeconds *int64 `protobuf:"varint,35,opt,name=min_safe_time_seconds,json=minSafeTimeSeconds" json:"min_safe_time_seconds,omitempty"` + SafeReplicaName []string `protobuf:"bytes,36,rep,name=safe_replica_name,json=safeReplicaName" json:"safe_replica_name,omitempty"` + PersistOffset *bool `protobuf:"varint,37,opt,name=persist_offset,json=persistOffset,def=0" json:"persist_offset,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto.CompactTextString(m) } +func (*Query) ProtoMessage() {} +func (*Query) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } const Default_Query_Offset int32 = 0 const Default_Query_RequirePerfectPlan bool = false @@ -1542,9 +1626,10 @@ type Query_Filter struct { XXX_unrecognized []byte `json:"-"` } -func (m *Query_Filter) Reset() { *m = Query_Filter{} } -func (m *Query_Filter) String() string { return proto.CompactTextString(m) } -func (*Query_Filter) ProtoMessage() {} +func (m *Query_Filter) Reset() { *m = Query_Filter{} } +func (m *Query_Filter) String() string { return proto.CompactTextString(m) } +func (*Query_Filter) ProtoMessage() {} +func (*Query_Filter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0} } func (m *Query_Filter) GetOp() Query_Filter_Operator { if m != nil && m.Op != nil { @@ -1566,9 +1651,10 @@ type Query_Order struct { XXX_unrecognized []byte `json:"-"` } -func (m *Query_Order) Reset() { *m = Query_Order{} } -func (m *Query_Order) String() string { return proto.CompactTextString(m) } -func (*Query_Order) ProtoMessage() {} +func (m *Query_Order) Reset() { *m = Query_Order{} } +func (m *Query_Order) String() string { return proto.CompactTextString(m) } +func (*Query_Order) ProtoMessage() {} +func (*Query_Order) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 1} } const Default_Query_Order_Direction Query_Order_Direction = Query_Order_ASCENDING @@ -1587,21 +1673,22 @@ func (m *Query_Order) GetDirection() Query_Order_Direction { } type CompiledQuery struct { - Primaryscan *CompiledQuery_PrimaryScan `protobuf:"group,1,req,name=PrimaryScan" json:"primaryscan,omitempty"` - Mergejoinscan []*CompiledQuery_MergeJoinScan `protobuf:"group,7,rep,name=MergeJoinScan" json:"mergejoinscan,omitempty"` - IndexDef *Index `protobuf:"bytes,21,opt,name=index_def" json:"index_def,omitempty"` + Primaryscan *CompiledQuery_PrimaryScan `protobuf:"group,1,req,name=PrimaryScan,json=primaryscan" json:"primaryscan,omitempty"` + Mergejoinscan []*CompiledQuery_MergeJoinScan `protobuf:"group,7,rep,name=MergeJoinScan,json=mergejoinscan" json:"mergejoinscan,omitempty"` + IndexDef *Index `protobuf:"bytes,21,opt,name=index_def,json=indexDef" json:"index_def,omitempty"` Offset *int32 `protobuf:"varint,10,opt,name=offset,def=0" json:"offset,omitempty"` Limit *int32 `protobuf:"varint,11,opt,name=limit" json:"limit,omitempty"` - KeysOnly *bool `protobuf:"varint,12,req,name=keys_only" json:"keys_only,omitempty"` - PropertyName []string `protobuf:"bytes,24,rep,name=property_name" json:"property_name,omitempty"` - DistinctInfixSize *int32 `protobuf:"varint,25,opt,name=distinct_infix_size" json:"distinct_infix_size,omitempty"` - Entityfilter *CompiledQuery_EntityFilter `protobuf:"group,13,opt,name=EntityFilter" json:"entityfilter,omitempty"` + KeysOnly *bool `protobuf:"varint,12,req,name=keys_only,json=keysOnly" json:"keys_only,omitempty"` + PropertyName []string `protobuf:"bytes,24,rep,name=property_name,json=propertyName" json:"property_name,omitempty"` + DistinctInfixSize *int32 `protobuf:"varint,25,opt,name=distinct_infix_size,json=distinctInfixSize" json:"distinct_infix_size,omitempty"` + Entityfilter *CompiledQuery_EntityFilter `protobuf:"group,13,opt,name=EntityFilter,json=entityfilter" json:"entityfilter,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompiledQuery) Reset() { *m = CompiledQuery{} } -func (m *CompiledQuery) String() string { return proto.CompactTextString(m) } -func (*CompiledQuery) ProtoMessage() {} +func (m *CompiledQuery) Reset() { *m = CompiledQuery{} } +func (m *CompiledQuery) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery) ProtoMessage() {} +func (*CompiledQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } const Default_CompiledQuery_Offset int32 = 0 @@ -1669,20 +1756,21 @@ func (m *CompiledQuery) GetEntityfilter() *CompiledQuery_EntityFilter { } type CompiledQuery_PrimaryScan struct { - IndexName *string `protobuf:"bytes,2,opt,name=index_name" json:"index_name,omitempty"` - StartKey *string `protobuf:"bytes,3,opt,name=start_key" json:"start_key,omitempty"` - StartInclusive *bool `protobuf:"varint,4,opt,name=start_inclusive" json:"start_inclusive,omitempty"` - EndKey *string `protobuf:"bytes,5,opt,name=end_key" json:"end_key,omitempty"` - EndInclusive *bool `protobuf:"varint,6,opt,name=end_inclusive" json:"end_inclusive,omitempty"` - StartPostfixValue []string `protobuf:"bytes,22,rep,name=start_postfix_value" json:"start_postfix_value,omitempty"` - EndPostfixValue []string `protobuf:"bytes,23,rep,name=end_postfix_value" json:"end_postfix_value,omitempty"` - EndUnappliedLogTimestampUs *int64 `protobuf:"varint,19,opt,name=end_unapplied_log_timestamp_us" json:"end_unapplied_log_timestamp_us,omitempty"` + IndexName *string `protobuf:"bytes,2,opt,name=index_name,json=indexName" json:"index_name,omitempty"` + StartKey *string `protobuf:"bytes,3,opt,name=start_key,json=startKey" json:"start_key,omitempty"` + StartInclusive *bool `protobuf:"varint,4,opt,name=start_inclusive,json=startInclusive" json:"start_inclusive,omitempty"` + EndKey *string `protobuf:"bytes,5,opt,name=end_key,json=endKey" json:"end_key,omitempty"` + EndInclusive *bool `protobuf:"varint,6,opt,name=end_inclusive,json=endInclusive" json:"end_inclusive,omitempty"` + StartPostfixValue []string `protobuf:"bytes,22,rep,name=start_postfix_value,json=startPostfixValue" json:"start_postfix_value,omitempty"` + EndPostfixValue []string `protobuf:"bytes,23,rep,name=end_postfix_value,json=endPostfixValue" json:"end_postfix_value,omitempty"` + EndUnappliedLogTimestampUs *int64 `protobuf:"varint,19,opt,name=end_unapplied_log_timestamp_us,json=endUnappliedLogTimestampUs" json:"end_unapplied_log_timestamp_us,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompiledQuery_PrimaryScan) Reset() { *m = CompiledQuery_PrimaryScan{} } -func (m *CompiledQuery_PrimaryScan) String() string { return proto.CompactTextString(m) } -func (*CompiledQuery_PrimaryScan) ProtoMessage() {} +func (m *CompiledQuery_PrimaryScan) Reset() { *m = CompiledQuery_PrimaryScan{} } +func (m *CompiledQuery_PrimaryScan) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_PrimaryScan) ProtoMessage() {} +func (*CompiledQuery_PrimaryScan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16, 0} } func (m *CompiledQuery_PrimaryScan) GetIndexName() string { if m != nil && m.IndexName != nil { @@ -1741,15 +1829,16 @@ func (m *CompiledQuery_PrimaryScan) GetEndUnappliedLogTimestampUs() int64 { } type CompiledQuery_MergeJoinScan struct { - IndexName *string `protobuf:"bytes,8,req,name=index_name" json:"index_name,omitempty"` - PrefixValue []string `protobuf:"bytes,9,rep,name=prefix_value" json:"prefix_value,omitempty"` - ValuePrefix *bool `protobuf:"varint,20,opt,name=value_prefix,def=0" json:"value_prefix,omitempty"` + IndexName *string `protobuf:"bytes,8,req,name=index_name,json=indexName" json:"index_name,omitempty"` + PrefixValue []string `protobuf:"bytes,9,rep,name=prefix_value,json=prefixValue" json:"prefix_value,omitempty"` + ValuePrefix *bool `protobuf:"varint,20,opt,name=value_prefix,json=valuePrefix,def=0" json:"value_prefix,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompiledQuery_MergeJoinScan) Reset() { *m = CompiledQuery_MergeJoinScan{} } -func (m *CompiledQuery_MergeJoinScan) String() string { return proto.CompactTextString(m) } -func (*CompiledQuery_MergeJoinScan) ProtoMessage() {} +func (m *CompiledQuery_MergeJoinScan) Reset() { *m = CompiledQuery_MergeJoinScan{} } +func (m *CompiledQuery_MergeJoinScan) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_MergeJoinScan) ProtoMessage() {} +func (*CompiledQuery_MergeJoinScan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16, 1} } const Default_CompiledQuery_MergeJoinScan_ValuePrefix bool = false @@ -1781,9 +1870,10 @@ type CompiledQuery_EntityFilter struct { XXX_unrecognized []byte `json:"-"` } -func (m *CompiledQuery_EntityFilter) Reset() { *m = CompiledQuery_EntityFilter{} } -func (m *CompiledQuery_EntityFilter) String() string { return proto.CompactTextString(m) } -func (*CompiledQuery_EntityFilter) ProtoMessage() {} +func (m *CompiledQuery_EntityFilter) Reset() { *m = CompiledQuery_EntityFilter{} } +func (m *CompiledQuery_EntityFilter) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_EntityFilter) ProtoMessage() {} +func (*CompiledQuery_EntityFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16, 2} } const Default_CompiledQuery_EntityFilter_Distinct bool = false @@ -1809,13 +1899,14 @@ func (m *CompiledQuery_EntityFilter) GetAncestor() *Reference { } type CompiledCursor struct { - Position *CompiledCursor_Position `protobuf:"group,2,opt,name=Position" json:"position,omitempty"` + Position *CompiledCursor_Position `protobuf:"group,2,opt,name=Position,json=position" json:"position,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompiledCursor) Reset() { *m = CompiledCursor{} } -func (m *CompiledCursor) String() string { return proto.CompactTextString(m) } -func (*CompiledCursor) ProtoMessage() {} +func (m *CompiledCursor) Reset() { *m = CompiledCursor{} } +func (m *CompiledCursor) String() string { return proto.CompactTextString(m) } +func (*CompiledCursor) ProtoMessage() {} +func (*CompiledCursor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } func (m *CompiledCursor) GetPosition() *CompiledCursor_Position { if m != nil { @@ -1825,16 +1916,17 @@ func (m *CompiledCursor) GetPosition() *CompiledCursor_Position { } type CompiledCursor_Position struct { - StartKey *string `protobuf:"bytes,27,opt,name=start_key" json:"start_key,omitempty"` - Indexvalue []*CompiledCursor_Position_IndexValue `protobuf:"group,29,rep,name=IndexValue" json:"indexvalue,omitempty"` + StartKey *string `protobuf:"bytes,27,opt,name=start_key,json=startKey" json:"start_key,omitempty"` + Indexvalue []*CompiledCursor_Position_IndexValue `protobuf:"group,29,rep,name=IndexValue,json=indexvalue" json:"indexvalue,omitempty"` Key *Reference `protobuf:"bytes,32,opt,name=key" json:"key,omitempty"` - StartInclusive *bool `protobuf:"varint,28,opt,name=start_inclusive,def=1" json:"start_inclusive,omitempty"` + StartInclusive *bool `protobuf:"varint,28,opt,name=start_inclusive,json=startInclusive,def=1" json:"start_inclusive,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CompiledCursor_Position) Reset() { *m = CompiledCursor_Position{} } -func (m *CompiledCursor_Position) String() string { return proto.CompactTextString(m) } -func (*CompiledCursor_Position) ProtoMessage() {} +func (m *CompiledCursor_Position) Reset() { *m = CompiledCursor_Position{} } +func (m *CompiledCursor_Position) String() string { return proto.CompactTextString(m) } +func (*CompiledCursor_Position) ProtoMessage() {} +func (*CompiledCursor_Position) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17, 0} } const Default_CompiledCursor_Position_StartInclusive bool = true @@ -1875,6 +1967,9 @@ type CompiledCursor_Position_IndexValue struct { func (m *CompiledCursor_Position_IndexValue) Reset() { *m = CompiledCursor_Position_IndexValue{} } func (m *CompiledCursor_Position_IndexValue) String() string { return proto.CompactTextString(m) } func (*CompiledCursor_Position_IndexValue) ProtoMessage() {} +func (*CompiledCursor_Position_IndexValue) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{17, 0, 0} +} func (m *CompiledCursor_Position_IndexValue) GetProperty() string { if m != nil && m.Property != nil { @@ -1896,9 +1991,10 @@ type Cursor struct { XXX_unrecognized []byte `json:"-"` } -func (m *Cursor) Reset() { *m = Cursor{} } -func (m *Cursor) String() string { return proto.CompactTextString(m) } -func (*Cursor) ProtoMessage() {} +func (m *Cursor) Reset() { *m = Cursor{} } +func (m *Cursor) String() string { return proto.CompactTextString(m) } +func (*Cursor) ProtoMessage() {} +func (*Cursor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } func (m *Cursor) GetCursor() uint64 { if m != nil && m.Cursor != nil { @@ -1918,24 +2014,26 @@ type Error struct { XXX_unrecognized []byte `json:"-"` } -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} +func (m *Error) Reset() { *m = Error{} } +func (m *Error) String() string { return proto.CompactTextString(m) } +func (*Error) ProtoMessage() {} +func (*Error) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } type Cost struct { - IndexWrites *int32 `protobuf:"varint,1,opt,name=index_writes" json:"index_writes,omitempty"` - IndexWriteBytes *int32 `protobuf:"varint,2,opt,name=index_write_bytes" json:"index_write_bytes,omitempty"` - EntityWrites *int32 `protobuf:"varint,3,opt,name=entity_writes" json:"entity_writes,omitempty"` - EntityWriteBytes *int32 `protobuf:"varint,4,opt,name=entity_write_bytes" json:"entity_write_bytes,omitempty"` - Commitcost *Cost_CommitCost `protobuf:"group,5,opt,name=CommitCost" json:"commitcost,omitempty"` - ApproximateStorageDelta *int32 `protobuf:"varint,8,opt,name=approximate_storage_delta" json:"approximate_storage_delta,omitempty"` - IdSequenceUpdates *int32 `protobuf:"varint,9,opt,name=id_sequence_updates" json:"id_sequence_updates,omitempty"` + IndexWrites *int32 `protobuf:"varint,1,opt,name=index_writes,json=indexWrites" json:"index_writes,omitempty"` + IndexWriteBytes *int32 `protobuf:"varint,2,opt,name=index_write_bytes,json=indexWriteBytes" json:"index_write_bytes,omitempty"` + EntityWrites *int32 `protobuf:"varint,3,opt,name=entity_writes,json=entityWrites" json:"entity_writes,omitempty"` + EntityWriteBytes *int32 `protobuf:"varint,4,opt,name=entity_write_bytes,json=entityWriteBytes" json:"entity_write_bytes,omitempty"` + Commitcost *Cost_CommitCost `protobuf:"group,5,opt,name=CommitCost,json=commitcost" json:"commitcost,omitempty"` + ApproximateStorageDelta *int32 `protobuf:"varint,8,opt,name=approximate_storage_delta,json=approximateStorageDelta" json:"approximate_storage_delta,omitempty"` + IdSequenceUpdates *int32 `protobuf:"varint,9,opt,name=id_sequence_updates,json=idSequenceUpdates" json:"id_sequence_updates,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Cost) Reset() { *m = Cost{} } -func (m *Cost) String() string { return proto.CompactTextString(m) } -func (*Cost) ProtoMessage() {} +func (m *Cost) Reset() { *m = Cost{} } +func (m *Cost) String() string { return proto.CompactTextString(m) } +func (*Cost) ProtoMessage() {} +func (*Cost) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } func (m *Cost) GetIndexWrites() int32 { if m != nil && m.IndexWrites != nil { @@ -1987,14 +2085,15 @@ func (m *Cost) GetIdSequenceUpdates() int32 { } type Cost_CommitCost struct { - RequestedEntityPuts *int32 `protobuf:"varint,6,opt,name=requested_entity_puts" json:"requested_entity_puts,omitempty"` - RequestedEntityDeletes *int32 `protobuf:"varint,7,opt,name=requested_entity_deletes" json:"requested_entity_deletes,omitempty"` + RequestedEntityPuts *int32 `protobuf:"varint,6,opt,name=requested_entity_puts,json=requestedEntityPuts" json:"requested_entity_puts,omitempty"` + RequestedEntityDeletes *int32 `protobuf:"varint,7,opt,name=requested_entity_deletes,json=requestedEntityDeletes" json:"requested_entity_deletes,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Cost_CommitCost) Reset() { *m = Cost_CommitCost{} } -func (m *Cost_CommitCost) String() string { return proto.CompactTextString(m) } -func (*Cost_CommitCost) ProtoMessage() {} +func (m *Cost_CommitCost) Reset() { *m = Cost_CommitCost{} } +func (m *Cost_CommitCost) String() string { return proto.CompactTextString(m) } +func (*Cost_CommitCost) ProtoMessage() {} +func (*Cost_CommitCost) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 0} } func (m *Cost_CommitCost) GetRequestedEntityPuts() int32 { if m != nil && m.RequestedEntityPuts != nil { @@ -2014,15 +2113,16 @@ type GetRequest struct { Header *InternalHeader `protobuf:"bytes,6,opt,name=header" json:"header,omitempty"` Key []*Reference `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` - FailoverMs *int64 `protobuf:"varint,3,opt,name=failover_ms" json:"failover_ms,omitempty"` + FailoverMs *int64 `protobuf:"varint,3,opt,name=failover_ms,json=failoverMs" json:"failover_ms,omitempty"` Strong *bool `protobuf:"varint,4,opt,name=strong" json:"strong,omitempty"` - AllowDeferred *bool `protobuf:"varint,5,opt,name=allow_deferred,def=0" json:"allow_deferred,omitempty"` + AllowDeferred *bool `protobuf:"varint,5,opt,name=allow_deferred,json=allowDeferred,def=0" json:"allow_deferred,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *GetRequest) Reset() { *m = GetRequest{} } -func (m *GetRequest) String() string { return proto.CompactTextString(m) } -func (*GetRequest) ProtoMessage() {} +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } const Default_GetRequest_AllowDeferred bool = false @@ -2069,15 +2169,16 @@ func (m *GetRequest) GetAllowDeferred() bool { } type GetResponse struct { - Entity []*GetResponse_Entity `protobuf:"group,1,rep,name=Entity" json:"entity,omitempty"` + Entity []*GetResponse_Entity `protobuf:"group,1,rep,name=Entity,json=entity" json:"entity,omitempty"` Deferred []*Reference `protobuf:"bytes,5,rep,name=deferred" json:"deferred,omitempty"` - InOrder *bool `protobuf:"varint,6,opt,name=in_order,def=1" json:"in_order,omitempty"` + InOrder *bool `protobuf:"varint,6,opt,name=in_order,json=inOrder,def=1" json:"in_order,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *GetResponse) Reset() { *m = GetResponse{} } -func (m *GetResponse) String() string { return proto.CompactTextString(m) } -func (*GetResponse) ProtoMessage() {} +func (m *GetResponse) Reset() { *m = GetResponse{} } +func (m *GetResponse) String() string { return proto.CompactTextString(m) } +func (*GetResponse) ProtoMessage() {} +func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } const Default_GetResponse_InOrder bool = true @@ -2109,9 +2210,10 @@ type GetResponse_Entity struct { XXX_unrecognized []byte `json:"-"` } -func (m *GetResponse_Entity) Reset() { *m = GetResponse_Entity{} } -func (m *GetResponse_Entity) String() string { return proto.CompactTextString(m) } -func (*GetResponse_Entity) ProtoMessage() {} +func (m *GetResponse_Entity) Reset() { *m = GetResponse_Entity{} } +func (m *GetResponse_Entity) String() string { return proto.CompactTextString(m) } +func (*GetResponse_Entity) ProtoMessage() {} +func (*GetResponse_Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22, 0} } func (m *GetResponse_Entity) GetEntity() *EntityProto { if m != nil { @@ -2138,18 +2240,19 @@ type PutRequest struct { Header *InternalHeader `protobuf:"bytes,11,opt,name=header" json:"header,omitempty"` Entity []*EntityProto `protobuf:"bytes,1,rep,name=entity" json:"entity,omitempty"` Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` - CompositeIndex []*CompositeIndex `protobuf:"bytes,3,rep,name=composite_index" json:"composite_index,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,3,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` Trusted *bool `protobuf:"varint,4,opt,name=trusted,def=0" json:"trusted,omitempty"` Force *bool `protobuf:"varint,7,opt,name=force,def=0" json:"force,omitempty"` - MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,def=0" json:"mark_changes,omitempty"` + MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` - AutoIdPolicy *PutRequest_AutoIdPolicy `protobuf:"varint,10,opt,name=auto_id_policy,enum=appengine.PutRequest_AutoIdPolicy,def=0" json:"auto_id_policy,omitempty"` + AutoIdPolicy *PutRequest_AutoIdPolicy `protobuf:"varint,10,opt,name=auto_id_policy,json=autoIdPolicy,enum=appengine.PutRequest_AutoIdPolicy,def=0" json:"auto_id_policy,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *PutRequest) Reset() { *m = PutRequest{} } -func (m *PutRequest) String() string { return proto.CompactTextString(m) } -func (*PutRequest) ProtoMessage() {} +func (m *PutRequest) Reset() { *m = PutRequest{} } +func (m *PutRequest) String() string { return proto.CompactTextString(m) } +func (*PutRequest) ProtoMessage() {} +func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } const Default_PutRequest_Trusted bool = false const Default_PutRequest_Force bool = false @@ -2226,9 +2329,10 @@ type PutResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *PutResponse) Reset() { *m = PutResponse{} } -func (m *PutResponse) String() string { return proto.CompactTextString(m) } -func (*PutResponse) ProtoMessage() {} +func (m *PutResponse) Reset() { *m = PutResponse{} } +func (m *PutResponse) String() string { return proto.CompactTextString(m) } +func (*PutResponse) ProtoMessage() {} +func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } func (m *PutResponse) GetKey() []*Reference { if m != nil { @@ -2254,15 +2358,16 @@ func (m *PutResponse) GetVersion() []int64 { type TouchRequest struct { Header *InternalHeader `protobuf:"bytes,10,opt,name=header" json:"header,omitempty"` Key []*Reference `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` - CompositeIndex []*CompositeIndex `protobuf:"bytes,2,rep,name=composite_index" json:"composite_index,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,2,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` Force *bool `protobuf:"varint,3,opt,name=force,def=0" json:"force,omitempty"` Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *TouchRequest) Reset() { *m = TouchRequest{} } -func (m *TouchRequest) String() string { return proto.CompactTextString(m) } -func (*TouchRequest) ProtoMessage() {} +func (m *TouchRequest) Reset() { *m = TouchRequest{} } +func (m *TouchRequest) String() string { return proto.CompactTextString(m) } +func (*TouchRequest) ProtoMessage() {} +func (*TouchRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } const Default_TouchRequest_Force bool = false @@ -2306,9 +2411,10 @@ type TouchResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *TouchResponse) Reset() { *m = TouchResponse{} } -func (m *TouchResponse) String() string { return proto.CompactTextString(m) } -func (*TouchResponse) ProtoMessage() {} +func (m *TouchResponse) Reset() { *m = TouchResponse{} } +func (m *TouchResponse) String() string { return proto.CompactTextString(m) } +func (*TouchResponse) ProtoMessage() {} +func (*TouchResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } func (m *TouchResponse) GetCost() *Cost { if m != nil { @@ -2323,14 +2429,15 @@ type DeleteRequest struct { Transaction *Transaction `protobuf:"bytes,5,opt,name=transaction" json:"transaction,omitempty"` Trusted *bool `protobuf:"varint,4,opt,name=trusted,def=0" json:"trusted,omitempty"` Force *bool `protobuf:"varint,7,opt,name=force,def=0" json:"force,omitempty"` - MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,def=0" json:"mark_changes,omitempty"` + MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRequest) ProtoMessage() {} +func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } +func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRequest) ProtoMessage() {} +func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } const Default_DeleteRequest_Trusted bool = false const Default_DeleteRequest_Force bool = false @@ -2391,9 +2498,10 @@ type DeleteResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } -func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteResponse) ProtoMessage() {} +func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } +func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteResponse) ProtoMessage() {} +func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } func (m *DeleteResponse) GetCost() *Cost { if m != nil { @@ -2418,9 +2526,10 @@ type NextRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *NextRequest) Reset() { *m = NextRequest{} } -func (m *NextRequest) String() string { return proto.CompactTextString(m) } -func (*NextRequest) ProtoMessage() {} +func (m *NextRequest) Reset() { *m = NextRequest{} } +func (m *NextRequest) String() string { return proto.CompactTextString(m) } +func (*NextRequest) ProtoMessage() {} +func (*NextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } const Default_NextRequest_Offset int32 = 0 const Default_NextRequest_Compile bool = false @@ -2463,21 +2572,22 @@ func (m *NextRequest) GetCompile() bool { type QueryResult struct { Cursor *Cursor `protobuf:"bytes,1,opt,name=cursor" json:"cursor,omitempty"` Result []*EntityProto `protobuf:"bytes,2,rep,name=result" json:"result,omitempty"` - SkippedResults *int32 `protobuf:"varint,7,opt,name=skipped_results" json:"skipped_results,omitempty"` - MoreResults *bool `protobuf:"varint,3,req,name=more_results" json:"more_results,omitempty"` - KeysOnly *bool `protobuf:"varint,4,opt,name=keys_only" json:"keys_only,omitempty"` - IndexOnly *bool `protobuf:"varint,9,opt,name=index_only" json:"index_only,omitempty"` - SmallOps *bool `protobuf:"varint,10,opt,name=small_ops" json:"small_ops,omitempty"` - CompiledQuery *CompiledQuery `protobuf:"bytes,5,opt,name=compiled_query" json:"compiled_query,omitempty"` - CompiledCursor *CompiledCursor `protobuf:"bytes,6,opt,name=compiled_cursor" json:"compiled_cursor,omitempty"` + SkippedResults *int32 `protobuf:"varint,7,opt,name=skipped_results,json=skippedResults" json:"skipped_results,omitempty"` + MoreResults *bool `protobuf:"varint,3,req,name=more_results,json=moreResults" json:"more_results,omitempty"` + KeysOnly *bool `protobuf:"varint,4,opt,name=keys_only,json=keysOnly" json:"keys_only,omitempty"` + IndexOnly *bool `protobuf:"varint,9,opt,name=index_only,json=indexOnly" json:"index_only,omitempty"` + SmallOps *bool `protobuf:"varint,10,opt,name=small_ops,json=smallOps" json:"small_ops,omitempty"` + CompiledQuery *CompiledQuery `protobuf:"bytes,5,opt,name=compiled_query,json=compiledQuery" json:"compiled_query,omitempty"` + CompiledCursor *CompiledCursor `protobuf:"bytes,6,opt,name=compiled_cursor,json=compiledCursor" json:"compiled_cursor,omitempty"` Index []*CompositeIndex `protobuf:"bytes,8,rep,name=index" json:"index,omitempty"` Version []int64 `protobuf:"varint,11,rep,name=version" json:"version,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} +func (m *QueryResult) Reset() { *m = QueryResult{} } +func (m *QueryResult) String() string { return proto.CompactTextString(m) } +func (*QueryResult) ProtoMessage() {} +func (*QueryResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } func (m *QueryResult) GetCursor() *Cursor { if m != nil { @@ -2558,16 +2668,17 @@ func (m *QueryResult) GetVersion() []int64 { type AllocateIdsRequest struct { Header *InternalHeader `protobuf:"bytes,4,opt,name=header" json:"header,omitempty"` - ModelKey *Reference `protobuf:"bytes,1,opt,name=model_key" json:"model_key,omitempty"` + ModelKey *Reference `protobuf:"bytes,1,opt,name=model_key,json=modelKey" json:"model_key,omitempty"` Size *int64 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"` Max *int64 `protobuf:"varint,3,opt,name=max" json:"max,omitempty"` Reserve []*Reference `protobuf:"bytes,5,rep,name=reserve" json:"reserve,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } -func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } -func (*AllocateIdsRequest) ProtoMessage() {} +func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } +func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsRequest) ProtoMessage() {} +func (*AllocateIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } func (m *AllocateIdsRequest) GetHeader() *InternalHeader { if m != nil { @@ -2611,9 +2722,10 @@ type AllocateIdsResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } -func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } -func (*AllocateIdsResponse) ProtoMessage() {} +func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } +func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsResponse) ProtoMessage() {} +func (*AllocateIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } func (m *AllocateIdsResponse) GetStart() int64 { if m != nil && m.Start != nil { @@ -2641,9 +2753,10 @@ type CompositeIndices struct { XXX_unrecognized []byte `json:"-"` } -func (m *CompositeIndices) Reset() { *m = CompositeIndices{} } -func (m *CompositeIndices) String() string { return proto.CompactTextString(m) } -func (*CompositeIndices) ProtoMessage() {} +func (m *CompositeIndices) Reset() { *m = CompositeIndices{} } +func (m *CompositeIndices) String() string { return proto.CompactTextString(m) } +func (*CompositeIndices) ProtoMessage() {} +func (*CompositeIndices) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } func (m *CompositeIndices) GetIndex() []*CompositeIndex { if m != nil { @@ -2659,9 +2772,10 @@ type AddActionsRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *AddActionsRequest) Reset() { *m = AddActionsRequest{} } -func (m *AddActionsRequest) String() string { return proto.CompactTextString(m) } -func (*AddActionsRequest) ProtoMessage() {} +func (m *AddActionsRequest) Reset() { *m = AddActionsRequest{} } +func (m *AddActionsRequest) String() string { return proto.CompactTextString(m) } +func (*AddActionsRequest) ProtoMessage() {} +func (*AddActionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } func (m *AddActionsRequest) GetHeader() *InternalHeader { if m != nil { @@ -2688,22 +2802,28 @@ type AddActionsResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *AddActionsResponse) Reset() { *m = AddActionsResponse{} } -func (m *AddActionsResponse) String() string { return proto.CompactTextString(m) } -func (*AddActionsResponse) ProtoMessage() {} +func (m *AddActionsResponse) Reset() { *m = AddActionsResponse{} } +func (m *AddActionsResponse) String() string { return proto.CompactTextString(m) } +func (*AddActionsResponse) ProtoMessage() {} +func (*AddActionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } type BeginTransactionRequest struct { - Header *InternalHeader `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` - App *string `protobuf:"bytes,1,req,name=app" json:"app,omitempty"` - AllowMultipleEg *bool `protobuf:"varint,2,opt,name=allow_multiple_eg,def=0" json:"allow_multiple_eg,omitempty"` - XXX_unrecognized []byte `json:"-"` + Header *InternalHeader `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + App *string `protobuf:"bytes,1,req,name=app" json:"app,omitempty"` + AllowMultipleEg *bool `protobuf:"varint,2,opt,name=allow_multiple_eg,json=allowMultipleEg,def=0" json:"allow_multiple_eg,omitempty"` + DatabaseId *string `protobuf:"bytes,4,opt,name=database_id,json=databaseId" json:"database_id,omitempty"` + Mode *BeginTransactionRequest_TransactionMode `protobuf:"varint,5,opt,name=mode,enum=appengine.BeginTransactionRequest_TransactionMode,def=0" json:"mode,omitempty"` + PreviousTransaction *Transaction `protobuf:"bytes,7,opt,name=previous_transaction,json=previousTransaction" json:"previous_transaction,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } -func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } -func (*BeginTransactionRequest) ProtoMessage() {} +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } const Default_BeginTransactionRequest_AllowMultipleEg bool = false +const Default_BeginTransactionRequest_Mode BeginTransactionRequest_TransactionMode = BeginTransactionRequest_UNKNOWN func (m *BeginTransactionRequest) GetHeader() *InternalHeader { if m != nil { @@ -2726,15 +2846,37 @@ func (m *BeginTransactionRequest) GetAllowMultipleEg() bool { return Default_BeginTransactionRequest_AllowMultipleEg } +func (m *BeginTransactionRequest) GetDatabaseId() string { + if m != nil && m.DatabaseId != nil { + return *m.DatabaseId + } + return "" +} + +func (m *BeginTransactionRequest) GetMode() BeginTransactionRequest_TransactionMode { + if m != nil && m.Mode != nil { + return *m.Mode + } + return Default_BeginTransactionRequest_Mode +} + +func (m *BeginTransactionRequest) GetPreviousTransaction() *Transaction { + if m != nil { + return m.PreviousTransaction + } + return nil +} + type CommitResponse struct { Cost *Cost `protobuf:"bytes,1,opt,name=cost" json:"cost,omitempty"` - Version []*CommitResponse_Version `protobuf:"group,3,rep,name=Version" json:"version,omitempty"` + Version []*CommitResponse_Version `protobuf:"group,3,rep,name=Version,json=version" json:"version,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CommitResponse) Reset() { *m = CommitResponse{} } -func (m *CommitResponse) String() string { return proto.CompactTextString(m) } -func (*CommitResponse) ProtoMessage() {} +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } func (m *CommitResponse) GetCost() *Cost { if m != nil { @@ -2751,14 +2893,15 @@ func (m *CommitResponse) GetVersion() []*CommitResponse_Version { } type CommitResponse_Version struct { - RootEntityKey *Reference `protobuf:"bytes,4,req,name=root_entity_key" json:"root_entity_key,omitempty"` + RootEntityKey *Reference `protobuf:"bytes,4,req,name=root_entity_key,json=rootEntityKey" json:"root_entity_key,omitempty"` Version *int64 `protobuf:"varint,5,req,name=version" json:"version,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *CommitResponse_Version) Reset() { *m = CommitResponse_Version{} } -func (m *CommitResponse_Version) String() string { return proto.CompactTextString(m) } -func (*CommitResponse_Version) ProtoMessage() {} +func (m *CommitResponse_Version) Reset() { *m = CommitResponse_Version{} } +func (m *CommitResponse_Version) String() string { return proto.CompactTextString(m) } +func (*CommitResponse_Version) ProtoMessage() {} +func (*CommitResponse_Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37, 0} } func (m *CommitResponse_Version) GetRootEntityKey() *Reference { if m != nil { @@ -2775,4 +2918,327 @@ func (m *CommitResponse_Version) GetVersion() int64 { } func init() { + proto.RegisterType((*Action)(nil), "appengine.Action") + proto.RegisterType((*PropertyValue)(nil), "appengine.PropertyValue") + proto.RegisterType((*PropertyValue_PointValue)(nil), "appengine.PropertyValue.PointValue") + proto.RegisterType((*PropertyValue_UserValue)(nil), "appengine.PropertyValue.UserValue") + proto.RegisterType((*PropertyValue_ReferenceValue)(nil), "appengine.PropertyValue.ReferenceValue") + proto.RegisterType((*PropertyValue_ReferenceValue_PathElement)(nil), "appengine.PropertyValue.ReferenceValue.PathElement") + proto.RegisterType((*Property)(nil), "appengine.Property") + proto.RegisterType((*Path)(nil), "appengine.Path") + proto.RegisterType((*Path_Element)(nil), "appengine.Path.Element") + proto.RegisterType((*Reference)(nil), "appengine.Reference") + proto.RegisterType((*User)(nil), "appengine.User") + proto.RegisterType((*EntityProto)(nil), "appengine.EntityProto") + proto.RegisterType((*CompositeProperty)(nil), "appengine.CompositeProperty") + proto.RegisterType((*Index)(nil), "appengine.Index") + proto.RegisterType((*Index_Property)(nil), "appengine.Index.Property") + proto.RegisterType((*CompositeIndex)(nil), "appengine.CompositeIndex") + proto.RegisterType((*IndexPostfix)(nil), "appengine.IndexPostfix") + proto.RegisterType((*IndexPostfix_IndexValue)(nil), "appengine.IndexPostfix.IndexValue") + proto.RegisterType((*IndexPosition)(nil), "appengine.IndexPosition") + proto.RegisterType((*Snapshot)(nil), "appengine.Snapshot") + proto.RegisterType((*InternalHeader)(nil), "appengine.InternalHeader") + proto.RegisterType((*Transaction)(nil), "appengine.Transaction") + proto.RegisterType((*Query)(nil), "appengine.Query") + proto.RegisterType((*Query_Filter)(nil), "appengine.Query.Filter") + proto.RegisterType((*Query_Order)(nil), "appengine.Query.Order") + proto.RegisterType((*CompiledQuery)(nil), "appengine.CompiledQuery") + proto.RegisterType((*CompiledQuery_PrimaryScan)(nil), "appengine.CompiledQuery.PrimaryScan") + proto.RegisterType((*CompiledQuery_MergeJoinScan)(nil), "appengine.CompiledQuery.MergeJoinScan") + proto.RegisterType((*CompiledQuery_EntityFilter)(nil), "appengine.CompiledQuery.EntityFilter") + proto.RegisterType((*CompiledCursor)(nil), "appengine.CompiledCursor") + proto.RegisterType((*CompiledCursor_Position)(nil), "appengine.CompiledCursor.Position") + proto.RegisterType((*CompiledCursor_Position_IndexValue)(nil), "appengine.CompiledCursor.Position.IndexValue") + proto.RegisterType((*Cursor)(nil), "appengine.Cursor") + proto.RegisterType((*Error)(nil), "appengine.Error") + proto.RegisterType((*Cost)(nil), "appengine.Cost") + proto.RegisterType((*Cost_CommitCost)(nil), "appengine.Cost.CommitCost") + proto.RegisterType((*GetRequest)(nil), "appengine.GetRequest") + proto.RegisterType((*GetResponse)(nil), "appengine.GetResponse") + proto.RegisterType((*GetResponse_Entity)(nil), "appengine.GetResponse.Entity") + proto.RegisterType((*PutRequest)(nil), "appengine.PutRequest") + proto.RegisterType((*PutResponse)(nil), "appengine.PutResponse") + proto.RegisterType((*TouchRequest)(nil), "appengine.TouchRequest") + proto.RegisterType((*TouchResponse)(nil), "appengine.TouchResponse") + proto.RegisterType((*DeleteRequest)(nil), "appengine.DeleteRequest") + proto.RegisterType((*DeleteResponse)(nil), "appengine.DeleteResponse") + proto.RegisterType((*NextRequest)(nil), "appengine.NextRequest") + proto.RegisterType((*QueryResult)(nil), "appengine.QueryResult") + proto.RegisterType((*AllocateIdsRequest)(nil), "appengine.AllocateIdsRequest") + proto.RegisterType((*AllocateIdsResponse)(nil), "appengine.AllocateIdsResponse") + proto.RegisterType((*CompositeIndices)(nil), "appengine.CompositeIndices") + proto.RegisterType((*AddActionsRequest)(nil), "appengine.AddActionsRequest") + proto.RegisterType((*AddActionsResponse)(nil), "appengine.AddActionsResponse") + proto.RegisterType((*BeginTransactionRequest)(nil), "appengine.BeginTransactionRequest") + proto.RegisterType((*CommitResponse)(nil), "appengine.CommitResponse") + proto.RegisterType((*CommitResponse_Version)(nil), "appengine.CommitResponse.Version") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/datastore/datastore_v3.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 4156 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcd, 0x73, 0xe3, 0x46, + 0x76, 0x37, 0xc1, 0xef, 0x47, 0x89, 0x82, 0x5a, 0xf3, 0xc1, 0xa1, 0x3f, 0x46, 0xc6, 0xac, 0x6d, + 0xd9, 0x6b, 0x73, 0x6c, 0xf9, 0x23, 0x5b, 0x4a, 0x76, 0x1d, 0x4a, 0xc4, 0x68, 0x90, 0xa1, 0x48, + 0xb9, 0x09, 0xd9, 0x9e, 0x5c, 0x50, 0x18, 0xa2, 0x29, 0x21, 0x43, 0x02, 0x30, 0x00, 0x6a, 0x46, + 0x93, 0xe4, 0x90, 0x4b, 0x2a, 0x55, 0x5b, 0xa9, 0x1c, 0x92, 0x4a, 0x25, 0xf9, 0x07, 0x72, 0xc8, + 0x39, 0x95, 0xaa, 0x54, 0xf6, 0x98, 0x5b, 0x0e, 0x7b, 0xc9, 0x31, 0x95, 0x73, 0xf2, 0x27, 0x24, + 0x39, 0xa4, 0xfa, 0x75, 0x03, 0x02, 0x28, 0x4a, 0x23, 0x6d, 0xf6, 0x90, 0x13, 0xd1, 0xef, 0xfd, + 0xba, 0xf1, 0xfa, 0xf5, 0xfb, 0x6c, 0x10, 0xba, 0xc7, 0xbe, 0x7f, 0x3c, 0x65, 0x9d, 0x63, 0x7f, + 0x6a, 0x7b, 0xc7, 0x1d, 0x3f, 0x3c, 0x7e, 0x68, 0x07, 0x01, 0xf3, 0x8e, 0x5d, 0x8f, 0x3d, 0x74, + 0xbd, 0x98, 0x85, 0x9e, 0x3d, 0x7d, 0xe8, 0xd8, 0xb1, 0x1d, 0xc5, 0x7e, 0xc8, 0xce, 0x9f, 0xac, + 0xd3, 0xcf, 0x3b, 0x41, 0xe8, 0xc7, 0x3e, 0xa9, 0xa7, 0x13, 0xb4, 0x1a, 0x54, 0xba, 0xe3, 0xd8, + 0xf5, 0x3d, 0xed, 0x1f, 0x2b, 0xb0, 0x7a, 0x18, 0xfa, 0x01, 0x0b, 0xe3, 0xb3, 0x6f, 0xed, 0xe9, + 0x9c, 0x91, 0x77, 0x00, 0x5c, 0x2f, 0xfe, 0xea, 0x0b, 0x1c, 0xb5, 0x0a, 0x9b, 0x85, 0xad, 0x22, + 0xcd, 0x50, 0x88, 0x06, 0x2b, 0xcf, 0x7c, 0x7f, 0xca, 0x6c, 0x4f, 0x20, 0x94, 0xcd, 0xc2, 0x56, + 0x8d, 0xe6, 0x68, 0x64, 0x13, 0x1a, 0x51, 0x1c, 0xba, 0xde, 0xb1, 0x80, 0x14, 0x37, 0x0b, 0x5b, + 0x75, 0x9a, 0x25, 0x71, 0x84, 0xe3, 0xcf, 0x9f, 0x4d, 0x99, 0x40, 0x94, 0x36, 0x0b, 0x5b, 0x05, + 0x9a, 0x25, 0x91, 0x3d, 0x80, 0xc0, 0x77, 0xbd, 0xf8, 0x14, 0x01, 0xe5, 0xcd, 0xc2, 0x16, 0x6c, + 0x3f, 0xe8, 0xa4, 0x7b, 0xe8, 0xe4, 0xa4, 0xee, 0x1c, 0x72, 0x28, 0x3e, 0xd2, 0xcc, 0x34, 0xf2, + 0xdb, 0x50, 0x9f, 0x47, 0x2c, 0x14, 0x6b, 0xd4, 0x70, 0x0d, 0xed, 0xd2, 0x35, 0x8e, 0x22, 0x16, + 0x8a, 0x25, 0xce, 0x27, 0x91, 0x21, 0x34, 0x43, 0x36, 0x61, 0x21, 0xf3, 0xc6, 0x4c, 0x2c, 0xb3, + 0x82, 0xcb, 0x7c, 0x70, 0xe9, 0x32, 0x34, 0x81, 0x8b, 0xb5, 0x16, 0xa6, 0xb7, 0xb7, 0x00, 0xce, + 0x85, 0x25, 0x2b, 0x50, 0x78, 0xd9, 0xaa, 0x6c, 0x2a, 0x5b, 0x05, 0x5a, 0x78, 0xc9, 0x47, 0x67, + 0xad, 0xaa, 0x18, 0x9d, 0xb5, 0xff, 0xa9, 0x00, 0xf5, 0x54, 0x26, 0x72, 0x0b, 0xca, 0x6c, 0x66, + 0xbb, 0xd3, 0x56, 0x7d, 0x53, 0xd9, 0xaa, 0x53, 0x31, 0x20, 0xf7, 0xa1, 0x61, 0xcf, 0xe3, 0x13, + 0xcb, 0xf1, 0x67, 0xb6, 0xeb, 0xb5, 0x00, 0x79, 0xc0, 0x49, 0x3d, 0xa4, 0x90, 0x36, 0xd4, 0x3c, + 0x77, 0xfc, 0xdc, 0xb3, 0x67, 0xac, 0xd5, 0xc0, 0x73, 0x48, 0xc7, 0xe4, 0x13, 0x20, 0x13, 0xe6, + 0xb0, 0xd0, 0x8e, 0x99, 0x63, 0xb9, 0x0e, 0xf3, 0x62, 0x37, 0x3e, 0x6b, 0xdd, 0x46, 0xd4, 0x7a, + 0xca, 0x31, 0x24, 0x23, 0x0f, 0x0f, 0x42, 0xff, 0xd4, 0x75, 0x58, 0xd8, 0xba, 0xb3, 0x00, 0x3f, + 0x94, 0x8c, 0xf6, 0xbf, 0x17, 0xa0, 0x99, 0xd7, 0x05, 0x51, 0xa1, 0x68, 0x07, 0x41, 0x6b, 0x15, + 0xa5, 0xe4, 0x8f, 0xe4, 0x6d, 0x00, 0x2e, 0x8a, 0x15, 0x05, 0xf6, 0x98, 0xb5, 0x6e, 0xe1, 0x5a, + 0x75, 0x4e, 0x19, 0x71, 0x02, 0x39, 0x82, 0x46, 0x60, 0xc7, 0x27, 0x6c, 0xca, 0x66, 0xcc, 0x8b, + 0x5b, 0xcd, 0xcd, 0xe2, 0x16, 0x6c, 0x7f, 0x7e, 0x4d, 0xd5, 0x77, 0x0e, 0xed, 0xf8, 0x44, 0x17, + 0x53, 0x69, 0x76, 0x9d, 0xb6, 0x0e, 0x8d, 0x0c, 0x8f, 0x10, 0x28, 0xc5, 0x67, 0x01, 0x6b, 0xad, + 0xa1, 0x5c, 0xf8, 0x4c, 0x9a, 0xa0, 0xb8, 0x4e, 0x4b, 0x45, 0xf3, 0x57, 0x5c, 0x87, 0x63, 0x50, + 0x87, 0xeb, 0x28, 0x22, 0x3e, 0x6b, 0xff, 0x51, 0x86, 0x5a, 0x22, 0x00, 0xe9, 0x42, 0x75, 0xc6, + 0x6c, 0xcf, 0xf5, 0x8e, 0xd1, 0x69, 0x9a, 0xdb, 0x6f, 0x2e, 0x11, 0xb3, 0x73, 0x20, 0x20, 0x3b, + 0x30, 0x18, 0x5a, 0x07, 0x7a, 0x77, 0x60, 0x0c, 0xf6, 0x69, 0x32, 0x8f, 0x1f, 0xa6, 0x7c, 0xb4, + 0xe6, 0xa1, 0x8b, 0x9e, 0x55, 0xa7, 0x20, 0x49, 0x47, 0xa1, 0x9b, 0x0a, 0x51, 0x14, 0x82, 0xe2, + 0x21, 0x76, 0xa0, 0x9c, 0xb8, 0x88, 0xb2, 0xd5, 0xd8, 0x6e, 0x5d, 0xa6, 0x1c, 0x2a, 0x60, 0xdc, + 0x20, 0x66, 0xf3, 0x69, 0xec, 0x06, 0x53, 0xee, 0x76, 0xca, 0x56, 0x8d, 0xa6, 0x63, 0xf2, 0x1e, + 0x40, 0xc4, 0xec, 0x70, 0x7c, 0x62, 0x3f, 0x9b, 0xb2, 0x56, 0x85, 0x7b, 0xf6, 0x4e, 0x79, 0x62, + 0x4f, 0x23, 0x46, 0x33, 0x0c, 0x62, 0xc3, 0xdd, 0x49, 0x1c, 0x59, 0xb1, 0xff, 0x9c, 0x79, 0xee, + 0x2b, 0x9b, 0x07, 0x12, 0xcb, 0x0f, 0xf8, 0x0f, 0xfa, 0x58, 0x73, 0xfb, 0xc3, 0x65, 0x5b, 0x7f, + 0x14, 0x47, 0x66, 0x66, 0xc6, 0x10, 0x27, 0xd0, 0xdb, 0x93, 0x65, 0x64, 0xd2, 0x86, 0xca, 0xd4, + 0x1f, 0xdb, 0x53, 0xd6, 0xaa, 0x73, 0x2d, 0xec, 0x28, 0xcc, 0xa3, 0x92, 0xa2, 0xfd, 0xb3, 0x02, + 0x55, 0xa9, 0x47, 0xd2, 0x84, 0x8c, 0x26, 0xd5, 0x37, 0x48, 0x0d, 0x4a, 0xbb, 0xfd, 0xe1, 0xae, + 0xda, 0xe4, 0x4f, 0xa6, 0xfe, 0xbd, 0xa9, 0xae, 0x71, 0xcc, 0xee, 0x53, 0x53, 0x1f, 0x99, 0x94, + 0x63, 0x54, 0xb2, 0x0e, 0xab, 0x5d, 0x73, 0x78, 0x60, 0xed, 0x75, 0x4d, 0x7d, 0x7f, 0x48, 0x9f, + 0xaa, 0x05, 0xb2, 0x0a, 0x75, 0x24, 0xf5, 0x8d, 0xc1, 0x13, 0x55, 0xe1, 0x33, 0x70, 0x68, 0x1a, + 0x66, 0x5f, 0x57, 0x8b, 0x44, 0x85, 0x15, 0x31, 0x63, 0x38, 0x30, 0xf5, 0x81, 0xa9, 0x96, 0x52, + 0xca, 0xe8, 0xe8, 0xe0, 0xa0, 0x4b, 0x9f, 0xaa, 0x65, 0xb2, 0x06, 0x0d, 0xa4, 0x74, 0x8f, 0xcc, + 0xc7, 0x43, 0xaa, 0x56, 0x48, 0x03, 0xaa, 0xfb, 0x3d, 0xeb, 0xbb, 0xc7, 0xfa, 0x40, 0xad, 0x92, + 0x15, 0xa8, 0xed, 0xf7, 0x2c, 0xfd, 0xa0, 0x6b, 0xf4, 0xd5, 0x1a, 0x9f, 0xbd, 0xaf, 0x0f, 0xe9, + 0x68, 0x64, 0x1d, 0x0e, 0x8d, 0x81, 0xa9, 0xd6, 0x49, 0x1d, 0xca, 0xfb, 0x3d, 0xcb, 0x38, 0x50, + 0x81, 0x10, 0x68, 0xee, 0xf7, 0xac, 0xc3, 0xc7, 0xc3, 0x81, 0x3e, 0x38, 0x3a, 0xd8, 0xd5, 0xa9, + 0xda, 0x20, 0xb7, 0x40, 0xe5, 0xb4, 0xe1, 0xc8, 0xec, 0xf6, 0xbb, 0xbd, 0x1e, 0xd5, 0x47, 0x23, + 0x75, 0x85, 0x4b, 0xbd, 0xdf, 0xb3, 0x68, 0xd7, 0xe4, 0xfb, 0x5a, 0xe5, 0x2f, 0xe4, 0x7b, 0x7f, + 0xa2, 0x3f, 0x55, 0xd7, 0xf9, 0x2b, 0xf4, 0x81, 0x69, 0x98, 0x4f, 0xad, 0x43, 0x3a, 0x34, 0x87, + 0xea, 0x06, 0x17, 0xd0, 0x18, 0xf4, 0xf4, 0xef, 0xad, 0x6f, 0xbb, 0xfd, 0x23, 0x5d, 0x25, 0xda, + 0x8f, 0xe1, 0xf6, 0xd2, 0x33, 0xe1, 0xaa, 0x7b, 0x6c, 0x1e, 0xf4, 0xd5, 0x02, 0x7f, 0xe2, 0x9b, + 0x52, 0x15, 0xed, 0x0f, 0xa0, 0xc4, 0x5d, 0x86, 0x7c, 0x06, 0xd5, 0xc4, 0x1b, 0x0b, 0xe8, 0x8d, + 0x77, 0xb3, 0x67, 0x6d, 0xc7, 0x27, 0x9d, 0xc4, 0xe3, 0x12, 0x5c, 0xbb, 0x0b, 0xd5, 0x45, 0x4f, + 0x53, 0x2e, 0x78, 0x5a, 0xf1, 0x82, 0xa7, 0x95, 0x32, 0x9e, 0x66, 0x43, 0x3d, 0xf5, 0xed, 0x9b, + 0x47, 0x91, 0x07, 0x50, 0xe2, 0xde, 0xdf, 0x6a, 0xa2, 0x87, 0xac, 0x2d, 0x08, 0x4c, 0x91, 0xa9, + 0xfd, 0x43, 0x01, 0x4a, 0x3c, 0xda, 0x9e, 0x07, 0xda, 0xc2, 0x15, 0x81, 0x56, 0xb9, 0x32, 0xd0, + 0x16, 0xaf, 0x15, 0x68, 0x2b, 0x37, 0x0b, 0xb4, 0xd5, 0x4b, 0x02, 0xad, 0xf6, 0x67, 0x45, 0x68, + 0xe8, 0x38, 0xf3, 0x10, 0x13, 0xfd, 0xfb, 0x50, 0x7c, 0xce, 0xce, 0x50, 0x3f, 0x8d, 0xed, 0x5b, + 0x99, 0xdd, 0xa6, 0x2a, 0xa4, 0x1c, 0x40, 0xb6, 0x61, 0x45, 0xbc, 0xd0, 0x3a, 0x0e, 0xfd, 0x79, + 0xd0, 0x52, 0x97, 0xab, 0xa7, 0x21, 0x40, 0xfb, 0x1c, 0x43, 0xde, 0x83, 0xb2, 0xff, 0xc2, 0x63, + 0x21, 0xc6, 0xc1, 0x3c, 0x98, 0x2b, 0x8f, 0x0a, 0x2e, 0x79, 0x08, 0xa5, 0xe7, 0xae, 0xe7, 0xe0, + 0x19, 0xe6, 0x23, 0x61, 0x46, 0xd0, 0xce, 0x13, 0xd7, 0x73, 0x28, 0x02, 0xc9, 0x3d, 0xa8, 0xf1, + 0x5f, 0x8c, 0x7b, 0x65, 0xdc, 0x68, 0x95, 0x8f, 0x79, 0xd0, 0x7b, 0x08, 0xb5, 0x40, 0xc6, 0x10, + 0x4c, 0x00, 0x8d, 0xed, 0x8d, 0x25, 0xe1, 0x85, 0xa6, 0x20, 0xf2, 0x15, 0xac, 0x84, 0xf6, 0x0b, + 0x2b, 0x9d, 0xb4, 0x76, 0xf9, 0xa4, 0x46, 0x68, 0xbf, 0x48, 0x23, 0x38, 0x81, 0x52, 0x68, 0x7b, + 0xcf, 0x5b, 0x64, 0xb3, 0xb0, 0x55, 0xa6, 0xf8, 0xac, 0x7d, 0x01, 0x25, 0x2e, 0x25, 0x8f, 0x08, + 0xfb, 0x3d, 0xf4, 0xff, 0xee, 0x9e, 0xa9, 0x16, 0x12, 0x7f, 0xfe, 0x96, 0x47, 0x03, 0x45, 0x72, + 0x0f, 0xf4, 0xd1, 0xa8, 0xbb, 0xaf, 0xab, 0x45, 0xad, 0x07, 0xeb, 0x7b, 0xfe, 0x2c, 0xf0, 0x23, + 0x37, 0x66, 0xe9, 0xf2, 0xf7, 0xa0, 0xe6, 0x7a, 0x0e, 0x7b, 0x69, 0xb9, 0x0e, 0x9a, 0x56, 0x91, + 0x56, 0x71, 0x6c, 0x38, 0xdc, 0xe4, 0x4e, 0x65, 0x31, 0x55, 0xe4, 0x26, 0x87, 0x03, 0xed, 0x2f, + 0x15, 0x28, 0x1b, 0x1c, 0xc1, 0x8d, 0x4f, 0x9e, 0x14, 0x7a, 0x8f, 0x30, 0x4c, 0x10, 0x24, 0x93, + 0xfb, 0x50, 0x1b, 0x6a, 0xb6, 0x37, 0x66, 0xbc, 0xe2, 0xc3, 0x3c, 0x50, 0xa3, 0xe9, 0x98, 0x7c, + 0x99, 0xd1, 0x9f, 0x82, 0x2e, 0x7b, 0x2f, 0xa3, 0x0a, 0x7c, 0xc1, 0x12, 0x2d, 0xb6, 0xff, 0xaa, + 0x90, 0x49, 0x6e, 0xcb, 0x12, 0x4f, 0x1f, 0xea, 0x8e, 0x1b, 0x32, 0xac, 0x23, 0xe5, 0x41, 0x3f, + 0xb8, 0x74, 0xe1, 0x4e, 0x2f, 0x81, 0xee, 0xd4, 0xbb, 0xa3, 0x3d, 0x7d, 0xd0, 0xe3, 0x99, 0xef, + 0x7c, 0x01, 0xed, 0x23, 0xa8, 0xa7, 0x10, 0x0c, 0xc7, 0x09, 0x48, 0x2d, 0x70, 0xf5, 0xf6, 0xf4, + 0x74, 0xac, 0x68, 0x7f, 0xad, 0x40, 0x33, 0xd5, 0xaf, 0xd0, 0xd0, 0x6d, 0xa8, 0xd8, 0x41, 0x90, + 0xa8, 0xb6, 0x4e, 0xcb, 0x76, 0x10, 0x18, 0x8e, 0x8c, 0x2d, 0x0a, 0x6a, 0x9b, 0xc7, 0x96, 0x4f, + 0x01, 0x1c, 0x36, 0x71, 0x3d, 0x17, 0x85, 0x2e, 0xa2, 0xc1, 0xab, 0x8b, 0x42, 0xd3, 0x0c, 0x86, + 0x7c, 0x09, 0xe5, 0x28, 0xb6, 0x63, 0x91, 0x2b, 0x9b, 0xdb, 0xf7, 0x33, 0xe0, 0xbc, 0x08, 0x9d, + 0x11, 0x87, 0x51, 0x81, 0x26, 0x5f, 0xc1, 0x2d, 0xdf, 0x9b, 0x9e, 0x59, 0xf3, 0x88, 0x59, 0xee, + 0xc4, 0x0a, 0xd9, 0x0f, 0x73, 0x37, 0x64, 0x4e, 0x3e, 0xa7, 0xae, 0x73, 0xc8, 0x51, 0xc4, 0x8c, + 0x09, 0x95, 0x7c, 0xed, 0x6b, 0x28, 0xe3, 0x3a, 0x7c, 0xcf, 0xdf, 0x51, 0xc3, 0xd4, 0xad, 0xe1, + 0xa0, 0xff, 0x54, 0xe8, 0x80, 0xea, 0xdd, 0x9e, 0x85, 0x44, 0x55, 0xe1, 0xc1, 0xbe, 0xa7, 0xf7, + 0x75, 0x53, 0xef, 0xa9, 0x45, 0x9e, 0x3d, 0x74, 0x4a, 0x87, 0x54, 0x2d, 0x69, 0xff, 0x53, 0x80, + 0x15, 0x94, 0xe7, 0xd0, 0x8f, 0xe2, 0x89, 0xfb, 0x92, 0xec, 0x41, 0x43, 0x98, 0xdd, 0xa9, 0x2c, + 0xe8, 0xb9, 0x33, 0x68, 0x8b, 0x7b, 0x96, 0x68, 0x31, 0x90, 0x75, 0xb4, 0x9b, 0x3e, 0x27, 0x21, + 0x45, 0x41, 0xa7, 0xbf, 0x22, 0xa4, 0xbc, 0x05, 0x95, 0x67, 0x6c, 0xe2, 0x87, 0x22, 0x04, 0xd6, + 0x76, 0x4a, 0x71, 0x38, 0x67, 0x54, 0xd2, 0xda, 0x36, 0xc0, 0xf9, 0xfa, 0xe4, 0x01, 0xac, 0x26, + 0xc6, 0x66, 0xa1, 0x71, 0x89, 0x93, 0x5b, 0x49, 0x88, 0x83, 0x5c, 0x75, 0xa3, 0x5c, 0xab, 0xba, + 0xd1, 0xbe, 0x86, 0xd5, 0x64, 0x3f, 0xe2, 0xfc, 0x54, 0x21, 0x79, 0x01, 0x63, 0xca, 0x82, 0x8c, + 0xca, 0x45, 0x19, 0xb5, 0x9f, 0x41, 0x6d, 0xe4, 0xd9, 0x41, 0x74, 0xe2, 0xc7, 0xdc, 0x7a, 0xe2, + 0x48, 0xfa, 0xaa, 0x12, 0x47, 0x9a, 0x06, 0x15, 0x7e, 0x38, 0xf3, 0x88, 0xbb, 0xbf, 0x31, 0xe8, + 0xee, 0x99, 0xc6, 0xb7, 0xba, 0xfa, 0x06, 0x01, 0xa8, 0xc8, 0xe7, 0x82, 0xa6, 0x41, 0xd3, 0x90, + 0xed, 0xd8, 0x63, 0x66, 0x3b, 0x2c, 0xe4, 0x12, 0xfc, 0xe0, 0x47, 0x89, 0x04, 0x3f, 0xf8, 0x91, + 0xf6, 0x17, 0x05, 0x68, 0x98, 0xa1, 0xed, 0x45, 0xb6, 0x30, 0xf7, 0xcf, 0xa0, 0x72, 0x82, 0x58, + 0x74, 0xa3, 0xc6, 0x82, 0x7f, 0x66, 0x17, 0xa3, 0x12, 0x48, 0xee, 0x40, 0xe5, 0xc4, 0xf6, 0x9c, + 0xa9, 0xd0, 0x5a, 0x85, 0xca, 0x51, 0x92, 0x1b, 0x95, 0xf3, 0xdc, 0xb8, 0x05, 0x2b, 0x33, 0x3b, + 0x7c, 0x6e, 0x8d, 0x4f, 0x6c, 0xef, 0x98, 0x45, 0xf2, 0x60, 0xa4, 0x05, 0x36, 0x38, 0x6b, 0x4f, + 0x70, 0xb4, 0xbf, 0x5f, 0x81, 0xf2, 0x37, 0x73, 0x16, 0x9e, 0x65, 0x04, 0xfa, 0xe0, 0xba, 0x02, + 0xc9, 0x17, 0x17, 0x2e, 0x4b, 0xca, 0x6f, 0x2f, 0x26, 0x65, 0x22, 0x53, 0x84, 0xc8, 0x95, 0x22, + 0x0b, 0x7c, 0x9a, 0x09, 0x63, 0xeb, 0x57, 0xd8, 0xda, 0x79, 0x70, 0x7b, 0x08, 0x95, 0x89, 0x3b, + 0x8d, 0x51, 0x75, 0x8b, 0xd5, 0x08, 0xee, 0xa5, 0xf3, 0x08, 0xd9, 0x54, 0xc2, 0xc8, 0xbb, 0xb0, + 0x22, 0x2a, 0x59, 0xeb, 0x07, 0xce, 0xc6, 0x82, 0x95, 0xf7, 0xa6, 0x48, 0x13, 0xbb, 0xff, 0x18, + 0xca, 0x7e, 0xc8, 0x37, 0x5f, 0xc7, 0x25, 0xef, 0x5c, 0x58, 0x72, 0xc8, 0xb9, 0x54, 0x80, 0xc8, + 0x87, 0x50, 0x3a, 0x71, 0xbd, 0x18, 0xb3, 0x46, 0x73, 0xfb, 0xf6, 0x05, 0xf0, 0x63, 0xd7, 0x8b, + 0x29, 0x42, 0x78, 0x98, 0x1f, 0xfb, 0x73, 0x2f, 0x6e, 0xdd, 0xc5, 0x0c, 0x23, 0x06, 0xe4, 0x1e, + 0x54, 0xfc, 0xc9, 0x24, 0x62, 0x31, 0x76, 0x96, 0xe5, 0x9d, 0xc2, 0xa7, 0x54, 0x12, 0xf8, 0x84, + 0xa9, 0x3b, 0x73, 0x63, 0xec, 0x43, 0xca, 0x54, 0x0c, 0xc8, 0x2e, 0xac, 0x8d, 0xfd, 0x59, 0xe0, + 0x4e, 0x99, 0x63, 0x8d, 0xe7, 0x61, 0xe4, 0x87, 0xad, 0x77, 0x2e, 0x1c, 0xd3, 0x9e, 0x44, 0xec, + 0x21, 0x80, 0x36, 0xc7, 0xb9, 0x31, 0x31, 0x60, 0x83, 0x79, 0x8e, 0xb5, 0xb8, 0xce, 0xfd, 0xd7, + 0xad, 0xb3, 0xce, 0x3c, 0x27, 0x4f, 0x4a, 0xc4, 0xc1, 0x48, 0x68, 0x61, 0xcc, 0x68, 0x6d, 0x60, + 0x90, 0xb9, 0x77, 0x69, 0xac, 0x14, 0xe2, 0x64, 0xc2, 0xf7, 0x6f, 0xc0, 0x2d, 0x19, 0x22, 0xad, + 0x80, 0x85, 0x13, 0x36, 0x8e, 0xad, 0x60, 0x6a, 0x7b, 0x58, 0xca, 0xa5, 0xc6, 0x4a, 0x24, 0xe4, + 0x50, 0x20, 0x0e, 0xa7, 0xb6, 0x47, 0x34, 0xa8, 0x3f, 0x67, 0x67, 0x91, 0xc5, 0x23, 0x29, 0x76, + 0xae, 0x29, 0xba, 0xc6, 0xe9, 0x43, 0x6f, 0x7a, 0x46, 0x7e, 0x02, 0x8d, 0xf8, 0xdc, 0xdb, 0xb0, + 0x61, 0x6d, 0xe4, 0x4e, 0x35, 0xe3, 0x8b, 0x34, 0x0b, 0x25, 0xf7, 0xa1, 0x2a, 0x35, 0xd4, 0xba, + 0x97, 0x5d, 0x3b, 0xa1, 0xf2, 0xc4, 0x3c, 0xb1, 0xdd, 0xa9, 0x7f, 0xca, 0x42, 0x6b, 0x16, 0xb5, + 0xda, 0xe2, 0xb6, 0x24, 0x21, 0x1d, 0x44, 0xdc, 0x4f, 0xa3, 0x38, 0xf4, 0xbd, 0xe3, 0xd6, 0x26, + 0xde, 0x93, 0xc8, 0xd1, 0xc5, 0xe0, 0xf7, 0x2e, 0x66, 0xfe, 0x7c, 0xf0, 0xfb, 0x1c, 0xee, 0x60, + 0x65, 0x66, 0x3d, 0x3b, 0xb3, 0xf2, 0x68, 0x0d, 0xd1, 0x1b, 0xc8, 0xdd, 0x3d, 0x3b, 0xcc, 0x4e, + 0x6a, 0x43, 0xcd, 0x71, 0xa3, 0xd8, 0xf5, 0xc6, 0x71, 0xab, 0x85, 0xef, 0x4c, 0xc7, 0xe4, 0x33, + 0xb8, 0x3d, 0x73, 0x3d, 0x2b, 0xb2, 0x27, 0xcc, 0x8a, 0x5d, 0xee, 0x9b, 0x6c, 0xec, 0x7b, 0x4e, + 0xd4, 0x7a, 0x80, 0x82, 0x93, 0x99, 0xeb, 0x8d, 0xec, 0x09, 0x33, 0xdd, 0x19, 0x1b, 0x09, 0x0e, + 0xf9, 0x08, 0xd6, 0x11, 0x1e, 0xb2, 0x60, 0xea, 0x8e, 0x6d, 0xf1, 0xfa, 0x1f, 0xe1, 0xeb, 0xd7, + 0x38, 0x83, 0x0a, 0x3a, 0xbe, 0xfa, 0x63, 0x68, 0x06, 0x2c, 0x8c, 0xdc, 0x28, 0xb6, 0xa4, 0x45, + 0xbf, 0x97, 0xd5, 0xda, 0xaa, 0x64, 0x0e, 0x91, 0xd7, 0xfe, 0xcf, 0x02, 0x54, 0x84, 0x73, 0x92, + 0x4f, 0x41, 0xf1, 0x03, 0xbc, 0x06, 0x69, 0x6e, 0x6f, 0x5e, 0xe2, 0xc1, 0x9d, 0x61, 0xc0, 0xeb, + 0x5e, 0x3f, 0xa4, 0x8a, 0x1f, 0xdc, 0xb8, 0x28, 0xd4, 0xfe, 0x10, 0x6a, 0xc9, 0x02, 0xbc, 0xbc, + 0xe8, 0xeb, 0xa3, 0x91, 0x65, 0x3e, 0xee, 0x0e, 0xd4, 0x02, 0xb9, 0x03, 0x24, 0x1d, 0x5a, 0x43, + 0x6a, 0xe9, 0xdf, 0x1c, 0x75, 0xfb, 0xaa, 0x82, 0x5d, 0x1a, 0xd5, 0xbb, 0xa6, 0x4e, 0x05, 0xb2, + 0x48, 0xee, 0xc1, 0xed, 0x2c, 0xe5, 0x1c, 0x5c, 0xc2, 0x14, 0x8c, 0x8f, 0x65, 0x52, 0x01, 0xc5, + 0x18, 0xa8, 0x15, 0x9e, 0x16, 0xf4, 0xef, 0x8d, 0x91, 0x39, 0x52, 0xab, 0xed, 0xbf, 0x29, 0x40, + 0x19, 0xc3, 0x06, 0x3f, 0x9f, 0x54, 0x72, 0x71, 0x5d, 0x73, 0x5e, 0xb9, 0x1a, 0xd9, 0x92, 0xaa, + 0x81, 0x01, 0x65, 0x73, 0x79, 0xf4, 0xf9, 0xb5, 0xd6, 0x53, 0x3f, 0x85, 0x12, 0x8f, 0x52, 0xbc, + 0x43, 0x1c, 0xd2, 0x9e, 0x4e, 0xad, 0x47, 0x06, 0x1d, 0xf1, 0x2a, 0x97, 0x40, 0xb3, 0x3b, 0xd8, + 0xd3, 0x47, 0xe6, 0x30, 0xa1, 0xa1, 0x56, 0x1e, 0x19, 0x7d, 0x33, 0x45, 0x15, 0xb5, 0x9f, 0xd7, + 0x60, 0x35, 0x89, 0x09, 0x22, 0x82, 0x3e, 0x82, 0x46, 0x10, 0xba, 0x33, 0x3b, 0x3c, 0x8b, 0xc6, + 0xb6, 0x87, 0x49, 0x01, 0xb6, 0x7f, 0xb4, 0x24, 0xaa, 0x88, 0x1d, 0x1d, 0x0a, 0xec, 0x68, 0x6c, + 0x7b, 0x34, 0x3b, 0x91, 0xf4, 0x61, 0x75, 0xc6, 0xc2, 0x63, 0xf6, 0x7b, 0xbe, 0xeb, 0xe1, 0x4a, + 0x55, 0x8c, 0xc8, 0xef, 0x5f, 0xba, 0xd2, 0x01, 0x47, 0xff, 0x8e, 0xef, 0x7a, 0xb8, 0x56, 0x7e, + 0x32, 0xf9, 0x04, 0xea, 0xa2, 0x12, 0x72, 0xd8, 0x04, 0x63, 0xc5, 0xb2, 0xda, 0x4f, 0xd4, 0xe8, + 0x3d, 0x36, 0xc9, 0xc4, 0x65, 0xb8, 0x34, 0x2e, 0x37, 0xb2, 0x71, 0xf9, 0xcd, 0x6c, 0x2c, 0x5a, + 0x11, 0x55, 0x78, 0x1a, 0x84, 0x2e, 0x38, 0x7c, 0x6b, 0x89, 0xc3, 0x77, 0x60, 0x23, 0xf1, 0x55, + 0xcb, 0xf5, 0x26, 0xee, 0x4b, 0x2b, 0x72, 0x5f, 0x89, 0xd8, 0x53, 0xa6, 0xeb, 0x09, 0xcb, 0xe0, + 0x9c, 0x91, 0xfb, 0x8a, 0x11, 0x23, 0xe9, 0xe0, 0x64, 0x0e, 0x5c, 0xc5, 0xab, 0xc9, 0xf7, 0x2e, + 0x55, 0x8f, 0x68, 0xbe, 0x64, 0x46, 0xcc, 0x4d, 0x6d, 0xff, 0x52, 0x81, 0x46, 0xe6, 0x1c, 0x78, + 0xf6, 0x16, 0xca, 0x42, 0x61, 0xc5, 0x55, 0x94, 0x50, 0x1f, 0x4a, 0xfa, 0x26, 0xd4, 0xa3, 0xd8, + 0x0e, 0x63, 0x8b, 0x17, 0x57, 0xb2, 0xdd, 0x45, 0xc2, 0x13, 0x76, 0x46, 0x3e, 0x80, 0x35, 0xc1, + 0x74, 0xbd, 0xf1, 0x74, 0x1e, 0xb9, 0xa7, 0xa2, 0x99, 0xaf, 0xd1, 0x26, 0x92, 0x8d, 0x84, 0x4a, + 0xee, 0x42, 0x95, 0x67, 0x21, 0xbe, 0x86, 0x68, 0xfa, 0x2a, 0xcc, 0x73, 0xf8, 0x0a, 0x0f, 0x60, + 0x95, 0x33, 0xce, 0xe7, 0x57, 0xc4, 0x2d, 0x33, 0xf3, 0x9c, 0xf3, 0xd9, 0x1d, 0xd8, 0x10, 0xaf, + 0x09, 0x44, 0xf1, 0x2a, 0x2b, 0xdc, 0x3b, 0xa8, 0xd8, 0x75, 0x64, 0xc9, 0xb2, 0x56, 0x14, 0x9c, + 0x1f, 0x01, 0xcf, 0x5e, 0x0b, 0xe8, 0xbb, 0x22, 0x94, 0x31, 0xcf, 0xc9, 0x61, 0x77, 0xe1, 0x1d, + 0x8e, 0x9d, 0x7b, 0x76, 0x10, 0x4c, 0x5d, 0xe6, 0x58, 0x53, 0xff, 0x18, 0x43, 0x66, 0x14, 0xdb, + 0xb3, 0xc0, 0x9a, 0x47, 0xad, 0x0d, 0x0c, 0x99, 0x6d, 0xe6, 0x39, 0x47, 0x09, 0xa8, 0xef, 0x1f, + 0x9b, 0x09, 0xe4, 0x28, 0x6a, 0xff, 0x3e, 0xac, 0xe6, 0xec, 0x71, 0x41, 0xa7, 0x35, 0x74, 0xfe, + 0x8c, 0x4e, 0xdf, 0x85, 0x95, 0x20, 0x64, 0xe7, 0xa2, 0xd5, 0x51, 0xb4, 0x86, 0xa0, 0x09, 0xb1, + 0xb6, 0x60, 0x05, 0x79, 0x96, 0x20, 0xe6, 0xf3, 0x63, 0x03, 0x59, 0x87, 0xc8, 0x69, 0xbf, 0x80, + 0x95, 0xec, 0x69, 0x93, 0x77, 0x33, 0x69, 0xa1, 0x99, 0xcb, 0x93, 0x69, 0x76, 0x48, 0x2a, 0xb2, + 0xf5, 0x4b, 0x2a, 0x32, 0x72, 0x9d, 0x8a, 0x4c, 0xfb, 0x2f, 0xd9, 0x9c, 0x65, 0x2a, 0x84, 0x9f, + 0x41, 0x2d, 0x90, 0xf5, 0x38, 0x5a, 0x52, 0xfe, 0x12, 0x3e, 0x0f, 0xee, 0x24, 0x95, 0x3b, 0x4d, + 0xe7, 0xb4, 0xff, 0x56, 0x81, 0x5a, 0x5a, 0xd0, 0xe7, 0x2c, 0xef, 0xcd, 0x05, 0xcb, 0x3b, 0x90, + 0x1a, 0x16, 0x0a, 0x7c, 0x1b, 0xa3, 0xc5, 0x27, 0xaf, 0x7f, 0xd7, 0xc5, 0xb6, 0xe7, 0x34, 0xdb, + 0xf6, 0x6c, 0xbe, 0xae, 0xed, 0xf9, 0xe4, 0xa2, 0xc1, 0xbf, 0x95, 0xe9, 0x2d, 0x16, 0xcc, 0xbe, + 0xfd, 0x7d, 0xae, 0x0f, 0xca, 0x26, 0x84, 0x77, 0xc4, 0x7e, 0xd2, 0x84, 0x90, 0xb6, 0x3f, 0xf7, + 0xaf, 0xd7, 0xfe, 0x6c, 0x43, 0x45, 0xea, 0xfc, 0x0e, 0x54, 0x64, 0x4d, 0x27, 0x1b, 0x04, 0x31, + 0x3a, 0x6f, 0x10, 0x0a, 0xb2, 0x4e, 0xd7, 0x7e, 0xae, 0x40, 0x59, 0x0f, 0x43, 0x3f, 0xd4, 0xfe, + 0x48, 0x81, 0x3a, 0x3e, 0xed, 0xf9, 0x0e, 0xe3, 0xd9, 0x60, 0xb7, 0xdb, 0xb3, 0xa8, 0xfe, 0xcd, + 0x91, 0x8e, 0xd9, 0xa0, 0x0d, 0x77, 0xf6, 0x86, 0x83, 0xbd, 0x23, 0x4a, 0xf5, 0x81, 0x69, 0x99, + 0xb4, 0x3b, 0x18, 0xf1, 0xb6, 0x67, 0x38, 0x50, 0x15, 0x9e, 0x29, 0x8c, 0x81, 0xa9, 0xd3, 0x41, + 0xb7, 0x6f, 0x89, 0x56, 0xb4, 0x88, 0x77, 0xb3, 0xba, 0xde, 0xb3, 0xf0, 0xd6, 0x51, 0x2d, 0xf1, + 0x96, 0xd5, 0x34, 0x0e, 0xf4, 0xe1, 0x91, 0xa9, 0x96, 0xc9, 0x6d, 0x58, 0x3f, 0xd4, 0xe9, 0x81, + 0x31, 0x1a, 0x19, 0xc3, 0x81, 0xd5, 0xd3, 0x07, 0x86, 0xde, 0x53, 0x2b, 0x7c, 0x9d, 0x5d, 0x63, + 0xdf, 0xec, 0xee, 0xf6, 0x75, 0xb9, 0x4e, 0x95, 0x6c, 0xc2, 0x5b, 0x7b, 0xc3, 0x83, 0x03, 0xc3, + 0x34, 0xf5, 0x9e, 0xb5, 0x7b, 0x64, 0x5a, 0x23, 0xd3, 0xe8, 0xf7, 0xad, 0xee, 0xe1, 0x61, 0xff, + 0x29, 0x4f, 0x60, 0x35, 0x72, 0x17, 0x36, 0xf6, 0xba, 0x87, 0xdd, 0x5d, 0xa3, 0x6f, 0x98, 0x4f, + 0xad, 0x9e, 0x31, 0xe2, 0xf3, 0x7b, 0x6a, 0x9d, 0x27, 0x6c, 0x93, 0x3e, 0xb5, 0xba, 0x7d, 0x14, + 0xcd, 0xd4, 0xad, 0xdd, 0xee, 0xde, 0x13, 0x7d, 0xd0, 0x53, 0x81, 0x0b, 0x30, 0xea, 0x3e, 0xd2, + 0x2d, 0x2e, 0x92, 0x65, 0x0e, 0x87, 0xd6, 0xb0, 0xdf, 0x53, 0x1b, 0xda, 0xbf, 0x14, 0xa1, 0xb4, + 0xe7, 0x47, 0x31, 0xf7, 0x46, 0xe1, 0xac, 0x2f, 0x42, 0x37, 0x66, 0xa2, 0x7f, 0x2b, 0x53, 0xd1, + 0x4b, 0x7f, 0x87, 0x24, 0x1e, 0x50, 0x32, 0x10, 0xeb, 0xd9, 0x19, 0xc7, 0x29, 0x88, 0x5b, 0x3b, + 0xc7, 0xed, 0x72, 0xb2, 0x88, 0x68, 0x78, 0x85, 0x23, 0xd7, 0x2b, 0x22, 0x4e, 0x06, 0x61, 0xb9, + 0xe0, 0xc7, 0x40, 0xb2, 0x20, 0xb9, 0x62, 0x09, 0x91, 0x6a, 0x06, 0x29, 0x96, 0xdc, 0x01, 0x18, + 0xfb, 0xb3, 0x99, 0x1b, 0x8f, 0xfd, 0x28, 0x96, 0x5f, 0xc8, 0xda, 0x39, 0x63, 0x8f, 0x62, 0x6e, + 0xf1, 0x33, 0x37, 0xe6, 0x8f, 0x34, 0x83, 0x26, 0x3b, 0x70, 0xcf, 0x0e, 0x82, 0xd0, 0x7f, 0xe9, + 0xce, 0xec, 0x98, 0x59, 0xdc, 0x73, 0xed, 0x63, 0x66, 0x39, 0x6c, 0x1a, 0xdb, 0xd8, 0x13, 0x95, + 0xe9, 0xdd, 0x0c, 0x60, 0x24, 0xf8, 0x3d, 0xce, 0xe6, 0x71, 0xd7, 0x75, 0xac, 0x88, 0xfd, 0x30, + 0xe7, 0x1e, 0x60, 0xcd, 0x03, 0xc7, 0xe6, 0x62, 0xd6, 0x45, 0x96, 0x72, 0x9d, 0x91, 0xe4, 0x1c, + 0x09, 0x46, 0xfb, 0x15, 0xc0, 0xb9, 0x14, 0x64, 0x1b, 0x6e, 0xf3, 0x3a, 0x9e, 0x45, 0x31, 0x73, + 0x2c, 0xb9, 0xdb, 0x60, 0x1e, 0x47, 0x18, 0xe2, 0xcb, 0x74, 0x23, 0x65, 0xca, 0x9b, 0xc2, 0x79, + 0x1c, 0x91, 0x9f, 0x40, 0xeb, 0xc2, 0x1c, 0x87, 0x4d, 0x19, 0x7f, 0x6d, 0x15, 0xa7, 0xdd, 0x59, + 0x98, 0xd6, 0x13, 0x5c, 0xed, 0x4f, 0x14, 0x80, 0x7d, 0x16, 0x53, 0xc1, 0xcd, 0x34, 0xb6, 0x95, + 0xeb, 0x36, 0xb6, 0xef, 0x27, 0x17, 0x08, 0xc5, 0xab, 0x63, 0xc0, 0x42, 0x97, 0xa1, 0xdc, 0xa4, + 0xcb, 0xc8, 0x35, 0x11, 0xc5, 0x2b, 0x9a, 0x88, 0x52, 0xae, 0x89, 0xf8, 0x18, 0x9a, 0xf6, 0x74, + 0xea, 0xbf, 0xe0, 0x05, 0x0d, 0x0b, 0x43, 0xe6, 0xa0, 0x11, 0x9c, 0xd7, 0xdb, 0xc8, 0xec, 0x49, + 0x9e, 0xf6, 0xe7, 0x0a, 0x34, 0x50, 0x15, 0x51, 0xe0, 0x7b, 0x11, 0x23, 0x5f, 0x42, 0x45, 0x5e, + 0x44, 0x8b, 0x8b, 0xfc, 0xb7, 0x33, 0xb2, 0x66, 0x70, 0xb2, 0x68, 0xa0, 0x12, 0xcc, 0x33, 0x42, + 0xe6, 0x75, 0x97, 0x2b, 0x25, 0x45, 0x91, 0xfb, 0x50, 0x73, 0x3d, 0x4b, 0xb4, 0xd4, 0x95, 0x4c, + 0x58, 0xac, 0xba, 0x1e, 0xd6, 0xb2, 0xed, 0x57, 0x50, 0x11, 0x2f, 0x21, 0x9d, 0x54, 0xa6, 0x8b, + 0xfa, 0xcb, 0xdc, 0x1c, 0xa7, 0xc2, 0xc8, 0xc3, 0x29, 0xbd, 0x2e, 0x40, 0xb7, 0xa0, 0x7a, 0xca, + 0x9b, 0x0f, 0xbc, 0xf4, 0xe3, 0xea, 0x4d, 0x86, 0xda, 0x1f, 0x97, 0x00, 0x0e, 0xe7, 0x4b, 0x0c, + 0xa4, 0x71, 0x5d, 0x03, 0xe9, 0xe4, 0xf4, 0xf8, 0x7a, 0x99, 0x7f, 0x75, 0x43, 0x59, 0xd2, 0x69, + 0x17, 0x6f, 0xda, 0x69, 0xdf, 0x87, 0x6a, 0x1c, 0xce, 0xb9, 0xa3, 0x08, 0x63, 0x4a, 0x5b, 0x5a, + 0x49, 0x25, 0x6f, 0x42, 0x79, 0xe2, 0x87, 0x63, 0x86, 0x8e, 0x95, 0xb2, 0x05, 0xed, 0xc2, 0x65, + 0x52, 0xed, 0xb2, 0xcb, 0x24, 0xde, 0xa0, 0x45, 0xf2, 0x1e, 0x0d, 0x0b, 0x99, 0x7c, 0x83, 0x96, + 0x5c, 0xb1, 0xd1, 0x14, 0x44, 0xbe, 0x81, 0xa6, 0x3d, 0x8f, 0x7d, 0xcb, 0xe5, 0x15, 0xda, 0xd4, + 0x1d, 0x9f, 0x61, 0xd9, 0xdd, 0xcc, 0x7f, 0xaf, 0x4f, 0x0f, 0xaa, 0xd3, 0x9d, 0xc7, 0xbe, 0xe1, + 0x1c, 0x22, 0x72, 0xa7, 0x2a, 0x93, 0x12, 0x5d, 0xb1, 0x33, 0x64, 0xed, 0xc7, 0xb0, 0x92, 0x85, + 0xf1, 0x04, 0x24, 0x81, 0xea, 0x1b, 0x3c, 0x3b, 0x8d, 0x78, 0x6a, 0x1b, 0x98, 0x46, 0xb7, 0xaf, + 0x16, 0xb4, 0x18, 0x1a, 0xb8, 0xbc, 0xf4, 0x8e, 0xeb, 0xba, 0xfd, 0x03, 0x28, 0x61, 0xf8, 0x55, + 0x2e, 0x7c, 0x0f, 0xc1, 0x98, 0x8b, 0xcc, 0xbc, 0xf9, 0x15, 0xb3, 0xe6, 0xf7, 0xdf, 0x05, 0x58, + 0x31, 0xfd, 0xf9, 0xf8, 0xe4, 0xa2, 0x01, 0xc2, 0xaf, 0x3b, 0x42, 0x2d, 0x31, 0x1f, 0xe5, 0xa6, + 0xe6, 0x93, 0x5a, 0x47, 0x71, 0x89, 0x75, 0xdc, 0xf4, 0xcc, 0xb5, 0x2f, 0x60, 0x55, 0x6e, 0x5e, + 0x6a, 0x3d, 0xd1, 0x66, 0xe1, 0x0a, 0x6d, 0x6a, 0xbf, 0x50, 0x60, 0x55, 0xc4, 0xf7, 0xff, 0xbb, + 0xd2, 0x2a, 0x37, 0x0c, 0xeb, 0xe5, 0x1b, 0x5d, 0x1e, 0xfd, 0xbf, 0xf4, 0x34, 0x6d, 0x08, 0xcd, + 0x44, 0x7d, 0x37, 0x50, 0xfb, 0x15, 0x46, 0xfc, 0x8b, 0x02, 0x34, 0x06, 0xec, 0xe5, 0x92, 0x20, + 0x5a, 0xbe, 0xee, 0x71, 0x7c, 0x98, 0x2b, 0x57, 0x1b, 0xdb, 0xeb, 0x59, 0x19, 0xc4, 0xd5, 0x63, + 0x52, 0xc1, 0xa6, 0xb7, 0xa8, 0xca, 0xf2, 0x5b, 0xd4, 0xd2, 0x62, 0xb7, 0x9e, 0xb9, 0xc5, 0x2b, + 0x2e, 0xbb, 0xc5, 0xd3, 0xfe, 0xad, 0x08, 0x0d, 0x6c, 0x90, 0x29, 0x8b, 0xe6, 0xd3, 0x38, 0x27, + 0x4c, 0xe1, 0x6a, 0x61, 0x3a, 0x50, 0x09, 0x71, 0x92, 0x74, 0xa5, 0x4b, 0x83, 0xbf, 0x40, 0x61, + 0x6b, 0xfc, 0xdc, 0x0d, 0x02, 0xe6, 0x58, 0x82, 0x92, 0x14, 0x30, 0x4d, 0x49, 0x16, 0x22, 0x44, + 0xbc, 0xfc, 0x9c, 0xf9, 0x21, 0x4b, 0x51, 0x45, 0xbc, 0x4f, 0x68, 0x70, 0x5a, 0x02, 0xc9, 0xdd, + 0x37, 0x88, 0xca, 0xe0, 0xfc, 0xbe, 0x21, 0xed, 0x35, 0x91, 0x5b, 0x47, 0xae, 0xe8, 0x35, 0x91, + 0xcd, 0xbb, 0xa8, 0x99, 0x3d, 0x9d, 0x5a, 0x7e, 0x10, 0xa1, 0xd3, 0xd4, 0x68, 0x0d, 0x09, 0xc3, + 0x20, 0x22, 0x5f, 0x43, 0x7a, 0x5d, 0x2c, 0x6f, 0xc9, 0xc5, 0x39, 0xb6, 0x2e, 0xbb, 0x58, 0xa0, + 0xab, 0xe3, 0xdc, 0xfd, 0xcf, 0x92, 0x1b, 0xea, 0xca, 0x4d, 0x6f, 0xa8, 0x1f, 0x42, 0x59, 0xc4, + 0xa8, 0xda, 0xeb, 0x62, 0x94, 0xc0, 0x65, 0xed, 0xb3, 0x91, 0xb7, 0xcf, 0x5f, 0x16, 0x80, 0x74, + 0xa7, 0x53, 0x7f, 0x6c, 0xc7, 0xcc, 0x70, 0xa2, 0x8b, 0x66, 0x7a, 0xed, 0xcf, 0x2e, 0x9f, 0x41, + 0x7d, 0xe6, 0x3b, 0x6c, 0x6a, 0x25, 0xdf, 0x94, 0x2e, 0xad, 0x7e, 0x10, 0xc6, 0x5b, 0x52, 0x02, + 0x25, 0xbc, 0xc4, 0x51, 0xb0, 0xee, 0xc0, 0x67, 0xde, 0x84, 0xcd, 0xec, 0x97, 0xb2, 0x14, 0xe1, + 0x8f, 0xa4, 0x03, 0xd5, 0x90, 0x45, 0x2c, 0x3c, 0x65, 0x57, 0x16, 0x55, 0x09, 0x48, 0x7b, 0x06, + 0x1b, 0xb9, 0x1d, 0x49, 0x47, 0xbe, 0x85, 0x5f, 0x2b, 0xc3, 0x58, 0x7e, 0xb4, 0x12, 0x03, 0xfe, + 0x3a, 0xe6, 0x25, 0x9f, 0x41, 0xf9, 0x63, 0xea, 0xf0, 0xc5, 0xab, 0xe2, 0xec, 0x1e, 0xa8, 0x59, + 0x4d, 0xbb, 0x63, 0x0c, 0x36, 0xf2, 0x54, 0x0a, 0xd7, 0x3b, 0x15, 0xed, 0xef, 0x0a, 0xb0, 0xde, + 0x75, 0x1c, 0xf1, 0x77, 0xc3, 0x25, 0xaa, 0x2f, 0x5e, 0x57, 0xf5, 0x0b, 0x81, 0x58, 0x84, 0x89, + 0x6b, 0x05, 0xe2, 0x0f, 0xa1, 0x92, 0xd6, 0x5a, 0xc5, 0x05, 0x77, 0x16, 0x72, 0x51, 0x09, 0xd0, + 0x6e, 0x01, 0xc9, 0x0a, 0x2b, 0xb4, 0xaa, 0xfd, 0x69, 0x11, 0xee, 0xee, 0xb2, 0x63, 0xd7, 0xcb, + 0xbe, 0xe2, 0x57, 0xdf, 0xc9, 0xc5, 0x4f, 0x65, 0x9f, 0xc1, 0xba, 0x28, 0xe4, 0x93, 0x7f, 0x62, + 0x59, 0xec, 0x58, 0x7e, 0x9d, 0x94, 0xb1, 0x6a, 0x0d, 0xf9, 0x07, 0x92, 0xad, 0xe3, 0x7f, 0xc5, + 0x1c, 0x3b, 0xb6, 0x9f, 0xd9, 0x11, 0xb3, 0x5c, 0x47, 0xfe, 0x59, 0x06, 0x12, 0x92, 0xe1, 0x90, + 0x21, 0x94, 0xb8, 0x0d, 0xa2, 0xeb, 0x36, 0xb7, 0xb7, 0x33, 0x62, 0x5d, 0xb2, 0x95, 0xac, 0x02, + 0x0f, 0x7c, 0x87, 0xed, 0x54, 0x8f, 0x06, 0x4f, 0x06, 0xc3, 0xef, 0x06, 0x14, 0x17, 0x22, 0x06, + 0xdc, 0x0a, 0x42, 0x76, 0xea, 0xfa, 0xf3, 0xc8, 0xca, 0x9e, 0x44, 0xf5, 0xca, 0x94, 0xb8, 0x91, + 0xcc, 0xc9, 0x10, 0xb5, 0x9f, 0xc2, 0xda, 0xc2, 0xcb, 0x78, 0x6d, 0x26, 0x5f, 0xa7, 0xbe, 0x41, + 0x56, 0xa1, 0x8e, 0x1f, 0xbb, 0x97, 0x7f, 0xfb, 0xd6, 0xfe, 0xb5, 0x80, 0x57, 0x4c, 0x33, 0x37, + 0xbe, 0x59, 0x06, 0xfb, 0xcd, 0x7c, 0x06, 0x83, 0xed, 0x77, 0xf3, 0xe6, 0x9b, 0x59, 0xb0, 0xf3, + 0xad, 0x00, 0xa6, 0x41, 0xa4, 0x6d, 0x43, 0x55, 0xd2, 0xc8, 0x6f, 0xc1, 0x5a, 0xe8, 0xfb, 0x71, + 0xd2, 0x89, 0x8a, 0x0e, 0xe4, 0xf2, 0x3f, 0xdb, 0xac, 0x72, 0xb0, 0x48, 0x06, 0x4f, 0xf2, 0xbd, + 0x48, 0x59, 0xfc, 0x0d, 0x44, 0x0e, 0x77, 0x1b, 0xbf, 0x5b, 0x4f, 0xff, 0xb7, 0xfb, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x35, 0x9f, 0x30, 0x98, 0xf2, 0x2b, 0x00, 0x00, } diff --git a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto b/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto index e76f126ff7..497b4d9a9a 100644 --- a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto +++ b/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto @@ -529,6 +529,16 @@ message BeginTransactionRequest { required string app = 1; optional bool allow_multiple_eg = 2 [default = false]; + optional string database_id = 4; + + enum TransactionMode { + UNKNOWN = 0; + READ_ONLY = 1; + READ_WRITE = 2; + } + optional TransactionMode mode = 5 [default = UNKNOWN]; + + optional Transaction previous_transaction = 7; } message CommitResponse { diff --git a/vendor/google.golang.org/appengine/internal/identity_classic.go b/vendor/google.golang.org/appengine/internal/identity_classic.go index e6b9227c56..b59603f132 100644 --- a/vendor/google.golang.org/appengine/internal/identity_classic.go +++ b/vendor/google.golang.org/appengine/internal/identity_classic.go @@ -13,15 +13,45 @@ import ( ) func DefaultVersionHostname(ctx netcontext.Context) string { - return appengine.DefaultVersionHostname(fromContext(ctx)) + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.DefaultVersionHostname(c) } -func RequestID(ctx netcontext.Context) string { return appengine.RequestID(fromContext(ctx)) } -func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } -func ServerSoftware() string { return appengine.ServerSoftware() } -func ModuleName(ctx netcontext.Context) string { return appengine.ModuleName(fromContext(ctx)) } -func VersionID(ctx netcontext.Context) string { return appengine.VersionID(fromContext(ctx)) } -func InstanceID() string { return appengine.InstanceID() } -func IsDevAppServer() bool { return appengine.IsDevAppServer() } +func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } +func ServerSoftware() string { return appengine.ServerSoftware() } +func InstanceID() string { return appengine.InstanceID() } +func IsDevAppServer() bool { return appengine.IsDevAppServer() } -func fullyQualifiedAppID(ctx netcontext.Context) string { return fromContext(ctx).FullyQualifiedAppID() } +func RequestID(ctx netcontext.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.RequestID(c) +} + +func ModuleName(ctx netcontext.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.ModuleName(c) +} +func VersionID(ctx netcontext.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.VersionID(c) +} + +func fullyQualifiedAppID(ctx netcontext.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return c.FullyQualifiedAppID() +} diff --git a/vendor/google.golang.org/appengine/internal/identity_vm.go b/vendor/google.golang.org/appengine/internal/identity_vm.go index ebe68b785b..d5fa75be78 100644 --- a/vendor/google.golang.org/appengine/internal/identity_vm.go +++ b/vendor/google.golang.org/appengine/internal/identity_vm.go @@ -23,7 +23,11 @@ const ( ) func ctxHeaders(ctx netcontext.Context) http.Header { - return fromContext(ctx).Request().Header + c := fromContext(ctx) + if c == nil { + return nil + } + return c.Request().Header } func DefaultVersionHostname(ctx netcontext.Context) string { diff --git a/vendor/google.golang.org/appengine/internal/log/log_service.pb.go b/vendor/google.golang.org/appengine/internal/log/log_service.pb.go index 20c595be30..5549605ad7 100644 --- a/vendor/google.golang.org/appengine/internal/log/log_service.pb.go +++ b/vendor/google.golang.org/appengine/internal/log/log_service.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: google.golang.org/appengine/internal/log/log_service.proto -// DO NOT EDIT! /* Package log is a generated protocol buffer package. @@ -35,6 +34,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type LogServiceError_ErrorCode int32 const ( @@ -70,25 +75,28 @@ func (x *LogServiceError_ErrorCode) UnmarshalJSON(data []byte) error { *x = LogServiceError_ErrorCode(value) return nil } +func (LogServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } type LogServiceError struct { XXX_unrecognized []byte `json:"-"` } -func (m *LogServiceError) Reset() { *m = LogServiceError{} } -func (m *LogServiceError) String() string { return proto.CompactTextString(m) } -func (*LogServiceError) ProtoMessage() {} +func (m *LogServiceError) Reset() { *m = LogServiceError{} } +func (m *LogServiceError) String() string { return proto.CompactTextString(m) } +func (*LogServiceError) ProtoMessage() {} +func (*LogServiceError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type UserAppLogLine struct { - TimestampUsec *int64 `protobuf:"varint,1,req,name=timestamp_usec" json:"timestamp_usec,omitempty"` + TimestampUsec *int64 `protobuf:"varint,1,req,name=timestamp_usec,json=timestampUsec" json:"timestamp_usec,omitempty"` Level *int64 `protobuf:"varint,2,req,name=level" json:"level,omitempty"` Message *string `protobuf:"bytes,3,req,name=message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *UserAppLogLine) Reset() { *m = UserAppLogLine{} } -func (m *UserAppLogLine) String() string { return proto.CompactTextString(m) } -func (*UserAppLogLine) ProtoMessage() {} +func (m *UserAppLogLine) Reset() { *m = UserAppLogLine{} } +func (m *UserAppLogLine) String() string { return proto.CompactTextString(m) } +func (*UserAppLogLine) ProtoMessage() {} +func (*UserAppLogLine) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *UserAppLogLine) GetTimestampUsec() int64 { if m != nil && m.TimestampUsec != nil { @@ -112,13 +120,14 @@ func (m *UserAppLogLine) GetMessage() string { } type UserAppLogGroup struct { - LogLine []*UserAppLogLine `protobuf:"bytes,2,rep,name=log_line" json:"log_line,omitempty"` + LogLine []*UserAppLogLine `protobuf:"bytes,2,rep,name=log_line,json=logLine" json:"log_line,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *UserAppLogGroup) Reset() { *m = UserAppLogGroup{} } -func (m *UserAppLogGroup) String() string { return proto.CompactTextString(m) } -func (*UserAppLogGroup) ProtoMessage() {} +func (m *UserAppLogGroup) Reset() { *m = UserAppLogGroup{} } +func (m *UserAppLogGroup) String() string { return proto.CompactTextString(m) } +func (*UserAppLogGroup) ProtoMessage() {} +func (*UserAppLogGroup) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *UserAppLogGroup) GetLogLine() []*UserAppLogLine { if m != nil { @@ -132,9 +141,10 @@ type FlushRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *FlushRequest) Reset() { *m = FlushRequest{} } -func (m *FlushRequest) String() string { return proto.CompactTextString(m) } -func (*FlushRequest) ProtoMessage() {} +func (m *FlushRequest) Reset() { *m = FlushRequest{} } +func (m *FlushRequest) String() string { return proto.CompactTextString(m) } +func (*FlushRequest) ProtoMessage() {} +func (*FlushRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *FlushRequest) GetLogs() []byte { if m != nil { @@ -148,9 +158,10 @@ type SetStatusRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *SetStatusRequest) Reset() { *m = SetStatusRequest{} } -func (m *SetStatusRequest) String() string { return proto.CompactTextString(m) } -func (*SetStatusRequest) ProtoMessage() {} +func (m *SetStatusRequest) Reset() { *m = SetStatusRequest{} } +func (m *SetStatusRequest) String() string { return proto.CompactTextString(m) } +func (*SetStatusRequest) ProtoMessage() {} +func (*SetStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *SetStatusRequest) GetStatus() string { if m != nil && m.Status != nil { @@ -160,13 +171,14 @@ func (m *SetStatusRequest) GetStatus() string { } type LogOffset struct { - RequestId []byte `protobuf:"bytes,1,opt,name=request_id" json:"request_id,omitempty"` + RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogOffset) Reset() { *m = LogOffset{} } -func (m *LogOffset) String() string { return proto.CompactTextString(m) } -func (*LogOffset) ProtoMessage() {} +func (m *LogOffset) Reset() { *m = LogOffset{} } +func (m *LogOffset) String() string { return proto.CompactTextString(m) } +func (*LogOffset) ProtoMessage() {} +func (*LogOffset) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *LogOffset) GetRequestId() []byte { if m != nil { @@ -178,13 +190,14 @@ func (m *LogOffset) GetRequestId() []byte { type LogLine struct { Time *int64 `protobuf:"varint,1,req,name=time" json:"time,omitempty"` Level *int32 `protobuf:"varint,2,req,name=level" json:"level,omitempty"` - LogMessage *string `protobuf:"bytes,3,req,name=log_message" json:"log_message,omitempty"` + LogMessage *string `protobuf:"bytes,3,req,name=log_message,json=logMessage" json:"log_message,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogLine) Reset() { *m = LogLine{} } -func (m *LogLine) String() string { return proto.CompactTextString(m) } -func (*LogLine) ProtoMessage() {} +func (m *LogLine) Reset() { *m = LogLine{} } +func (m *LogLine) String() string { return proto.CompactTextString(m) } +func (*LogLine) ProtoMessage() {} +func (*LogLine) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *LogLine) GetTime() int64 { if m != nil && m.Time != nil { @@ -208,50 +221,51 @@ func (m *LogLine) GetLogMessage() string { } type RequestLog struct { - AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - ModuleId *string `protobuf:"bytes,37,opt,name=module_id,def=default" json:"module_id,omitempty"` - VersionId *string `protobuf:"bytes,2,req,name=version_id" json:"version_id,omitempty"` - RequestId []byte `protobuf:"bytes,3,req,name=request_id" json:"request_id,omitempty"` + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + ModuleId *string `protobuf:"bytes,37,opt,name=module_id,json=moduleId,def=default" json:"module_id,omitempty"` + VersionId *string `protobuf:"bytes,2,req,name=version_id,json=versionId" json:"version_id,omitempty"` + RequestId []byte `protobuf:"bytes,3,req,name=request_id,json=requestId" json:"request_id,omitempty"` Offset *LogOffset `protobuf:"bytes,35,opt,name=offset" json:"offset,omitempty"` Ip *string `protobuf:"bytes,4,req,name=ip" json:"ip,omitempty"` Nickname *string `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` - StartTime *int64 `protobuf:"varint,6,req,name=start_time" json:"start_time,omitempty"` - EndTime *int64 `protobuf:"varint,7,req,name=end_time" json:"end_time,omitempty"` + StartTime *int64 `protobuf:"varint,6,req,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int64 `protobuf:"varint,7,req,name=end_time,json=endTime" json:"end_time,omitempty"` Latency *int64 `protobuf:"varint,8,req,name=latency" json:"latency,omitempty"` Mcycles *int64 `protobuf:"varint,9,req,name=mcycles" json:"mcycles,omitempty"` Method *string `protobuf:"bytes,10,req,name=method" json:"method,omitempty"` Resource *string `protobuf:"bytes,11,req,name=resource" json:"resource,omitempty"` - HttpVersion *string `protobuf:"bytes,12,req,name=http_version" json:"http_version,omitempty"` + HttpVersion *string `protobuf:"bytes,12,req,name=http_version,json=httpVersion" json:"http_version,omitempty"` Status *int32 `protobuf:"varint,13,req,name=status" json:"status,omitempty"` - ResponseSize *int64 `protobuf:"varint,14,req,name=response_size" json:"response_size,omitempty"` + ResponseSize *int64 `protobuf:"varint,14,req,name=response_size,json=responseSize" json:"response_size,omitempty"` Referrer *string `protobuf:"bytes,15,opt,name=referrer" json:"referrer,omitempty"` - UserAgent *string `protobuf:"bytes,16,opt,name=user_agent" json:"user_agent,omitempty"` - UrlMapEntry *string `protobuf:"bytes,17,req,name=url_map_entry" json:"url_map_entry,omitempty"` + UserAgent *string `protobuf:"bytes,16,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"` + UrlMapEntry *string `protobuf:"bytes,17,req,name=url_map_entry,json=urlMapEntry" json:"url_map_entry,omitempty"` Combined *string `protobuf:"bytes,18,req,name=combined" json:"combined,omitempty"` - ApiMcycles *int64 `protobuf:"varint,19,opt,name=api_mcycles" json:"api_mcycles,omitempty"` + ApiMcycles *int64 `protobuf:"varint,19,opt,name=api_mcycles,json=apiMcycles" json:"api_mcycles,omitempty"` Host *string `protobuf:"bytes,20,opt,name=host" json:"host,omitempty"` Cost *float64 `protobuf:"fixed64,21,opt,name=cost" json:"cost,omitempty"` - TaskQueueName *string `protobuf:"bytes,22,opt,name=task_queue_name" json:"task_queue_name,omitempty"` - TaskName *string `protobuf:"bytes,23,opt,name=task_name" json:"task_name,omitempty"` - WasLoadingRequest *bool `protobuf:"varint,24,opt,name=was_loading_request" json:"was_loading_request,omitempty"` - PendingTime *int64 `protobuf:"varint,25,opt,name=pending_time" json:"pending_time,omitempty"` - ReplicaIndex *int32 `protobuf:"varint,26,opt,name=replica_index,def=-1" json:"replica_index,omitempty"` + TaskQueueName *string `protobuf:"bytes,22,opt,name=task_queue_name,json=taskQueueName" json:"task_queue_name,omitempty"` + TaskName *string `protobuf:"bytes,23,opt,name=task_name,json=taskName" json:"task_name,omitempty"` + WasLoadingRequest *bool `protobuf:"varint,24,opt,name=was_loading_request,json=wasLoadingRequest" json:"was_loading_request,omitempty"` + PendingTime *int64 `protobuf:"varint,25,opt,name=pending_time,json=pendingTime" json:"pending_time,omitempty"` + ReplicaIndex *int32 `protobuf:"varint,26,opt,name=replica_index,json=replicaIndex,def=-1" json:"replica_index,omitempty"` Finished *bool `protobuf:"varint,27,opt,name=finished,def=1" json:"finished,omitempty"` - CloneKey []byte `protobuf:"bytes,28,opt,name=clone_key" json:"clone_key,omitempty"` + CloneKey []byte `protobuf:"bytes,28,opt,name=clone_key,json=cloneKey" json:"clone_key,omitempty"` Line []*LogLine `protobuf:"bytes,29,rep,name=line" json:"line,omitempty"` - LinesIncomplete *bool `protobuf:"varint,36,opt,name=lines_incomplete" json:"lines_incomplete,omitempty"` - AppEngineRelease []byte `protobuf:"bytes,38,opt,name=app_engine_release" json:"app_engine_release,omitempty"` - ExitReason *int32 `protobuf:"varint,30,opt,name=exit_reason" json:"exit_reason,omitempty"` - WasThrottledForTime *bool `protobuf:"varint,31,opt,name=was_throttled_for_time" json:"was_throttled_for_time,omitempty"` - WasThrottledForRequests *bool `protobuf:"varint,32,opt,name=was_throttled_for_requests" json:"was_throttled_for_requests,omitempty"` - ThrottledTime *int64 `protobuf:"varint,33,opt,name=throttled_time" json:"throttled_time,omitempty"` - ServerName []byte `protobuf:"bytes,34,opt,name=server_name" json:"server_name,omitempty"` + LinesIncomplete *bool `protobuf:"varint,36,opt,name=lines_incomplete,json=linesIncomplete" json:"lines_incomplete,omitempty"` + AppEngineRelease []byte `protobuf:"bytes,38,opt,name=app_engine_release,json=appEngineRelease" json:"app_engine_release,omitempty"` + ExitReason *int32 `protobuf:"varint,30,opt,name=exit_reason,json=exitReason" json:"exit_reason,omitempty"` + WasThrottledForTime *bool `protobuf:"varint,31,opt,name=was_throttled_for_time,json=wasThrottledForTime" json:"was_throttled_for_time,omitempty"` + WasThrottledForRequests *bool `protobuf:"varint,32,opt,name=was_throttled_for_requests,json=wasThrottledForRequests" json:"was_throttled_for_requests,omitempty"` + ThrottledTime *int64 `protobuf:"varint,33,opt,name=throttled_time,json=throttledTime" json:"throttled_time,omitempty"` + ServerName []byte `protobuf:"bytes,34,opt,name=server_name,json=serverName" json:"server_name,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *RequestLog) Reset() { *m = RequestLog{} } -func (m *RequestLog) String() string { return proto.CompactTextString(m) } -func (*RequestLog) ProtoMessage() {} +func (m *RequestLog) Reset() { *m = RequestLog{} } +func (m *RequestLog) String() string { return proto.CompactTextString(m) } +func (*RequestLog) ProtoMessage() {} +func (*RequestLog) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } const Default_RequestLog_ModuleId string = "default" const Default_RequestLog_ReplicaIndex int32 = -1 @@ -524,14 +538,15 @@ func (m *RequestLog) GetServerName() []byte { } type LogModuleVersion struct { - ModuleId *string `protobuf:"bytes,1,opt,name=module_id,def=default" json:"module_id,omitempty"` - VersionId *string `protobuf:"bytes,2,opt,name=version_id" json:"version_id,omitempty"` + ModuleId *string `protobuf:"bytes,1,opt,name=module_id,json=moduleId,def=default" json:"module_id,omitempty"` + VersionId *string `protobuf:"bytes,2,opt,name=version_id,json=versionId" json:"version_id,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogModuleVersion) Reset() { *m = LogModuleVersion{} } -func (m *LogModuleVersion) String() string { return proto.CompactTextString(m) } -func (*LogModuleVersion) ProtoMessage() {} +func (m *LogModuleVersion) Reset() { *m = LogModuleVersion{} } +func (m *LogModuleVersion) String() string { return proto.CompactTextString(m) } +func (*LogModuleVersion) ProtoMessage() {} +func (*LogModuleVersion) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } const Default_LogModuleVersion_ModuleId string = "default" @@ -550,31 +565,32 @@ func (m *LogModuleVersion) GetVersionId() string { } type LogReadRequest struct { - AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - VersionId []string `protobuf:"bytes,2,rep,name=version_id" json:"version_id,omitempty"` - ModuleVersion []*LogModuleVersion `protobuf:"bytes,19,rep,name=module_version" json:"module_version,omitempty"` - StartTime *int64 `protobuf:"varint,3,opt,name=start_time" json:"start_time,omitempty"` - EndTime *int64 `protobuf:"varint,4,opt,name=end_time" json:"end_time,omitempty"` + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + VersionId []string `protobuf:"bytes,2,rep,name=version_id,json=versionId" json:"version_id,omitempty"` + ModuleVersion []*LogModuleVersion `protobuf:"bytes,19,rep,name=module_version,json=moduleVersion" json:"module_version,omitempty"` + StartTime *int64 `protobuf:"varint,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int64 `protobuf:"varint,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` Offset *LogOffset `protobuf:"bytes,5,opt,name=offset" json:"offset,omitempty"` - RequestId [][]byte `protobuf:"bytes,6,rep,name=request_id" json:"request_id,omitempty"` - MinimumLogLevel *int32 `protobuf:"varint,7,opt,name=minimum_log_level" json:"minimum_log_level,omitempty"` - IncludeIncomplete *bool `protobuf:"varint,8,opt,name=include_incomplete" json:"include_incomplete,omitempty"` + RequestId [][]byte `protobuf:"bytes,6,rep,name=request_id,json=requestId" json:"request_id,omitempty"` + MinimumLogLevel *int32 `protobuf:"varint,7,opt,name=minimum_log_level,json=minimumLogLevel" json:"minimum_log_level,omitempty"` + IncludeIncomplete *bool `protobuf:"varint,8,opt,name=include_incomplete,json=includeIncomplete" json:"include_incomplete,omitempty"` Count *int64 `protobuf:"varint,9,opt,name=count" json:"count,omitempty"` - CombinedLogRegex *string `protobuf:"bytes,14,opt,name=combined_log_regex" json:"combined_log_regex,omitempty"` - HostRegex *string `protobuf:"bytes,15,opt,name=host_regex" json:"host_regex,omitempty"` - ReplicaIndex *int32 `protobuf:"varint,16,opt,name=replica_index" json:"replica_index,omitempty"` - IncludeAppLogs *bool `protobuf:"varint,10,opt,name=include_app_logs" json:"include_app_logs,omitempty"` - AppLogsPerRequest *int32 `protobuf:"varint,17,opt,name=app_logs_per_request" json:"app_logs_per_request,omitempty"` - IncludeHost *bool `protobuf:"varint,11,opt,name=include_host" json:"include_host,omitempty"` - IncludeAll *bool `protobuf:"varint,12,opt,name=include_all" json:"include_all,omitempty"` - CacheIterator *bool `protobuf:"varint,13,opt,name=cache_iterator" json:"cache_iterator,omitempty"` - NumShards *int32 `protobuf:"varint,18,opt,name=num_shards" json:"num_shards,omitempty"` + CombinedLogRegex *string `protobuf:"bytes,14,opt,name=combined_log_regex,json=combinedLogRegex" json:"combined_log_regex,omitempty"` + HostRegex *string `protobuf:"bytes,15,opt,name=host_regex,json=hostRegex" json:"host_regex,omitempty"` + ReplicaIndex *int32 `protobuf:"varint,16,opt,name=replica_index,json=replicaIndex" json:"replica_index,omitempty"` + IncludeAppLogs *bool `protobuf:"varint,10,opt,name=include_app_logs,json=includeAppLogs" json:"include_app_logs,omitempty"` + AppLogsPerRequest *int32 `protobuf:"varint,17,opt,name=app_logs_per_request,json=appLogsPerRequest" json:"app_logs_per_request,omitempty"` + IncludeHost *bool `protobuf:"varint,11,opt,name=include_host,json=includeHost" json:"include_host,omitempty"` + IncludeAll *bool `protobuf:"varint,12,opt,name=include_all,json=includeAll" json:"include_all,omitempty"` + CacheIterator *bool `protobuf:"varint,13,opt,name=cache_iterator,json=cacheIterator" json:"cache_iterator,omitempty"` + NumShards *int32 `protobuf:"varint,18,opt,name=num_shards,json=numShards" json:"num_shards,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogReadRequest) Reset() { *m = LogReadRequest{} } -func (m *LogReadRequest) String() string { return proto.CompactTextString(m) } -func (*LogReadRequest) ProtoMessage() {} +func (m *LogReadRequest) Reset() { *m = LogReadRequest{} } +func (m *LogReadRequest) String() string { return proto.CompactTextString(m) } +func (*LogReadRequest) ProtoMessage() {} +func (*LogReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *LogReadRequest) GetAppId() string { if m != nil && m.AppId != nil { @@ -712,13 +728,14 @@ func (m *LogReadRequest) GetNumShards() int32 { type LogReadResponse struct { Log []*RequestLog `protobuf:"bytes,1,rep,name=log" json:"log,omitempty"` Offset *LogOffset `protobuf:"bytes,2,opt,name=offset" json:"offset,omitempty"` - LastEndTime *int64 `protobuf:"varint,3,opt,name=last_end_time" json:"last_end_time,omitempty"` + LastEndTime *int64 `protobuf:"varint,3,opt,name=last_end_time,json=lastEndTime" json:"last_end_time,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogReadResponse) Reset() { *m = LogReadResponse{} } -func (m *LogReadResponse) String() string { return proto.CompactTextString(m) } -func (*LogReadResponse) ProtoMessage() {} +func (m *LogReadResponse) Reset() { *m = LogReadResponse{} } +func (m *LogReadResponse) String() string { return proto.CompactTextString(m) } +func (*LogReadResponse) ProtoMessage() {} +func (*LogReadResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *LogReadResponse) GetLog() []*RequestLog { if m != nil { @@ -742,18 +759,19 @@ func (m *LogReadResponse) GetLastEndTime() int64 { } type LogUsageRecord struct { - VersionId *string `protobuf:"bytes,1,opt,name=version_id" json:"version_id,omitempty"` - StartTime *int32 `protobuf:"varint,2,opt,name=start_time" json:"start_time,omitempty"` - EndTime *int32 `protobuf:"varint,3,opt,name=end_time" json:"end_time,omitempty"` + VersionId *string `protobuf:"bytes,1,opt,name=version_id,json=versionId" json:"version_id,omitempty"` + StartTime *int32 `protobuf:"varint,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int32 `protobuf:"varint,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` Count *int64 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` - TotalSize *int64 `protobuf:"varint,5,opt,name=total_size" json:"total_size,omitempty"` + TotalSize *int64 `protobuf:"varint,5,opt,name=total_size,json=totalSize" json:"total_size,omitempty"` Records *int32 `protobuf:"varint,6,opt,name=records" json:"records,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogUsageRecord) Reset() { *m = LogUsageRecord{} } -func (m *LogUsageRecord) String() string { return proto.CompactTextString(m) } -func (*LogUsageRecord) ProtoMessage() {} +func (m *LogUsageRecord) Reset() { *m = LogUsageRecord{} } +func (m *LogUsageRecord) String() string { return proto.CompactTextString(m) } +func (*LogUsageRecord) ProtoMessage() {} +func (*LogUsageRecord) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *LogUsageRecord) GetVersionId() string { if m != nil && m.VersionId != nil { @@ -798,20 +816,21 @@ func (m *LogUsageRecord) GetRecords() int32 { } type LogUsageRequest struct { - AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - VersionId []string `protobuf:"bytes,2,rep,name=version_id" json:"version_id,omitempty"` - StartTime *int32 `protobuf:"varint,3,opt,name=start_time" json:"start_time,omitempty"` - EndTime *int32 `protobuf:"varint,4,opt,name=end_time" json:"end_time,omitempty"` - ResolutionHours *uint32 `protobuf:"varint,5,opt,name=resolution_hours,def=1" json:"resolution_hours,omitempty"` - CombineVersions *bool `protobuf:"varint,6,opt,name=combine_versions" json:"combine_versions,omitempty"` - UsageVersion *int32 `protobuf:"varint,7,opt,name=usage_version" json:"usage_version,omitempty"` - VersionsOnly *bool `protobuf:"varint,8,opt,name=versions_only" json:"versions_only,omitempty"` + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + VersionId []string `protobuf:"bytes,2,rep,name=version_id,json=versionId" json:"version_id,omitempty"` + StartTime *int32 `protobuf:"varint,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int32 `protobuf:"varint,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + ResolutionHours *uint32 `protobuf:"varint,5,opt,name=resolution_hours,json=resolutionHours,def=1" json:"resolution_hours,omitempty"` + CombineVersions *bool `protobuf:"varint,6,opt,name=combine_versions,json=combineVersions" json:"combine_versions,omitempty"` + UsageVersion *int32 `protobuf:"varint,7,opt,name=usage_version,json=usageVersion" json:"usage_version,omitempty"` + VersionsOnly *bool `protobuf:"varint,8,opt,name=versions_only,json=versionsOnly" json:"versions_only,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *LogUsageRequest) Reset() { *m = LogUsageRequest{} } -func (m *LogUsageRequest) String() string { return proto.CompactTextString(m) } -func (*LogUsageRequest) ProtoMessage() {} +func (m *LogUsageRequest) Reset() { *m = LogUsageRequest{} } +func (m *LogUsageRequest) String() string { return proto.CompactTextString(m) } +func (*LogUsageRequest) ProtoMessage() {} +func (*LogUsageRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } const Default_LogUsageRequest_ResolutionHours uint32 = 1 @@ -877,9 +896,10 @@ type LogUsageResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *LogUsageResponse) Reset() { *m = LogUsageResponse{} } -func (m *LogUsageResponse) String() string { return proto.CompactTextString(m) } -func (*LogUsageResponse) ProtoMessage() {} +func (m *LogUsageResponse) Reset() { *m = LogUsageResponse{} } +func (m *LogUsageResponse) String() string { return proto.CompactTextString(m) } +func (*LogUsageResponse) ProtoMessage() {} +func (*LogUsageResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *LogUsageResponse) GetUsage() []*LogUsageRecord { if m != nil { @@ -896,4 +916,124 @@ func (m *LogUsageResponse) GetSummary() *LogUsageRecord { } func init() { + proto.RegisterType((*LogServiceError)(nil), "appengine.LogServiceError") + proto.RegisterType((*UserAppLogLine)(nil), "appengine.UserAppLogLine") + proto.RegisterType((*UserAppLogGroup)(nil), "appengine.UserAppLogGroup") + proto.RegisterType((*FlushRequest)(nil), "appengine.FlushRequest") + proto.RegisterType((*SetStatusRequest)(nil), "appengine.SetStatusRequest") + proto.RegisterType((*LogOffset)(nil), "appengine.LogOffset") + proto.RegisterType((*LogLine)(nil), "appengine.LogLine") + proto.RegisterType((*RequestLog)(nil), "appengine.RequestLog") + proto.RegisterType((*LogModuleVersion)(nil), "appengine.LogModuleVersion") + proto.RegisterType((*LogReadRequest)(nil), "appengine.LogReadRequest") + proto.RegisterType((*LogReadResponse)(nil), "appengine.LogReadResponse") + proto.RegisterType((*LogUsageRecord)(nil), "appengine.LogUsageRecord") + proto.RegisterType((*LogUsageRequest)(nil), "appengine.LogUsageRequest") + proto.RegisterType((*LogUsageResponse)(nil), "appengine.LogUsageResponse") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/log/log_service.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1553 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x72, 0xdb, 0xc6, + 0x15, 0x2e, 0x48, 0x51, 0x24, 0x0f, 0x49, 0x91, 0x5a, 0xcb, 0xce, 0xda, 0xae, 0x6b, 0x1a, 0x4e, + 0x1c, 0xd6, 0x93, 0x48, 0x93, 0xa4, 0x57, 0xca, 0x95, 0xd3, 0x2a, 0x8e, 0x26, 0xb4, 0xd5, 0x40, + 0x72, 0x3a, 0xd3, 0x1b, 0x0c, 0x0a, 0x1c, 0x81, 0x18, 0x2f, 0xb1, 0xc8, 0xee, 0xc2, 0x91, 0x72, + 0xdb, 0xdb, 0x3e, 0x46, 0x1f, 0xa2, 0xaf, 0xd2, 0xb7, 0xe9, 0xec, 0xd9, 0x05, 0x44, 0x2a, 0x4d, + 0xc6, 0x33, 0xb9, 0xe0, 0x10, 0xfb, 0x9d, 0x83, 0xdd, 0xf3, 0xf3, 0x9d, 0x6f, 0x01, 0xc7, 0xb9, + 0x94, 0xb9, 0xc0, 0xc3, 0x5c, 0x8a, 0xa4, 0xcc, 0x0f, 0xa5, 0xca, 0x8f, 0x92, 0xaa, 0xc2, 0x32, + 0x2f, 0x4a, 0x3c, 0x2a, 0x4a, 0x83, 0xaa, 0x4c, 0xc4, 0x91, 0x90, 0xb9, 0xfd, 0xc5, 0x1a, 0xd5, + 0xbb, 0x22, 0xc5, 0xc3, 0x4a, 0x49, 0x23, 0xd9, 0xb0, 0xf5, 0x0c, 0x5f, 0xc3, 0x74, 0x29, 0xf3, + 0x73, 0x67, 0x3e, 0x51, 0x4a, 0xaa, 0xf0, 0x4b, 0x18, 0xd2, 0xc3, 0x9f, 0x65, 0x86, 0x6c, 0x17, + 0x3a, 0x67, 0xdf, 0xce, 0x7e, 0xc7, 0xee, 0xc0, 0xf4, 0xf4, 0xf5, 0xf7, 0x2f, 0x96, 0xa7, 0x7f, + 0x89, 0xa3, 0x93, 0xef, 0xde, 0x9c, 0x9c, 0x5f, 0xcc, 0x02, 0xb6, 0x0f, 0x93, 0xf3, 0x8b, 0xb3, + 0xe8, 0xc5, 0xcb, 0x93, 0xf8, 0x24, 0x8a, 0xce, 0xa2, 0x59, 0x27, 0xcc, 0x61, 0xef, 0x8d, 0x46, + 0xf5, 0xa2, 0xaa, 0x96, 0x32, 0x5f, 0x16, 0x25, 0xb2, 0x8f, 0x60, 0xcf, 0x14, 0x6b, 0xd4, 0x26, + 0x59, 0x57, 0x71, 0xad, 0x31, 0xe5, 0xc1, 0xbc, 0xb3, 0xe8, 0x46, 0x93, 0x16, 0x7d, 0xa3, 0x31, + 0x65, 0x07, 0xd0, 0x13, 0xf8, 0x0e, 0x05, 0xef, 0x90, 0xd5, 0x2d, 0x18, 0x87, 0xfe, 0x1a, 0xb5, + 0x4e, 0x72, 0xe4, 0xdd, 0x79, 0x67, 0x31, 0x8c, 0x9a, 0x65, 0xf8, 0x12, 0xa6, 0x37, 0x07, 0xbd, + 0x54, 0xb2, 0xae, 0xd8, 0x9f, 0x60, 0x60, 0x73, 0x15, 0x45, 0x89, 0xbc, 0x33, 0xef, 0x2e, 0x46, + 0x9f, 0xdf, 0x3f, 0x6c, 0x33, 0x3d, 0xdc, 0x0e, 0x2b, 0xea, 0x0b, 0xf7, 0x10, 0x86, 0x30, 0xfe, + 0x5a, 0xd4, 0x7a, 0x15, 0xe1, 0x0f, 0x35, 0x6a, 0xc3, 0x18, 0xec, 0x08, 0x99, 0x6b, 0x1e, 0xcc, + 0x83, 0xc5, 0x38, 0xa2, 0xe7, 0xf0, 0x39, 0xcc, 0xce, 0xd1, 0x9c, 0x9b, 0xc4, 0xd4, 0xba, 0xf1, + 0xbb, 0x07, 0xbb, 0x9a, 0x00, 0xca, 0x67, 0x18, 0xf9, 0x55, 0xf8, 0x1c, 0x86, 0x4b, 0x99, 0x9f, + 0x5d, 0x5e, 0x6a, 0x34, 0xec, 0x11, 0x80, 0x72, 0xfe, 0x71, 0x91, 0xf9, 0x2d, 0x87, 0x1e, 0x39, + 0xcd, 0xc2, 0x0b, 0xe8, 0x37, 0x65, 0x62, 0xb0, 0x63, 0x0b, 0xe2, 0x8b, 0x43, 0xcf, 0xdb, 0x35, + 0xe9, 0x35, 0x35, 0x79, 0x0c, 0x23, 0x9b, 0xe6, 0x76, 0x5d, 0x40, 0xc8, 0xfc, 0x95, 0x2f, 0xcd, + 0x3f, 0x01, 0xc0, 0x47, 0xb9, 0x94, 0x39, 0xbb, 0x0b, 0xbb, 0x49, 0x55, 0xb9, 0xf3, 0xad, 0x6b, + 0x2f, 0xa9, 0xaa, 0xd3, 0x8c, 0x7d, 0x08, 0xc3, 0xb5, 0xcc, 0x6a, 0x81, 0xd6, 0xf2, 0xd1, 0x3c, + 0x58, 0x0c, 0x8f, 0xfb, 0x19, 0x5e, 0x26, 0xb5, 0x30, 0xd1, 0xc0, 0x59, 0x4e, 0x33, 0x9b, 0xc0, + 0x3b, 0x54, 0xba, 0x90, 0xa5, 0x75, 0xeb, 0xd0, 0x06, 0x43, 0x8f, 0x38, 0xf3, 0x46, 0x7e, 0x36, + 0x94, 0xcd, 0xfc, 0xd8, 0x27, 0xb0, 0x2b, 0xa9, 0x10, 0xfc, 0xe9, 0x3c, 0x58, 0x8c, 0x3e, 0x3f, + 0xd8, 0xe8, 0x47, 0x5b, 0xa4, 0xc8, 0xfb, 0xb0, 0x3d, 0xe8, 0x14, 0x15, 0xdf, 0xa1, 0x33, 0x3a, + 0x45, 0xc5, 0x1e, 0xc0, 0xa0, 0x2c, 0xd2, 0xb7, 0x65, 0xb2, 0x46, 0xde, 0xb3, 0x01, 0x46, 0xed, + 0xda, 0x1e, 0xac, 0x4d, 0xa2, 0x4c, 0x4c, 0x45, 0xdb, 0xa5, 0xa2, 0x0d, 0x09, 0xb9, 0xb0, 0x95, + 0xbb, 0x0f, 0x03, 0x2c, 0x33, 0x67, 0xec, 0x93, 0xb1, 0x8f, 0x65, 0x46, 0x26, 0x0e, 0x7d, 0x91, + 0x18, 0x2c, 0xd3, 0x6b, 0x3e, 0x70, 0x16, 0xbf, 0x24, 0xb2, 0xa5, 0xd7, 0xa9, 0x40, 0xcd, 0x87, + 0xce, 0xe2, 0x97, 0xb6, 0xd7, 0x6b, 0x34, 0x2b, 0x99, 0x71, 0x70, 0xbd, 0x76, 0x2b, 0x1b, 0xa1, + 0x42, 0x2d, 0x6b, 0x95, 0x22, 0x1f, 0x91, 0xa5, 0x5d, 0xb3, 0x27, 0x30, 0x5e, 0x19, 0x53, 0xc5, + 0xbe, 0x58, 0x7c, 0x4c, 0xf6, 0x91, 0xc5, 0xbe, 0x77, 0xd0, 0x06, 0x85, 0x26, 0xd4, 0x60, 0xbf, + 0x62, 0x4f, 0x61, 0xa2, 0x50, 0x57, 0xb2, 0xd4, 0x18, 0xeb, 0xe2, 0x27, 0xe4, 0x7b, 0x14, 0xce, + 0xb8, 0x01, 0xcf, 0x8b, 0x9f, 0xd0, 0x9d, 0x7d, 0x89, 0x4a, 0xa1, 0xe2, 0x53, 0x57, 0x9d, 0x66, + 0x6d, 0xab, 0x53, 0x6b, 0x54, 0x71, 0x92, 0x63, 0x69, 0xf8, 0x8c, 0xac, 0x43, 0x8b, 0xbc, 0xb0, + 0x00, 0x0b, 0x61, 0x52, 0x2b, 0x11, 0xaf, 0x93, 0x2a, 0xc6, 0xd2, 0xa8, 0x6b, 0xbe, 0xef, 0x62, + 0xab, 0x95, 0x78, 0x95, 0x54, 0x27, 0x16, 0xb2, 0xdb, 0xa7, 0x72, 0xfd, 0x8f, 0xa2, 0xc4, 0x8c, + 0x33, 0x97, 0x5a, 0xb3, 0xb6, 0x0c, 0x4c, 0xaa, 0x22, 0x6e, 0x8a, 0x75, 0x67, 0x1e, 0x2c, 0xba, + 0x11, 0x24, 0x55, 0xf1, 0xca, 0xd7, 0x8b, 0xc1, 0xce, 0x4a, 0x6a, 0xc3, 0x0f, 0xe8, 0x64, 0x7a, + 0xb6, 0x58, 0x6a, 0xb1, 0xbb, 0xf3, 0x60, 0x11, 0x44, 0xf4, 0xcc, 0x9e, 0xc1, 0xd4, 0x24, 0xfa, + 0x6d, 0xfc, 0x43, 0x8d, 0x35, 0xc6, 0xd4, 0xe8, 0x7b, 0xf4, 0xca, 0xc4, 0xc2, 0xdf, 0x59, 0xf4, + 0xb5, 0xed, 0xf6, 0x43, 0x18, 0x92, 0x1f, 0x79, 0x7c, 0xe0, 0x92, 0xb5, 0x00, 0x19, 0x0f, 0xe1, + 0xce, 0x8f, 0x89, 0x8e, 0x85, 0x4c, 0xb2, 0xa2, 0xcc, 0x63, 0xcf, 0x3e, 0xce, 0xe7, 0xc1, 0x62, + 0x10, 0xed, 0xff, 0x98, 0xe8, 0xa5, 0xb3, 0x34, 0x83, 0xfb, 0x04, 0xc6, 0x15, 0x96, 0xe4, 0x4b, + 0xfc, 0xb8, 0x4f, 0xe1, 0x8f, 0x3c, 0x46, 0x1c, 0xf9, 0xd8, 0x36, 0xa0, 0x12, 0x45, 0x9a, 0xc4, + 0x45, 0x99, 0xe1, 0x15, 0x7f, 0x30, 0x0f, 0x16, 0xbd, 0xe3, 0xce, 0xa7, 0x9f, 0xd9, 0x26, 0x90, + 0xe1, 0xd4, 0xe2, 0x6c, 0x0e, 0x83, 0xcb, 0xa2, 0x2c, 0xf4, 0x0a, 0x33, 0xfe, 0xd0, 0x1e, 0x78, + 0xbc, 0x63, 0x54, 0x8d, 0x51, 0x8b, 0xda, 0xd0, 0x53, 0x21, 0x4b, 0x8c, 0xdf, 0xe2, 0x35, 0xff, + 0x3d, 0x09, 0xc0, 0x80, 0x80, 0x6f, 0xf1, 0x9a, 0x3d, 0x83, 0x1d, 0x52, 0xab, 0x47, 0xa4, 0x56, + 0x6c, 0x7b, 0x3a, 0x48, 0xa6, 0xc8, 0xce, 0xfe, 0x08, 0x33, 0xfb, 0xaf, 0xe3, 0xa2, 0x4c, 0xe5, + 0xba, 0x12, 0x68, 0x90, 0x7f, 0x48, 0xf9, 0x4d, 0x09, 0x3f, 0x6d, 0x61, 0xf6, 0x09, 0x30, 0x3b, + 0xed, 0x6e, 0x9b, 0x58, 0xa1, 0xc0, 0x44, 0x23, 0x7f, 0x46, 0x07, 0xcf, 0x92, 0xaa, 0x3a, 0x21, + 0x43, 0xe4, 0x70, 0xdb, 0x49, 0xbc, 0x2a, 0x4c, 0xac, 0x30, 0xd1, 0xb2, 0xe4, 0x7f, 0xb0, 0x69, + 0x46, 0x60, 0xa1, 0x88, 0x10, 0xf6, 0x05, 0xdc, 0xb3, 0xc5, 0x35, 0x2b, 0x25, 0x8d, 0x11, 0x98, + 0xc5, 0x97, 0x52, 0xb9, 0xb2, 0x3d, 0xa6, 0xf3, 0x6d, 0xe9, 0x2f, 0x1a, 0xe3, 0xd7, 0x52, 0x51, + 0xf9, 0xbe, 0x84, 0x07, 0x3f, 0x7f, 0xc9, 0xf7, 0x45, 0xf3, 0x39, 0xbd, 0xf8, 0xc1, 0xad, 0x17, + 0x7d, 0x77, 0x34, 0xdd, 0x17, 0xed, 0x8b, 0x74, 0xd2, 0x13, 0x6a, 0xd0, 0xa4, 0x45, 0xe9, 0x8c, + 0xc7, 0x30, 0xb2, 0x97, 0x1a, 0x2a, 0x47, 0x8a, 0x90, 0x12, 0x04, 0x07, 0x59, 0x5a, 0x84, 0x7f, + 0x83, 0xd9, 0x52, 0xe6, 0xaf, 0x48, 0xc8, 0x9a, 0x81, 0xdb, 0xd2, 0xbc, 0xe0, 0x7d, 0x35, 0x2f, + 0xd8, 0xd2, 0xbc, 0xf0, 0xbf, 0x3d, 0xd8, 0x5b, 0xca, 0x3c, 0xc2, 0x24, 0x6b, 0x28, 0xf5, 0x0b, + 0x12, 0x7b, 0x7b, 0xa3, 0xee, 0xb6, 0x78, 0x7e, 0x05, 0x7b, 0x3e, 0x9a, 0x46, 0x23, 0xee, 0x10, + 0x0f, 0x1e, 0x6e, 0xf3, 0x60, 0x2b, 0x85, 0x68, 0xb2, 0xde, 0xca, 0x68, 0x5b, 0x07, 0xbb, 0x54, + 0xa9, 0x5f, 0xd0, 0xc1, 0x1d, 0x32, 0xb6, 0x3a, 0x78, 0xa3, 0xcd, 0xbd, 0xf7, 0xd0, 0xe6, 0x6d, + 0xa1, 0xdf, 0x9d, 0x77, 0xb7, 0x85, 0xfe, 0x39, 0xec, 0xaf, 0x8b, 0xb2, 0x58, 0xd7, 0xeb, 0x98, + 0xae, 0x60, 0xba, 0xb5, 0xfa, 0xc4, 0xa6, 0xa9, 0x37, 0x58, 0x46, 0xd3, 0xfd, 0xf5, 0x29, 0xb0, + 0xa2, 0x4c, 0x45, 0x9d, 0xe1, 0x26, 0x9d, 0x07, 0x6e, 0x5c, 0xbd, 0x65, 0x83, 0xd0, 0x07, 0xd0, + 0x4b, 0x65, 0x5d, 0x1a, 0x3e, 0xa4, 0xf8, 0xdd, 0xc2, 0xd2, 0xbc, 0x91, 0x23, 0x3a, 0x51, 0x61, + 0x8e, 0x57, 0x7c, 0x8f, 0x7a, 0x35, 0x6b, 0x2c, 0xd4, 0xa5, 0x1c, 0xaf, 0x6c, 0xf4, 0x56, 0x83, + 0xbc, 0x97, 0x53, 0xcb, 0xa1, 0x45, 0x9c, 0xf9, 0xe9, 0xed, 0x71, 0x9f, 0x51, 0xe4, 0xdb, 0xa3, + 0xbe, 0x80, 0x59, 0x13, 0xb6, 0xed, 0x35, 0x7d, 0x23, 0x00, 0x05, 0xbd, 0xe7, 0x71, 0xf7, 0x75, + 0xa1, 0xd9, 0x11, 0x1c, 0x34, 0x1e, 0x71, 0x85, 0x2d, 0xf3, 0xf9, 0x3e, 0xed, 0xba, 0x9f, 0x38, + 0xb7, 0xbf, 0xa2, 0xda, 0x50, 0xa4, 0x66, 0x6b, 0x92, 0xcd, 0x11, 0x6d, 0x3b, 0xf2, 0xd8, 0x37, + 0x56, 0x29, 0x1f, 0xc3, 0xa8, 0x3d, 0x5d, 0x08, 0x3e, 0x26, 0x0f, 0x68, 0x0e, 0x16, 0xc2, 0x8e, + 0x4d, 0x9a, 0xa4, 0x2b, 0x8c, 0x0b, 0x83, 0x2a, 0x31, 0x52, 0xf1, 0x09, 0xf9, 0x4c, 0x08, 0x3d, + 0xf5, 0xa0, 0xad, 0x44, 0x59, 0xaf, 0x63, 0xbd, 0x4a, 0x54, 0xa6, 0x39, 0xa3, 0x88, 0x86, 0x65, + 0xbd, 0x3e, 0x27, 0x20, 0xfc, 0x57, 0x40, 0xdf, 0x83, 0x8e, 0xdb, 0xee, 0xb2, 0x61, 0x1f, 0x43, + 0x57, 0xc8, 0x9c, 0x07, 0xc4, 0xcd, 0xbb, 0x1b, 0x2c, 0xb9, 0xf9, 0xc6, 0x88, 0xac, 0xc7, 0x06, + 0xa3, 0x3a, 0xef, 0xc1, 0xa8, 0x10, 0x26, 0x22, 0xd1, 0x26, 0x6e, 0xf9, 0xe9, 0xc8, 0x3b, 0xb2, + 0xe0, 0x89, 0xe3, 0x68, 0xf8, 0x9f, 0x80, 0x46, 0xed, 0x8d, 0xfd, 0xac, 0x89, 0x30, 0x95, 0xea, + 0xf6, 0x4c, 0x05, 0xb7, 0x86, 0xf3, 0xd6, 0x3c, 0x74, 0x5c, 0x7e, 0xff, 0x7f, 0x1e, 0xba, 0x64, + 0x6c, 0xe7, 0xa1, 0xe5, 0xd9, 0xce, 0x26, 0xcf, 0x1e, 0x01, 0x18, 0x69, 0x12, 0xe1, 0xee, 0xe1, + 0x9e, 0x9b, 0x2f, 0x42, 0xe8, 0x12, 0xe6, 0xd0, 0x57, 0x14, 0x97, 0xe6, 0xbb, 0x6e, 0x3b, 0xbf, + 0x0c, 0xff, 0xdd, 0xa1, 0x4a, 0xfa, 0xd0, 0x7f, 0x8b, 0x4c, 0xfc, 0x7c, 0xc4, 0x7b, 0xbf, 0x36, + 0xe2, 0xbd, 0xcd, 0x11, 0x9f, 0xd9, 0xcf, 0x11, 0x51, 0x1b, 0xbb, 0xf7, 0x4a, 0xd6, 0x4a, 0x53, + 0x0a, 0x93, 0xe3, 0xe0, 0xb3, 0x68, 0x7a, 0x63, 0xfa, 0xc6, 0x5a, 0xec, 0x25, 0xe3, 0x07, 0xa7, + 0xd1, 0x23, 0x97, 0xd4, 0x20, 0x9a, 0x7a, 0xdc, 0x8b, 0x0e, 0x7d, 0xa0, 0xd4, 0x36, 0xb1, 0x56, + 0xb8, 0xdc, 0xa8, 0x8f, 0x09, 0x6c, 0xa4, 0xe9, 0x29, 0x4c, 0x9a, 0x7d, 0x62, 0x59, 0x8a, 0x6b, + 0x3f, 0xe2, 0xe3, 0x06, 0x3c, 0x2b, 0xc5, 0x75, 0x78, 0x45, 0x2a, 0xed, 0xab, 0xe4, 0x09, 0x77, + 0x04, 0x3d, 0xda, 0xc8, 0x53, 0xee, 0xfe, 0x36, 0x8d, 0x36, 0xc8, 0x10, 0x39, 0x3f, 0xf6, 0x05, + 0xf4, 0x75, 0xbd, 0x5e, 0x27, 0xea, 0xda, 0x33, 0xef, 0x57, 0x5e, 0x69, 0x3c, 0xbf, 0xea, 0xfd, + 0xdd, 0x92, 0xf6, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0xd9, 0xa0, 0xf8, 0x48, 0x0d, 0x00, + 0x00, } diff --git a/vendor/google.golang.org/appengine/internal/main_vm.go b/vendor/google.golang.org/appengine/internal/main_vm.go index 57331ad171..822e784a45 100644 --- a/vendor/google.golang.org/appengine/internal/main_vm.go +++ b/vendor/google.golang.org/appengine/internal/main_vm.go @@ -22,7 +22,11 @@ func Main() { port = s } - if err := http.ListenAndServe(":"+port, http.HandlerFunc(handleHTTP)); err != nil { + host := "" + if IsDevAppServer() { + host = "127.0.0.1" + } + if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil { log.Fatalf("http.ListenAndServe: %v", err) } } diff --git a/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go b/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go index 526bd39e6d..172aebe8e4 100644 --- a/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go +++ b/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: google.golang.org/appengine/internal/remote_api/remote_api.proto -// DO NOT EDIT! /* Package remote_api is a generated protocol buffer package. @@ -25,6 +24,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type RpcError_ErrorCode int32 const ( @@ -90,18 +95,20 @@ func (x *RpcError_ErrorCode) UnmarshalJSON(data []byte) error { *x = RpcError_ErrorCode(value) return nil } +func (RpcError_ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } type Request struct { - ServiceName *string `protobuf:"bytes,2,req,name=service_name" json:"service_name,omitempty"` + ServiceName *string `protobuf:"bytes,2,req,name=service_name,json=serviceName" json:"service_name,omitempty"` Method *string `protobuf:"bytes,3,req,name=method" json:"method,omitempty"` Request []byte `protobuf:"bytes,4,req,name=request" json:"request,omitempty"` - RequestId *string `protobuf:"bytes,5,opt,name=request_id" json:"request_id,omitempty"` + RequestId *string `protobuf:"bytes,5,opt,name=request_id,json=requestId" json:"request_id,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *Request) GetServiceName() string { if m != nil && m.ServiceName != nil { @@ -137,9 +144,10 @@ type ApplicationError struct { XXX_unrecognized []byte `json:"-"` } -func (m *ApplicationError) Reset() { *m = ApplicationError{} } -func (m *ApplicationError) String() string { return proto.CompactTextString(m) } -func (*ApplicationError) ProtoMessage() {} +func (m *ApplicationError) Reset() { *m = ApplicationError{} } +func (m *ApplicationError) String() string { return proto.CompactTextString(m) } +func (*ApplicationError) ProtoMessage() {} +func (*ApplicationError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *ApplicationError) GetCode() int32 { if m != nil && m.Code != nil { @@ -161,9 +169,10 @@ type RpcError struct { XXX_unrecognized []byte `json:"-"` } -func (m *RpcError) Reset() { *m = RpcError{} } -func (m *RpcError) String() string { return proto.CompactTextString(m) } -func (*RpcError) ProtoMessage() {} +func (m *RpcError) Reset() { *m = RpcError{} } +func (m *RpcError) String() string { return proto.CompactTextString(m) } +func (*RpcError) ProtoMessage() {} +func (*RpcError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *RpcError) GetCode() int32 { if m != nil && m.Code != nil { @@ -182,15 +191,16 @@ func (m *RpcError) GetDetail() string { type Response struct { Response []byte `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"` Exception []byte `protobuf:"bytes,2,opt,name=exception" json:"exception,omitempty"` - ApplicationError *ApplicationError `protobuf:"bytes,3,opt,name=application_error" json:"application_error,omitempty"` - JavaException []byte `protobuf:"bytes,4,opt,name=java_exception" json:"java_exception,omitempty"` - RpcError *RpcError `protobuf:"bytes,5,opt,name=rpc_error" json:"rpc_error,omitempty"` + ApplicationError *ApplicationError `protobuf:"bytes,3,opt,name=application_error,json=applicationError" json:"application_error,omitempty"` + JavaException []byte `protobuf:"bytes,4,opt,name=java_exception,json=javaException" json:"java_exception,omitempty"` + RpcError *RpcError `protobuf:"bytes,5,opt,name=rpc_error,json=rpcError" json:"rpc_error,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *Response) GetResponse() []byte { if m != nil { @@ -228,4 +238,50 @@ func (m *Response) GetRpcError() *RpcError { } func init() { + proto.RegisterType((*Request)(nil), "remote_api.Request") + proto.RegisterType((*ApplicationError)(nil), "remote_api.ApplicationError") + proto.RegisterType((*RpcError)(nil), "remote_api.RpcError") + proto.RegisterType((*Response)(nil), "remote_api.Response") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/remote_api/remote_api.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 531 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x51, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb1, 0x9b, 0x34, 0xf1, 0xc4, 0x2d, 0xdb, 0xa5, 0x14, 0x0b, 0x15, 0x29, 0x44, 0x42, + 0xca, 0x53, 0x2a, 0x38, 0x00, 0x62, 0x63, 0x6f, 0x91, 0x85, 0x65, 0xa7, 0x6b, 0xbb, 0x50, 0x5e, + 0x56, 0x2b, 0x67, 0x65, 0x8c, 0x12, 0xaf, 0xd9, 0x98, 0x8a, 0x17, 0x6e, 0xc0, 0xb5, 0x38, 0x0c, + 0xb7, 0x40, 0x36, 0x6e, 0x63, 0xf5, 0x89, 0xb7, 0x7f, 0x7e, 0x7b, 0xe6, 0x1b, 0xcd, 0xcc, 0xc2, + 0xbb, 0x5c, 0xa9, 0x7c, 0x23, 0x17, 0xb9, 0xda, 0x88, 0x32, 0x5f, 0x28, 0x9d, 0x5f, 0x88, 0xaa, + 0x92, 0x65, 0x5e, 0x94, 0xf2, 0xa2, 0x28, 0x6b, 0xa9, 0x4b, 0xb1, 0xb9, 0xd0, 0x72, 0xab, 0x6a, + 0xc9, 0x45, 0x55, 0xf4, 0xe4, 0xa2, 0xd2, 0xaa, 0x56, 0x18, 0xf6, 0xce, 0xec, 0x27, 0x8c, 0x98, + 0xfc, 0xf6, 0x5d, 0xee, 0x6a, 0xfc, 0x12, 0xec, 0x9d, 0xd4, 0xb7, 0x45, 0x26, 0x79, 0x29, 0xb6, + 0xd2, 0x31, 0xa7, 0xe6, 0xdc, 0x62, 0x93, 0xce, 0x0b, 0xc5, 0x56, 0xe2, 0x33, 0x38, 0xdc, 0xca, + 0xfa, 0x8b, 0x5a, 0x3b, 0x07, 0xed, 0xc7, 0x2e, 0xc2, 0x0e, 0x8c, 0xf4, 0xbf, 0x2a, 0xce, 0x60, + 0x6a, 0xce, 0x6d, 0x76, 0x17, 0xe2, 0x17, 0x00, 0x9d, 0xe4, 0xc5, 0xda, 0x19, 0x4e, 0x8d, 0xb9, + 0xc5, 0xac, 0xce, 0xf1, 0xd7, 0xb3, 0xb7, 0x80, 0x48, 0x55, 0x6d, 0x8a, 0x4c, 0xd4, 0x85, 0x2a, + 0xa9, 0xd6, 0x4a, 0x63, 0x0c, 0x83, 0x4c, 0xad, 0xa5, 0x63, 0x4c, 0xcd, 0xf9, 0x90, 0xb5, 0xba, + 0x01, 0xaf, 0x65, 0x2d, 0x8a, 0x4d, 0xd7, 0x55, 0x17, 0xcd, 0x7e, 0x9b, 0x30, 0x66, 0x55, 0xf6, + 0x7f, 0x89, 0x46, 0x2f, 0xf1, 0x97, 0x09, 0x56, 0x9b, 0xe5, 0x36, 0x7f, 0x4d, 0x60, 0x94, 0x86, + 0x1f, 0xc2, 0xe8, 0x63, 0x88, 0x1e, 0x61, 0x0c, 0xc7, 0x2e, 0x09, 0x02, 0x1e, 0x46, 0x09, 0xbf, + 0x8c, 0xd2, 0xd0, 0x43, 0x06, 0x7e, 0x0c, 0x93, 0x15, 0x61, 0x31, 0xe5, 0x94, 0xb1, 0x88, 0x21, + 0x13, 0x9f, 0x01, 0x8e, 0xa9, 0x9b, 0x32, 0x3f, 0xb9, 0xe1, 0xd7, 0x7e, 0x14, 0x90, 0xc4, 0x8f, + 0x42, 0x74, 0x80, 0x8f, 0x01, 0xa2, 0x6b, 0xca, 0xf8, 0x55, 0x1a, 0x25, 0x04, 0x0d, 0xf0, 0x53, + 0x38, 0x61, 0xf4, 0x2a, 0xa5, 0x71, 0xc2, 0x93, 0x28, 0xe2, 0x01, 0x61, 0xef, 0x29, 0x1a, 0xe2, + 0x67, 0xf0, 0xc4, 0x25, 0x2b, 0xb2, 0xf4, 0x83, 0xa6, 0x80, 0xe7, 0xc7, 0x64, 0x19, 0x50, 0x0f, + 0x1d, 0xe2, 0x53, 0x40, 0x97, 0x94, 0x24, 0x29, 0xa3, 0x7b, 0x77, 0xd4, 0xe0, 0x97, 0xc4, 0xe3, + 0x5d, 0x25, 0x34, 0x6e, 0xf0, 0x8c, 0xc6, 0xab, 0x28, 0x8c, 0x69, 0xaf, 0xae, 0x85, 0x8f, 0xc0, + 0x72, 0x49, 0xe8, 0xd2, 0xa0, 0xc9, 0x03, 0x8c, 0xc0, 0x66, 0x74, 0x15, 0x90, 0x9b, 0xae, 0xef, + 0x49, 0xd3, 0x8f, 0x47, 0x89, 0x17, 0xf8, 0x21, 0xe5, 0xf4, 0x93, 0x4b, 0xa9, 0x47, 0x3d, 0x64, + 0xcf, 0xfe, 0x18, 0x30, 0x66, 0x72, 0x57, 0xa9, 0x72, 0x27, 0xf1, 0x73, 0x18, 0xeb, 0x4e, 0x3b, + 0xc6, 0xd4, 0x98, 0xdb, 0xec, 0x3e, 0xc6, 0xe7, 0x60, 0xc9, 0x1f, 0x99, 0xac, 0x9a, 0x75, 0xb5, + 0x23, 0xb5, 0xd9, 0xde, 0xc0, 0x3e, 0x9c, 0x88, 0xfd, 0x3a, 0xb9, 0x6c, 0x06, 0xec, 0x1c, 0x4c, + 0x8d, 0xf9, 0xe4, 0xcd, 0xf9, 0xa2, 0x77, 0x87, 0x0f, 0x77, 0xce, 0x90, 0x78, 0x78, 0x05, 0xaf, + 0xe0, 0xf8, 0xab, 0xb8, 0x15, 0x7c, 0x4f, 0x1b, 0xb4, 0xb4, 0xa3, 0xc6, 0xa5, 0xf7, 0xc4, 0xd7, + 0x60, 0xe9, 0x2a, 0xeb, 0x48, 0xc3, 0x96, 0x74, 0xda, 0x27, 0xdd, 0x1d, 0x07, 0x1b, 0xeb, 0x4e, + 0x2d, 0xed, 0xcf, 0xbd, 0x07, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x38, 0xd1, 0x0f, 0x22, 0x4f, + 0x03, 0x00, 0x00, } diff --git a/vendor/google.golang.org/appengine/internal/transaction.go b/vendor/google.golang.org/appengine/internal/transaction.go index 28a6d18120..9006ae6538 100644 --- a/vendor/google.golang.org/appengine/internal/transaction.go +++ b/vendor/google.golang.org/appengine/internal/transaction.go @@ -54,9 +54,9 @@ type transaction struct { var ErrConcurrentTransaction = errors.New("internal: concurrent transaction") -func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, xg bool) error { +func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, xg bool, readOnly bool, previousTransaction *pb.Transaction) (*pb.Transaction, error) { if transactionFromContext(c) != nil { - return errors.New("nested transactions are not supported") + return nil, errors.New("nested transactions are not supported") } // Begin the transaction. @@ -67,8 +67,16 @@ func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, if xg { req.AllowMultipleEg = proto.Bool(true) } + if previousTransaction != nil { + req.PreviousTransaction = previousTransaction + } + if readOnly { + req.Mode = pb.BeginTransactionRequest_READ_ONLY.Enum() + } else { + req.Mode = pb.BeginTransactionRequest_READ_WRITE.Enum() + } if err := Call(c, "datastore_v3", "BeginTransaction", req, &t.transaction); err != nil { - return err + return nil, err } // Call f, rolling back the transaction if f returns a non-nil error, or panics. @@ -83,7 +91,7 @@ func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, Call(c, "datastore_v3", "Rollback", &t.transaction, &basepb.VoidProto{}) }() if err := f(withTransaction(c, t)); err != nil { - return err + return &t.transaction, err } t.finished = true @@ -97,11 +105,11 @@ func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, // The Python Dev AppServer raises an ApplicationError with error code 2 (which is // Error.CONCURRENT_TRANSACTION) and message "Concurrency exception.". if ae.Code == int32(pb.Error_BAD_REQUEST) && ae.Detail == "ApplicationError: 2 Concurrency exception." { - return ErrConcurrentTransaction + return &t.transaction, ErrConcurrentTransaction } if ae.Code == int32(pb.Error_CONCURRENT_TRANSACTION) { - return ErrConcurrentTransaction + return &t.transaction, ErrConcurrentTransaction } } - return err + return &t.transaction, err } diff --git a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go b/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go index af463fbb26..7c96c9d403 100644 --- a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +++ b/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto -// DO NOT EDIT! /* Package urlfetch is a generated protocol buffer package. @@ -24,6 +23,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type URLFetchServiceError_ErrorCode int32 const ( @@ -89,6 +94,9 @@ func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error { *x = URLFetchServiceError_ErrorCode(value) return nil } +func (URLFetchServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} type URLFetchRequest_RequestMethod int32 @@ -134,19 +142,23 @@ func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error { *x = URLFetchRequest_RequestMethod(value) return nil } +func (URLFetchRequest_RequestMethod) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} type URLFetchServiceError struct { XXX_unrecognized []byte `json:"-"` } -func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} } -func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) } -func (*URLFetchServiceError) ProtoMessage() {} +func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} } +func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) } +func (*URLFetchServiceError) ProtoMessage() {} +func (*URLFetchServiceError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type URLFetchRequest struct { Method *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"` Url *string `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"` - Header []*URLFetchRequest_Header `protobuf:"group,3,rep,name=Header" json:"header,omitempty"` + Header []*URLFetchRequest_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` Payload []byte `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"` FollowRedirects *bool `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"` Deadline *float64 `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"` @@ -154,9 +166,10 @@ type URLFetchRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} } -func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest) ProtoMessage() {} +func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} } +func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) } +func (*URLFetchRequest) ProtoMessage() {} +func (*URLFetchRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } const Default_URLFetchRequest_FollowRedirects bool = true const Default_URLFetchRequest_MustValidateServerCertificate bool = true @@ -216,9 +229,10 @@ type URLFetchRequest_Header struct { XXX_unrecognized []byte `json:"-"` } -func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} } -func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest_Header) ProtoMessage() {} +func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} } +func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) } +func (*URLFetchRequest_Header) ProtoMessage() {} +func (*URLFetchRequest_Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } func (m *URLFetchRequest_Header) GetKey() string { if m != nil && m.Key != nil { @@ -237,7 +251,7 @@ func (m *URLFetchRequest_Header) GetValue() string { type URLFetchResponse struct { Content []byte `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"` StatusCode *int32 `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"` - Header []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header" json:"header,omitempty"` + Header []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` ContentWasTruncated *bool `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"` ExternalBytesSent *int64 `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"` ExternalBytesReceived *int64 `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"` @@ -248,9 +262,10 @@ type URLFetchResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} } -func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse) ProtoMessage() {} +func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} } +func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) } +func (*URLFetchResponse) ProtoMessage() {} +func (*URLFetchResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } const Default_URLFetchResponse_ContentWasTruncated bool = false const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0 @@ -333,9 +348,10 @@ type URLFetchResponse_Header struct { XXX_unrecognized []byte `json:"-"` } -func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} } -func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse_Header) ProtoMessage() {} +func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} } +func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) } +func (*URLFetchResponse_Header) ProtoMessage() {} +func (*URLFetchResponse_Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } func (m *URLFetchResponse_Header) GetKey() string { if m != nil && m.Key != nil { @@ -352,4 +368,66 @@ func (m *URLFetchResponse_Header) GetValue() string { } func init() { + proto.RegisterType((*URLFetchServiceError)(nil), "appengine.URLFetchServiceError") + proto.RegisterType((*URLFetchRequest)(nil), "appengine.URLFetchRequest") + proto.RegisterType((*URLFetchRequest_Header)(nil), "appengine.URLFetchRequest.Header") + proto.RegisterType((*URLFetchResponse)(nil), "appengine.URLFetchResponse") + proto.RegisterType((*URLFetchResponse_Header)(nil), "appengine.URLFetchResponse.Header") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xe3, 0x54, + 0x10, 0xc6, 0x76, 0x7e, 0xa7, 0x5d, 0x7a, 0x76, 0xb6, 0x45, 0x66, 0xb5, 0xa0, 0x10, 0x09, 0x29, + 0x17, 0x90, 0x2e, 0x2b, 0x24, 0x44, 0xaf, 0x70, 0xed, 0x93, 0xad, 0xa9, 0x63, 0x47, 0xc7, 0x4e, + 0x61, 0xb9, 0xb1, 0xac, 0x78, 0x9a, 0x5a, 0xb2, 0xec, 0x60, 0x9f, 0x2c, 0xf4, 0x35, 0x78, 0x0d, + 0xde, 0x87, 0xa7, 0xe1, 0x02, 0x9d, 0xc4, 0xc9, 0x6e, 0xbb, 0xd1, 0x4a, 0x5c, 0x65, 0xe6, 0x9b, + 0xef, 0xcc, 0x99, 0x7c, 0xdf, 0xf8, 0x80, 0xb3, 0x2c, 0xcb, 0x65, 0x4e, 0xe3, 0x65, 0x99, 0x27, + 0xc5, 0x72, 0x5c, 0x56, 0xcb, 0xf3, 0x64, 0xb5, 0xa2, 0x62, 0x99, 0x15, 0x74, 0x9e, 0x15, 0x92, + 0xaa, 0x22, 0xc9, 0xcf, 0xd7, 0x55, 0x7e, 0x4b, 0x72, 0x71, 0xb7, 0x0f, 0xe2, 0x9a, 0xaa, 0xb7, + 0xd9, 0x82, 0xc6, 0xab, 0xaa, 0x94, 0x25, 0xf6, 0xf7, 0x67, 0x86, 0x7f, 0xeb, 0x70, 0x3a, 0x17, + 0xde, 0x44, 0xb1, 0xc2, 0x2d, 0x89, 0x57, 0x55, 0x59, 0x0d, 0xff, 0xd2, 0xa1, 0xbf, 0x89, 0xec, + 0x32, 0x25, 0xec, 0x80, 0x1e, 0x5c, 0xb3, 0x4f, 0xf0, 0x04, 0x8e, 0x5c, 0xff, 0xc6, 0xf2, 0x5c, + 0x27, 0x9e, 0x0b, 0x8f, 0x69, 0x0a, 0x98, 0xf0, 0xc8, 0xbe, 0x8a, 0xb9, 0x10, 0x81, 0x60, 0x3a, + 0x9e, 0xc1, 0xd3, 0xb9, 0x1f, 0xce, 0xb8, 0xed, 0x4e, 0x5c, 0xee, 0x34, 0xb0, 0x81, 0x9f, 0x01, + 0x0a, 0x1e, 0xce, 0x02, 0x3f, 0xe4, 0x71, 0x14, 0x04, 0xb1, 0x67, 0x89, 0xd7, 0x9c, 0xb5, 0x14, + 0xdd, 0xe1, 0x96, 0xe3, 0xb9, 0x3e, 0x8f, 0xf9, 0xaf, 0x36, 0xe7, 0x0e, 0x77, 0x58, 0x1b, 0x3f, + 0x87, 0xb3, 0x30, 0xf4, 0x62, 0x9b, 0x8b, 0xc8, 0x9d, 0xb8, 0xb6, 0x15, 0xf1, 0xa6, 0x53, 0x07, + 0x9f, 0x40, 0xdf, 0xf1, 0xc3, 0x26, 0xed, 0x22, 0x40, 0xc7, 0xf6, 0x82, 0x90, 0x3b, 0xac, 0x87, + 0x2f, 0xc0, 0x74, 0xfd, 0x88, 0x0b, 0xdf, 0xf2, 0xe2, 0x48, 0x58, 0x7e, 0xe8, 0x72, 0x3f, 0x6a, + 0x98, 0x7d, 0x35, 0x82, 0xba, 0x79, 0x6a, 0xf9, 0x6f, 0x62, 0xc1, 0x1d, 0x57, 0x70, 0x3b, 0x0a, + 0x19, 0xe0, 0x33, 0x38, 0x99, 0x5a, 0xde, 0x24, 0x10, 0x53, 0xee, 0xc4, 0x82, 0xcf, 0xbc, 0x37, + 0xec, 0x08, 0x4f, 0x81, 0xd9, 0x81, 0xef, 0x73, 0x3b, 0x72, 0x03, 0xbf, 0x69, 0x71, 0x3c, 0xfc, + 0xc7, 0x80, 0x93, 0x9d, 0x5a, 0x82, 0x7e, 0x5f, 0x53, 0x2d, 0xf1, 0x27, 0xe8, 0x4c, 0x49, 0xde, + 0x95, 0xa9, 0xa9, 0x0d, 0xf4, 0xd1, 0xa7, 0xaf, 0x46, 0xe3, 0xbd, 0xba, 0xe3, 0x47, 0xdc, 0x71, + 0xf3, 0xbb, 0xe5, 0x8b, 0xe6, 0x1c, 0x32, 0x30, 0xe6, 0x55, 0x6e, 0xea, 0x03, 0x7d, 0xd4, 0x17, + 0x2a, 0xc4, 0x1f, 0xa1, 0x73, 0x47, 0x49, 0x4a, 0x95, 0x69, 0x0c, 0x8c, 0x11, 0xbc, 0xfa, 0xea, + 0x23, 0x3d, 0xaf, 0x36, 0x44, 0xd1, 0x1c, 0xc0, 0x17, 0xd0, 0x9d, 0x25, 0xf7, 0x79, 0x99, 0xa4, + 0x66, 0x67, 0xa0, 0x8d, 0x8e, 0x2f, 0xf5, 0x9e, 0x26, 0x76, 0x10, 0x8e, 0xe1, 0x64, 0x52, 0xe6, + 0x79, 0xf9, 0x87, 0xa0, 0x34, 0xab, 0x68, 0x21, 0x6b, 0xb3, 0x3b, 0xd0, 0x46, 0xbd, 0x8b, 0x96, + 0xac, 0xd6, 0x24, 0x1e, 0x17, 0xf1, 0x39, 0xf4, 0x1c, 0x4a, 0xd2, 0x3c, 0x2b, 0xc8, 0xec, 0x0d, + 0xb4, 0x91, 0x26, 0xf6, 0x39, 0xfe, 0x0c, 0x5f, 0x4c, 0xd7, 0xb5, 0xbc, 0x49, 0xf2, 0x2c, 0x4d, + 0x24, 0xa9, 0xed, 0xa1, 0xca, 0xa6, 0x4a, 0x66, 0xb7, 0xd9, 0x22, 0x91, 0x64, 0xf6, 0xdf, 0xeb, + 0xfc, 0x71, 0xea, 0xf3, 0x97, 0xd0, 0xd9, 0xfe, 0x0f, 0x25, 0xc6, 0x35, 0xdd, 0x9b, 0xad, 0xad, + 0x18, 0xd7, 0x74, 0x8f, 0xa7, 0xd0, 0xbe, 0x49, 0xf2, 0x35, 0x99, 0xed, 0x0d, 0xb6, 0x4d, 0x86, + 0x1e, 0x3c, 0x79, 0xa0, 0x26, 0x76, 0xc1, 0x78, 0xcd, 0x23, 0xa6, 0x61, 0x0f, 0x5a, 0xb3, 0x20, + 0x8c, 0x98, 0xae, 0xa2, 0x2b, 0x6e, 0x39, 0xcc, 0x50, 0xc5, 0xd9, 0x3c, 0x62, 0x2d, 0xb5, 0x2e, + 0x0e, 0xf7, 0x78, 0xc4, 0x59, 0x1b, 0xfb, 0xd0, 0x9e, 0x59, 0x91, 0x7d, 0xc5, 0x3a, 0xc3, 0x7f, + 0x0d, 0x60, 0xef, 0x84, 0xad, 0x57, 0x65, 0x51, 0x13, 0x9a, 0xd0, 0xb5, 0xcb, 0x42, 0x52, 0x21, + 0x4d, 0x4d, 0x49, 0x29, 0x76, 0x29, 0x7e, 0x09, 0x10, 0xca, 0x44, 0xae, 0x6b, 0xf5, 0x71, 0x6c, + 0x8c, 0x6b, 0x8b, 0xf7, 0x10, 0xbc, 0x78, 0xe4, 0xdf, 0xf0, 0xa0, 0x7f, 0xdb, 0x6b, 0x1e, 0x1b, + 0xf8, 0x03, 0x3c, 0x6b, 0xae, 0xf9, 0x25, 0xa9, 0xa3, 0x6a, 0x5d, 0x28, 0x81, 0xb6, 0x66, 0xf6, + 0x2e, 0xda, 0xb7, 0x49, 0x5e, 0x93, 0x38, 0xc4, 0xc0, 0x6f, 0xe0, 0x29, 0xff, 0x73, 0xfb, 0x02, + 0x5c, 0xde, 0x4b, 0xaa, 0x43, 0x35, 0xb8, 0x72, 0xd7, 0x10, 0x1f, 0x16, 0xf0, 0x7b, 0x38, 0x7b, + 0x00, 0x0a, 0x5a, 0x50, 0xf6, 0x96, 0xd2, 0x8d, 0xcd, 0x86, 0x38, 0x5c, 0x54, 0xfb, 0x30, 0xc9, + 0x8a, 0x24, 0x57, 0xfb, 0xaa, 0xec, 0xed, 0x8b, 0x7d, 0x8e, 0xdf, 0x01, 0x5a, 0xab, 0xcc, 0x5e, + 0xad, 0xa7, 0x59, 0x9e, 0x67, 0x35, 0x2d, 0xca, 0x22, 0xad, 0x4d, 0x50, 0xed, 0x2e, 0xb4, 0x97, + 0xe2, 0x40, 0x11, 0xbf, 0x86, 0x63, 0x6b, 0x95, 0xbd, 0x9b, 0xf6, 0x68, 0x47, 0x7e, 0x00, 0xe3, + 0xb7, 0xc0, 0x76, 0xf9, 0x7e, 0xcc, 0xe3, 0x1d, 0xf5, 0x83, 0xd2, 0xff, 0x5f, 0xa6, 0x4b, 0xf8, + 0xad, 0xb7, 0x7b, 0x2a, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x9f, 0x6d, 0x24, 0x63, 0x05, + 0x00, 0x00, } diff --git a/vendor/modules.txt b/vendor/modules.txt index f79d022403..d7d345e32b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,8 +54,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github v17.0.0+incompatible -github.com/google/go-github/github +# github.com/google/go-github/v18 v18.0.0 +github.com/google/go-github/v18/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce @@ -175,7 +175,7 @@ github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/set github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json -# golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f +# golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac golang.org/x/crypto/openpgp golang.org/x/crypto/bcrypt golang.org/x/crypto/ssh @@ -191,7 +191,8 @@ golang.org/x/crypto/poly1305 golang.org/x/crypto/cast5 golang.org/x/crypto/openpgp/elgamal golang.org/x/crypto/ed25519/internal/edwards25519 -# golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7 +golang.org/x/crypto/internal/subtle +# golang.org/x/net v0.0.0-20180826012351-8a410e7b638d golang.org/x/net/context golang.org/x/net/html golang.org/x/net/context/ctxhttp @@ -202,7 +203,7 @@ golang.org/x/net/http/httpguts golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries -# golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179 +# golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be golang.org/x/oauth2 golang.org/x/oauth2/internal # golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 @@ -212,7 +213,7 @@ golang.org/x/text/unicode/norm golang.org/x/text/transform golang.org/x/text/secure/bidirule golang.org/x/text/unicode/bidi -# google.golang.org/appengine v1.0.0 +# google.golang.org/appengine v1.1.0 google.golang.org/appengine/urlfetch google.golang.org/appengine/internal google.golang.org/appengine/internal/urlfetch From 58d0a91487b53feb7f1099f7244ef39a743979b8 Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:23:41 +0000 Subject: [PATCH 3/9] vendor: github.com/google/go-github/github@v18.1.0 Signed-off-by: Trevor Bramwell --- go.mod | 2 +- go.sum | 2 + .../github.com/google/go-github/v18/AUTHORS | 6 ++ .../google/go-github/v18/github/checks.go | 35 +++--- .../go-github/v18/github/event_types.go | 1 + .../go-github/v18/github/github-accessors.go | 72 ++++++++++--- .../google/go-github/v18/github/github.go | 4 +- .../google/go-github/v18/github/issues.go | 2 +- .../google/go-github/v18/github/messages.go | 6 +- .../google/go-github/v18/github/reactions.go | 101 ++++++++++++++++++ .../go-github/v18/github/repos_releases.go | 81 ++++++++++---- .../v18/github/teams_discussion_comments.go | 1 + .../go-github/v18/github/teams_discussions.go | 1 + vendor/modules.txt | 2 +- 14 files changed, 252 insertions(+), 64 deletions(-) diff --git a/go.mod b/go.mod index 2b92cef06e..c62ace5ddd 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v18 v18.0.0 + github.com/google/go-github/v18 v18.1.0 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index b065d3a9d3..85b89f14f0 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-github/v18 v18.0.0 h1:87etQr/RdxNeKgMN05p2JEfYKI4KzH47CbFvE7YpeoI= github.com/google/go-github/v18 v18.0.0/go.mod h1:PVFtHjn6GZk2Z2E2siqOl01XmaQwtfnikCPCM+7WEVc= +github.com/google/go-github/v18 v18.1.0 h1:JxMC0jl4hfMLn3Z0xjm/tRUH2okpE8geAXLE7iH+hxw= +github.com/google/go-github/v18 v18.1.0/go.mod h1:PVFtHjn6GZk2Z2E2siqOl01XmaQwtfnikCPCM+7WEVc= github.com/google/go-github/v18 v18.2.0 h1:s7Y4I8ZlIL1Ofxpj4AQRJcSGAr0Jl2AHThHgXpsUCfU= github.com/google/go-github/v18 v18.2.0/go.mod h1:Bf4Ut1RTeH0WuX7Z4Zf7N+qp/YqgcFOxvTLuSO+aY/k= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= diff --git a/vendor/github.com/google/go-github/v18/AUTHORS b/vendor/github.com/google/go-github/v18/AUTHORS index 7c2f129117..ce1a0b0297 100644 --- a/vendor/github.com/google/go-github/v18/AUTHORS +++ b/vendor/github.com/google/go-github/v18/AUTHORS @@ -38,6 +38,7 @@ Björn Häuser Brad Harris Brad Moylan Bradley Falzon +Brandon Cook Brian Egizi Bryan Boreham Cami Diez @@ -96,6 +97,7 @@ isqua Jameel Haffejee Jan Kosecki Jeremy Morris +Jesse Newland Jihoon Chung Jimmi Dyson Joan Saum @@ -104,6 +106,7 @@ John Barton John Engelman jpbelanger-mtl Juan Basso +Julien Garcia Gonzalez Julien Rostand Justin Abrahms Jusung Lee @@ -123,6 +126,7 @@ Luke Roberts Luke Young Maksim Zhylinski Martin-Louis Bright +Marwan Sulaiman Mat Geist Matt Matt Brender @@ -145,6 +149,7 @@ Parham Alvani Parker Moore parkhyukjun89 Pavel Shtanko +Pete Wagner Petr Shevtsov Pierre Carrier Piotr Zurek @@ -156,6 +161,7 @@ RaviTeja Pothana rc1140 Red Hat, Inc. Rob Figueiredo +Rohit Upadhyay Ronak Jain Ruben Vereecken Ryan Lower diff --git a/vendor/github.com/google/go-github/v18/github/checks.go b/vendor/github.com/google/go-github/v18/github/checks.go index 3549089982..2a6ce4193c 100644 --- a/vendor/github.com/google/go-github/v18/github/checks.go +++ b/vendor/github.com/google/go-github/v18/github/checks.go @@ -19,6 +19,7 @@ type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. type CheckRun struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` HeadSHA *string `json:"head_sha,omitempty"` ExternalID *string `json:"external_id,omitempty"` URL *string `json:"url,omitempty"` @@ -47,14 +48,14 @@ type CheckRunOutput struct { // CheckRunAnnotation represents an annotation object for a CheckRun output. type CheckRunAnnotation struct { - FileName *string `json:"filename,omitempty"` - BlobHRef *string `json:"blob_href,omitempty"` - StartLine *int `json:"start_line,omitempty"` - EndLine *int `json:"end_line,omitempty"` - WarningLevel *string `json:"warning_level,omitempty"` - Message *string `json:"message,omitempty"` - Title *string `json:"title,omitempty"` - RawDetails *string `json:"raw_details,omitempty"` + Path *string `json:"path,omitempty"` + BlobHRef *string `json:"blob_href,omitempty"` + StartLine *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + AnnotationLevel *string `json:"annotation_level,omitempty"` + Message *string `json:"message,omitempty"` + Title *string `json:"title,omitempty"` + RawDetails *string `json:"raw_details,omitempty"` } // CheckRunImage represents an image object for a CheckRun output. @@ -67,6 +68,7 @@ type CheckRunImage struct { // CheckSuite represents a suite of check runs. type CheckSuite struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` HeadBranch *string `json:"head_branch,omitempty"` HeadSHA *string `json:"head_sha,omitempty"` URL *string `json:"url,omitempty"` @@ -401,20 +403,11 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string return checkSuite, resp, nil } -// RequestCheckSuiteOptions sets up the parameters for a request check suite endpoint. -type RequestCheckSuiteOptions struct { - HeadSHA string `json:"head_sha"` // The sha of the head commit. (Required.) -} - -// RequestCheckSuite triggers GitHub to create a new check suite, without pushing new code to a repository. +// ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://developer.github.com/v3/checks/suites/#request-check-suites -func (s *ChecksService) RequestCheckSuite(ctx context.Context, owner, repo string, opt RequestCheckSuiteOptions) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/check-suite-requests", owner, repo) - u, err := addOptions(u, opt) - if err != nil { - return nil, err - } +// GitHub API docs: https://developer.github.com/v3/checks/suites/#rerequest-check-suite +func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) req, err := s.client.NewRequest("POST", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v18/github/event_types.go b/vendor/github.com/google/go-github/v18/github/event_types.go index d68bf581ca..27df3aef57 100644 --- a/vendor/github.com/google/go-github/v18/github/event_types.go +++ b/vendor/github.com/google/go-github/v18/github/event_types.go @@ -519,6 +519,7 @@ type PullRequestEvent struct { // the pull request was closed with unmerged commits. If the action is "closed" // and the merged key is true, the pull request was merged. Action *string `json:"action,omitempty"` + Assignee *User `json:"assignee,omitempty"` Number *int `json:"number,omitempty"` PullRequest *PullRequest `json:"pull_request,omitempty"` diff --git a/vendor/github.com/google/go-github/v18/github/github-accessors.go b/vendor/github.com/google/go-github/v18/github/github-accessors.go index 8d03cc95f5..10ee831a80 100644 --- a/vendor/github.com/google/go-github/v18/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v18/github/github-accessors.go @@ -532,6 +532,14 @@ func (c *CheckRun) GetName() string { return *c.Name } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CheckRun) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + // GetOutput returns the Output field. func (c *CheckRun) GetOutput() *CheckRunOutput { if c == nil { @@ -564,6 +572,14 @@ func (c *CheckRun) GetURL() string { return *c.URL } +// GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise. +func (c *CheckRunAnnotation) GetAnnotationLevel() string { + if c == nil || c.AnnotationLevel == nil { + return "" + } + return *c.AnnotationLevel +} + // GetBlobHRef returns the BlobHRef field if it's non-nil, zero value otherwise. func (c *CheckRunAnnotation) GetBlobHRef() string { if c == nil || c.BlobHRef == nil { @@ -580,14 +596,6 @@ func (c *CheckRunAnnotation) GetEndLine() int { return *c.EndLine } -// GetFileName returns the FileName field if it's non-nil, zero value otherwise. -func (c *CheckRunAnnotation) GetFileName() string { - if c == nil || c.FileName == nil { - return "" - } - return *c.FileName -} - // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (c *CheckRunAnnotation) GetMessage() string { if c == nil || c.Message == nil { @@ -596,6 +604,14 @@ func (c *CheckRunAnnotation) GetMessage() string { return *c.Message } +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (c *CheckRunAnnotation) GetPath() string { + if c == nil || c.Path == nil { + return "" + } + return *c.Path +} + // GetRawDetails returns the RawDetails field if it's non-nil, zero value otherwise. func (c *CheckRunAnnotation) GetRawDetails() string { if c == nil || c.RawDetails == nil { @@ -620,14 +636,6 @@ func (c *CheckRunAnnotation) GetTitle() string { return *c.Title } -// GetWarningLevel returns the WarningLevel field if it's non-nil, zero value otherwise. -func (c *CheckRunAnnotation) GetWarningLevel() string { - if c == nil || c.WarningLevel == nil { - return "" - } - return *c.WarningLevel -} - // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CheckRunEvent) GetAction() string { if c == nil || c.Action == nil { @@ -796,6 +804,14 @@ func (c *CheckSuite) GetID() int64 { return *c.ID } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + // GetRepository returns the Repository field. func (c *CheckSuite) GetRepository() *Repository { if c == nil { @@ -2380,6 +2396,14 @@ func (d *DiscussionComment) GetNumber() int { return *d.Number } +// GetReactions returns the Reactions field. +func (d *DiscussionComment) GetReactions() *Reactions { + if d == nil { + return nil + } + return d.Reactions +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (d *DiscussionComment) GetUpdatedAt() Timestamp { if d == nil || d.UpdatedAt == nil { @@ -7228,6 +7252,14 @@ func (p *PullRequestEvent) GetAction() string { return *p.Action } +// GetAssignee returns the Assignee field. +func (p *PullRequestEvent) GetAssignee() *User { + if p == nil { + return nil + } + return p.Assignee +} + // GetChanges returns the Changes field. func (p *PullRequestEvent) GetChanges() *EditChange { if p == nil { @@ -10564,6 +10596,14 @@ func (t *TeamDiscussion) GetPrivate() bool { return *t.Private } +// GetReactions returns the Reactions field. +func (t *TeamDiscussion) GetReactions() *Reactions { + if t == nil { + return nil + } + return t.Reactions +} + // GetTeamURL returns the TeamURL field if it's non-nil, zero value otherwise. func (t *TeamDiscussion) GetTeamURL() string { if t == nil || t.TeamURL == nil { diff --git a/vendor/github.com/google/go-github/v18/github/github.go b/vendor/github.com/google/go-github/v18/github/github.go index 0685852db3..af1f1b23eb 100644 --- a/vendor/github.com/google/go-github/v18/github/github.go +++ b/vendor/github.com/google/go-github/v18/github/github.go @@ -375,7 +375,9 @@ type Response struct { FirstPage int LastPage int - Rate + // Explicitly specify the Rate type so Rate's String() receiver doesn't + // propagate to Response. + Rate Rate } // newResponse creates a new Response for the provided http.Response. diff --git a/vendor/github.com/google/go-github/v18/github/issues.go b/vendor/github.com/google/go-github/v18/github/issues.go index 47537544a4..1e0991ce4f 100644 --- a/vendor/github.com/google/go-github/v18/github/issues.go +++ b/vendor/github.com/google/go-github/v18/github/issues.go @@ -228,7 +228,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} + acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeIntegrationPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var issues []*Issue diff --git a/vendor/github.com/google/go-github/v18/github/messages.go b/vendor/github.com/google/go-github/v18/github/messages.go index b8d3380e7a..519c1c03db 100644 --- a/vendor/github.com/google/go-github/v18/github/messages.go +++ b/vendor/github.com/google/go-github/v18/github/messages.go @@ -175,19 +175,19 @@ func ValidatePayload(r *http.Request, secretKey []byte) (payload []byte, err err } sig := r.Header.Get(signatureHeader) - if err := validateSignature(sig, body, secretKey); err != nil { + if err := ValidateSignature(sig, body, secretKey); err != nil { return nil, err } return payload, nil } -// validateSignature validates the signature for the given payload. +// ValidateSignature validates the signature for the given payload. // signature is the GitHub hash signature delivered in the X-Hub-Signature header. // payload is the JSON payload sent by GitHub Webhooks. // secretKey is the GitHub Webhook secret message. // // GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github -func validateSignature(signature string, payload, secretKey []byte) error { +func ValidateSignature(signature string, payload, secretKey []byte) error { messageMAC, hashFunc, err := messageMAC(signature) if err != nil { return err diff --git a/vendor/github.com/google/go-github/v18/github/reactions.go b/vendor/github.com/google/go-github/v18/github/reactions.go index 97b2818cd5..ddc055cb1b 100644 --- a/vendor/github.com/google/go-github/v18/github/reactions.go +++ b/vendor/github.com/google/go-github/v18/github/reactions.go @@ -74,6 +74,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // CreateCommentReaction creates a reaction for a commit comment. // Note that if you have already created a reaction of type content, the // previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment func (s ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { @@ -127,6 +128,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // CreateIssueReaction creates a reaction for an issue. // Note that if you have already created a reaction of type content, the // previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue func (s ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { @@ -180,6 +182,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // CreateIssueCommentReaction creates a reaction for an issue comment. // Note that if you have already created a reaction of type content, the // previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment func (s ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { @@ -233,6 +236,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // CreatePullRequestCommentReaction creates a reaction for a pull request review comment. // Note that if you have already created a reaction of type content, the // previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { @@ -256,6 +260,103 @@ func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, return m, resp, nil } +// ListTeamDiscussionReactions lists the reactions for a team discussion. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opt *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateTeamDiscussionReaction creates a reaction for a team discussion. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion +func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opt *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + + return m, resp, nil +} + +// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment +func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + // DeleteReaction deletes a reaction. // // GitHub API docs: https://developer.github.com/v3/reaction/reactions/#delete-a-reaction-archive diff --git a/vendor/github.com/google/go-github/v18/github/repos_releases.go b/vendor/github.com/google/go-github/v18/github/repos_releases.go index c23601d1a5..bf58743ebd 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v18/github/repos_releases.go @@ -19,24 +19,26 @@ import ( // RepositoryRelease represents a GitHub release in a repository. type RepositoryRelease struct { - ID *int64 `json:"id,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PublishedAt *Timestamp `json:"published_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - AssetsURL *string `json:"assets_url,omitempty"` - Assets []ReleaseAsset `json:"assets,omitempty"` - UploadURL *string `json:"upload_url,omitempty"` - ZipballURL *string `json:"zipball_url,omitempty"` - TarballURL *string `json:"tarball_url,omitempty"` - Author *User `json:"author,omitempty"` - NodeID *string `json:"node_id,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + + // The following fields are not used in CreateRelease or EditRelease: + ID *int64 `json:"id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + AssetsURL *string `json:"assets_url,omitempty"` + Assets []ReleaseAsset `json:"assets,omitempty"` + UploadURL *string `json:"upload_url,omitempty"` + ZipballURL *string `json:"zipball_url,omitempty"` + TarballURL *string `json:"tarball_url,omitempty"` + Author *User `json:"author,omitempty"` + NodeID *string `json:"node_id,omitempty"` } func (r RepositoryRelease) String() string { @@ -125,13 +127,40 @@ func (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) return release, resp, nil } +// repositoryReleaseRequest is a subset of RepositoryRelease and +// is used internally by CreateRelease and EditRelease to pass +// only the known fields for these endpoints. +// +// See https://github.com/google/go-github/issues/992 for more +// information. +type repositoryReleaseRequest struct { + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` +} + // CreateRelease adds a new release for a repository. // +// Note that only a subset of the release fields are used. +// See RepositoryRelease for more information. +// // GitHub API docs: https://developer.github.com/v3/repos/releases/#create-a-release func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) - req, err := s.client.NewRequest("POST", u, release) + releaseReq := &repositoryReleaseRequest{ + TagName: release.TagName, + TargetCommitish: release.TargetCommitish, + Name: release.Name, + Body: release.Body, + Draft: release.Draft, + Prerelease: release.Prerelease, + } + + req, err := s.client.NewRequest("POST", u, releaseReq) if err != nil { return nil, nil, err } @@ -146,11 +175,23 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // EditRelease edits a repository release. // +// Note that only a subset of the release fields are used. +// See RepositoryRelease for more information. +// // GitHub API docs: https://developer.github.com/v3/repos/releases/#edit-a-release func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, release) + releaseReq := &repositoryReleaseRequest{ + TagName: release.TagName, + TargetCommitish: release.TargetCommitish, + Name: release.Name, + Body: release.Body, + Draft: release.Draft, + Prerelease: release.Prerelease, + } + + req, err := s.client.NewRequest("PATCH", u, releaseReq) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go index 383d559eef..a0206b9c92 100644 --- a/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go @@ -24,6 +24,7 @@ type DiscussionComment struct { Number *int `json:"number,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` URL *string `json:"url,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` } func (c DiscussionComment) String() string { diff --git a/vendor/github.com/google/go-github/v18/github/teams_discussions.go b/vendor/github.com/google/go-github/v18/github/teams_discussions.go index 5db06d109c..f491c9d1d6 100644 --- a/vendor/github.com/google/go-github/v18/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/v18/github/teams_discussions.go @@ -29,6 +29,7 @@ type TeamDiscussion struct { Title *string `json:"title,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` URL *string `json:"url,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` } func (d TeamDiscussion) String() string { diff --git a/vendor/modules.txt b/vendor/modules.txt index d7d345e32b..1a7ab26d05 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,7 +54,7 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v18 v18.0.0 +# github.com/google/go-github/v18 v18.1.0 github.com/google/go-github/v18/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query From feba2ae5271dc2ae890c9adfa2b7f499e68a606c Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:24:28 +0000 Subject: [PATCH 4/9] vendor: github.com/google/go-github/github@v18.2.0 Signed-off-by: Trevor Bramwell --- go.mod | 2 +- .../github.com/google/go-github/v18/AUTHORS | 3 + .../go-github/v18/github/activity_star.go | 6 +- .../go-github/v18/github/event_types.go | 4 + .../go-github/v18/github/github-accessors.go | 104 ++++++++++++++++++ .../go-github/v18/github/issues_comments.go | 1 + .../google/go-github/v18/github/orgs.go | 51 ++++----- .../google/go-github/v18/github/orgs_hooks.go | 13 ++- .../google/go-github/v18/github/pulls.go | 22 +++- .../google/go-github/v18/github/repos.go | 51 ++++++++- .../go-github/v18/github/repos_hooks.go | 46 ++++++-- vendor/modules.txt | 2 +- 12 files changed, 262 insertions(+), 43 deletions(-) diff --git a/go.mod b/go.mod index c62ace5ddd..1d06cb143a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v18 v18.1.0 + github.com/google/go-github/v18 v18.2.0 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/vendor/github.com/google/go-github/v18/AUTHORS b/vendor/github.com/google/go-github/v18/AUTHORS index ce1a0b0297..862f2c8644 100644 --- a/vendor/github.com/google/go-github/v18/AUTHORS +++ b/vendor/github.com/google/go-github/v18/AUTHORS @@ -71,6 +71,7 @@ Drew Fradette Eli Uriegas Elliott Beach Emerson Wood +eperm erwinvaneyk Fabrice Filippo Valsorda @@ -79,6 +80,7 @@ Francesc Gil Francis Fredrik Jönsson Garrett Squire +George Kontridze Georgy Buranov Gnahz Google Inc. @@ -156,6 +158,7 @@ Piotr Zurek Quinn Slack Rackspace US, Inc. Radek Simko +Radliński Ignacy Rajendra arora RaviTeja Pothana rc1140 diff --git a/vendor/github.com/google/go-github/v18/github/activity_star.go b/vendor/github.com/google/go-github/v18/github/activity_star.go index d5b067127c..5ae5c10165 100644 --- a/vendor/github.com/google/go-github/v18/github/activity_star.go +++ b/vendor/github.com/google/go-github/v18/github/activity_star.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "strings" ) // StarredRepository is returned by ListStarred. @@ -84,8 +85,9 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opt *Act return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeStarringPreview) + // TODO: remove custom Accept header when APIs fully launch + acceptHeaders := []string{mediaTypeStarringPreview, mediaTypeTopicsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*StarredRepository resp, err := s.client.Do(ctx, req, &repos) diff --git a/vendor/github.com/google/go-github/v18/github/event_types.go b/vendor/github.com/google/go-github/v18/github/event_types.go index 27df3aef57..9f49b34f9b 100644 --- a/vendor/github.com/google/go-github/v18/github/event_types.go +++ b/vendor/github.com/google/go-github/v18/github/event_types.go @@ -533,6 +533,10 @@ type PullRequestEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Label *Label `json:"label,omitempty"` // Populated in "labeled" event deliveries. + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PullRequestReviewEvent is triggered when a review is submitted on a pull diff --git a/vendor/github.com/google/go-github/v18/github/github-accessors.go b/vendor/github.com/google/go-github/v18/github/github-accessors.go index 10ee831a80..888273d7ef 100644 --- a/vendor/github.com/google/go-github/v18/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v18/github/github-accessors.go @@ -3884,6 +3884,14 @@ func (i *IssueComment) GetIssueURL() string { return *i.IssueURL } +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (i *IssueComment) GetNodeID() string { + if i == nil || i.NodeID == nil { + return "" + } + return *i.NodeID +} + // GetReactions returns the Reactions field. func (i *IssueComment) GetReactions() *Reactions { if i == nil { @@ -5732,6 +5740,14 @@ func (o *Organization) GetTotalPrivateRepos() int { return *o.TotalPrivateRepos } +// GetTwoFactorRequirementEnabled returns the TwoFactorRequirementEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetTwoFactorRequirementEnabled() bool { + if o == nil || o.TwoFactorRequirementEnabled == nil { + return false + } + return *o.TwoFactorRequirementEnabled +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (o *Organization) GetType() string { if o == nil || o.Type == nil { @@ -6180,6 +6196,78 @@ func (p *PreReceiveHook) GetName() string { return *p.Name } +// GetHRef returns the HRef field if it's non-nil, zero value otherwise. +func (p *PRLink) GetHRef() string { + if p == nil || p.HRef == nil { + return "" + } + return *p.HRef +} + +// GetComments returns the Comments field. +func (p *PRLinks) GetComments() *PRLink { + if p == nil { + return nil + } + return p.Comments +} + +// GetCommits returns the Commits field. +func (p *PRLinks) GetCommits() *PRLink { + if p == nil { + return nil + } + return p.Commits +} + +// GetHTML returns the HTML field. +func (p *PRLinks) GetHTML() *PRLink { + if p == nil { + return nil + } + return p.HTML +} + +// GetIssue returns the Issue field. +func (p *PRLinks) GetIssue() *PRLink { + if p == nil { + return nil + } + return p.Issue +} + +// GetReviewComment returns the ReviewComment field. +func (p *PRLinks) GetReviewComment() *PRLink { + if p == nil { + return nil + } + return p.ReviewComment +} + +// GetReviewComments returns the ReviewComments field. +func (p *PRLinks) GetReviewComments() *PRLink { + if p == nil { + return nil + } + return p.ReviewComments +} + +// GetSelf returns the Self field. +func (p *PRLinks) GetSelf() *PRLink { + if p == nil { + return nil + } + return p.Self +} + +// GetStatuses returns the Statuses field. +func (p *PRLinks) GetStatuses() *PRLink { + if p == nil { + return nil + } + return p.Statuses +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (p *Project) GetBody() string { if p == nil || p.Body == nil { @@ -6908,6 +6996,14 @@ func (p *PullRequest) GetIssueURL() string { return *p.IssueURL } +// GetLinks returns the Links field. +func (p *PullRequest) GetLinks() *PRLinks { + if p == nil { + return nil + } + return p.Links +} + // GetMaintainerCanModify returns the MaintainerCanModify field if it's non-nil, zero value otherwise. func (p *PullRequest) GetMaintainerCanModify() bool { if p == nil || p.MaintainerCanModify == nil { @@ -7292,6 +7388,14 @@ func (p *PullRequestEvent) GetNumber() int { return *p.Number } +// GetOrganization returns the Organization field. +func (p *PullRequestEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestEvent) GetPullRequest() *PullRequest { if p == nil { diff --git a/vendor/github.com/google/go-github/v18/github/issues_comments.go b/vendor/github.com/google/go-github/v18/github/issues_comments.go index e6f6f21909..ab68afe2fa 100644 --- a/vendor/github.com/google/go-github/v18/github/issues_comments.go +++ b/vendor/github.com/google/go-github/v18/github/issues_comments.go @@ -14,6 +14,7 @@ import ( // IssueComment represents a comment left on an issue. type IssueComment struct { ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` Body *string `json:"body,omitempty"` User *User `json:"user,omitempty"` Reactions *Reactions `json:"reactions,omitempty"` diff --git a/vendor/github.com/google/go-github/v18/github/orgs.go b/vendor/github.com/google/go-github/v18/github/orgs.go index 044dff57af..3be91a3eed 100644 --- a/vendor/github.com/google/go-github/v18/github/orgs.go +++ b/vendor/github.com/google/go-github/v18/github/orgs.go @@ -19,31 +19,32 @@ type OrganizationsService service // Organization represents a GitHub organization account. type Organization struct { - Login *string `json:"login,omitempty"` - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - AvatarURL *string `json:"avatar_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - Name *string `json:"name,omitempty"` - Company *string `json:"company,omitempty"` - Blog *string `json:"blog,omitempty"` - Location *string `json:"location,omitempty"` - Email *string `json:"email,omitempty"` - Description *string `json:"description,omitempty"` - PublicRepos *int `json:"public_repos,omitempty"` - PublicGists *int `json:"public_gists,omitempty"` - Followers *int `json:"followers,omitempty"` - Following *int `json:"following,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - TotalPrivateRepos *int `json:"total_private_repos,omitempty"` - OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` - PrivateGists *int `json:"private_gists,omitempty"` - DiskUsage *int `json:"disk_usage,omitempty"` - Collaborators *int `json:"collaborators,omitempty"` - BillingEmail *string `json:"billing_email,omitempty"` - Type *string `json:"type,omitempty"` - Plan *Plan `json:"plan,omitempty"` + Login *string `json:"login,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + AvatarURL *string `json:"avatar_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + Name *string `json:"name,omitempty"` + Company *string `json:"company,omitempty"` + Blog *string `json:"blog,omitempty"` + Location *string `json:"location,omitempty"` + Email *string `json:"email,omitempty"` + Description *string `json:"description,omitempty"` + PublicRepos *int `json:"public_repos,omitempty"` + PublicGists *int `json:"public_gists,omitempty"` + Followers *int `json:"followers,omitempty"` + Following *int `json:"following,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + TotalPrivateRepos *int `json:"total_private_repos,omitempty"` + OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` + PrivateGists *int `json:"private_gists,omitempty"` + DiskUsage *int `json:"disk_usage,omitempty"` + Collaborators *int `json:"collaborators,omitempty"` + BillingEmail *string `json:"billing_email,omitempty"` + Type *string `json:"type,omitempty"` + Plan *Plan `json:"plan,omitempty"` + TwoFactorRequirementEnabled *bool `json:"two_factor_requirement_enabled,omitempty"` // API URLs URL *string `json:"url,omitempty"` diff --git a/vendor/github.com/google/go-github/v18/github/orgs_hooks.go b/vendor/github.com/google/go-github/v18/github/orgs_hooks.go index ab1d02da7f..c4dc134c4e 100644 --- a/vendor/github.com/google/go-github/v18/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/v18/github/orgs_hooks.go @@ -51,10 +51,21 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // CreateHook creates a Hook for the specified org. // Name and Config are required fields. // +// Note that only a subset of the hook fields are used and hook must +// not be nil. +// // GitHub API docs: https://developer.github.com/v3/orgs/hooks/#create-a-hook func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) - req, err := s.client.NewRequest("POST", u, hook) + + hookReq := &createHookRequest{ + Name: hook.Name, + Events: hook.Events, + Active: hook.Active, + Config: hook.Config, + } + + req, err := s.client.NewRequest("POST", u, hookReq) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/google/go-github/v18/github/pulls.go b/vendor/github.com/google/go-github/v18/github/pulls.go index a123ec5686..32655651e3 100644 --- a/vendor/github.com/google/go-github/v18/github/pulls.go +++ b/vendor/github.com/google/go-github/v18/github/pulls.go @@ -60,8 +60,9 @@ type PullRequest struct { NodeID *string `json:"node_id,omitempty"` RequestedReviewers []*User `json:"requested_reviewers,omitempty"` - Head *PullRequestBranch `json:"head,omitempty"` - Base *PullRequestBranch `json:"base,omitempty"` + Links *PRLinks `json:"_links,omitempty"` + Head *PullRequestBranch `json:"head,omitempty"` + Base *PullRequestBranch `json:"base,omitempty"` // ActiveLockReason is populated only when LockReason is provided while locking the pull request. // Possible values are: "off-topic", "too heated", "resolved", and "spam". @@ -72,6 +73,23 @@ func (p PullRequest) String() string { return Stringify(p) } +// PRLink represents a single link object from Github pull request _links. +type PRLink struct { + HRef *string `json:"href,omitempty"` +} + +// PRLinks represents the "_links" object in a Github pull request. +type PRLinks struct { + Self *PRLink `json:"self,omitempty"` + HTML *PRLink `json:"html,omitempty"` + Issue *PRLink `json:"issue,omitempty"` + Comments *PRLink `json:"comments,omitempty"` + ReviewComments *PRLink `json:"review_comments,omitempty"` + ReviewComment *PRLink `json:"review_comment,omitempty"` + Commits *PRLink `json:"commits,omitempty"` + Statuses *PRLink `json:"statuses,omitempty"` +} + // PullRequestBranch represents a base or head branch in a GitHub pull request. type PullRequestBranch struct { Label *string `json:"label,omitempty"` diff --git a/vendor/github.com/google/go-github/v18/github/repos.go b/vendor/github.com/google/go-github/v18/github/repos.go index fe05272a93..e783ccbea0 100644 --- a/vendor/github.com/google/go-github/v18/github/repos.go +++ b/vendor/github.com/google/go-github/v18/github/repos.go @@ -56,6 +56,7 @@ type Repository struct { AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` Topics []string `json:"topics,omitempty"` + Archived *bool `json:"archived,omitempty"` // Only provided when using RepositoriesService.Get while in preview License *License `json:"license,omitempty"` @@ -69,7 +70,6 @@ type Repository struct { HasDownloads *bool `json:"has_downloads,omitempty"` LicenseTemplate *string `json:"license_template,omitempty"` GitignoreTemplate *string `json:"gitignore_template,omitempty"` - Archived *bool `json:"archived,omitempty"` // Creating an organization repository. Required for non-owners. TeamID *int64 `json:"team_id,omitempty"` @@ -259,10 +259,40 @@ func (s *RepositoriesService) ListAll(ctx context.Context, opt *RepositoryListAl return repos, resp, nil } +// createRepoRequest is a subset of Repository and is used internally +// by Create to pass only the known fields for the endpoint. +// +// See https://github.com/google/go-github/issues/1014 for more +// information. +type createRepoRequest struct { + // Name is required when creating a repo. + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Homepage *string `json:"homepage,omitempty"` + + Private *bool `json:"private,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasProjects *bool `json:"has_projects,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + + // Creating an organization repository. Required for non-owners. + TeamID *int64 `json:"team_id,omitempty"` + + AutoInit *bool `json:"auto_init,omitempty"` + GitignoreTemplate *string `json:"gitignore_template,omitempty"` + LicenseTemplate *string `json:"license_template,omitempty"` + AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` + AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` + AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"` +} + // Create a new repository. If an organization is specified, the new // repository will be created under that org. If the empty string is // specified, it will be created for the authenticated user. // +// Note that only a subset of the repo fields are used and repo must +// not be nil. +// // GitHub API docs: https://developer.github.com/v3/repos/#create func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string @@ -272,7 +302,24 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo u = "user/repos" } - req, err := s.client.NewRequest("POST", u, repo) + repoReq := &createRepoRequest{ + Name: repo.Name, + Description: repo.Description, + Homepage: repo.Homepage, + Private: repo.Private, + HasIssues: repo.HasIssues, + HasProjects: repo.HasProjects, + HasWiki: repo.HasWiki, + TeamID: repo.TeamID, + AutoInit: repo.AutoInit, + GitignoreTemplate: repo.GitignoreTemplate, + LicenseTemplate: repo.LicenseTemplate, + AllowSquashMerge: repo.AllowSquashMerge, + AllowMergeCommit: repo.AllowMergeCommit, + AllowRebaseMerge: repo.AllowRebaseMerge, + } + + req, err := s.client.NewRequest("POST", u, repoReq) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/google/go-github/v18/github/repos_hooks.go b/vendor/github.com/google/go-github/v18/github/repos_hooks.go index 1e9e884801..564f5e576f 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v18/github/repos_hooks.go @@ -69,27 +69,55 @@ func (w WebHookAuthor) String() string { // Hook represents a GitHub (web and service) hook for a repository. type Hook struct { - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - Events []string `json:"events,omitempty"` - Active *bool `json:"active,omitempty"` - Config map[string]interface{} `json:"config,omitempty"` - ID *int64 `json:"id,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + ID *int64 `json:"id,omitempty"` + + // Only the following fields are used when creating a hook. + // Name and Config are required. + Name *string `json:"name,omitempty"` + Config map[string]interface{} `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` } func (h Hook) String() string { return Stringify(h) } +// createHookRequest is a subset of Hook and is used internally +// by CreateHook to pass only the known fields for the endpoint. +// +// See https://github.com/google/go-github/issues/1015 for more +// information. +type createHookRequest struct { + // Name and Config are required. + // Name must be passed as "web". + Name *string `json:"name,omitempty"` + Config map[string]interface{} `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` +} + // CreateHook creates a Hook for the specified repository. // Name and Config are required fields. // +// Note that only a subset of the hook fields are used and hook must +// not be nil. +// // GitHub API docs: https://developer.github.com/v3/repos/hooks/#create-a-hook func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) - req, err := s.client.NewRequest("POST", u, hook) + + hookReq := &createHookRequest{ + Name: hook.Name, + Events: hook.Events, + Active: hook.Active, + Config: hook.Config, + } + + req, err := s.client.NewRequest("POST", u, hookReq) if err != nil { return nil, nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1a7ab26d05..869085287a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,7 +54,7 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v18 v18.1.0 +# github.com/google/go-github/v18 v18.2.0 github.com/google/go-github/v18/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query From f8097bdc0742f245edbb7ab399989de0cce29343 Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:46:46 +0000 Subject: [PATCH 5/9] vendor: github.com/google/go-github/github@v19.0.0 Signed-off-by: Trevor Bramwell --- github/config.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 8 +- ...source_github_organization_webhook_test.go | 5 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 7 +- ...resource_github_repository_webhook_test.go | 5 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 17 +- .../google/go-github/{v18 => v19}/AUTHORS | 12 ++ .../google/go-github/{v18 => v19}/LICENSE | 0 .../go-github/{v18 => v19}/github/activity.go | 0 .../{v18 => v19}/github/activity_events.go | 2 + .../github/activity_notifications.go | 0 .../{v18 => v19}/github/activity_star.go | 0 .../{v18 => v19}/github/activity_watching.go | 0 .../go-github/{v18 => v19}/github/admin.go | 0 .../{v18 => v19}/github/admin_stats.go | 0 .../go-github/{v18 => v19}/github/apps.go | 2 +- .../{v18 => v19}/github/apps_installation.go | 0 .../{v18 => v19}/github/apps_marketplace.go | 53 +++--- .../{v18 => v19}/github/authorizations.go | 0 .../go-github/{v18 => v19}/github/checks.go | 0 .../go-github/{v18 => v19}/github/doc.go | 0 .../{v18 => v19}/github/event_types.go | 23 ++- .../{v18 => v19}/github/gen-accessors.go | 0 .../go-github/{v18 => v19}/github/gists.go | 0 .../{v18 => v19}/github/gists_comments.go | 0 .../go-github/{v18 => v19}/github/git.go | 0 .../{v18 => v19}/github/git_blobs.go | 0 .../{v18 => v19}/github/git_commits.go | 2 +- .../go-github/{v18 => v19}/github/git_refs.go | 0 .../go-github/{v18 => v19}/github/git_tags.go | 2 +- .../{v18 => v19}/github/git_trees.go | 0 .../{v18 => v19}/github/github-accessors.go | 156 ++++++++++++++++-- .../go-github/{v18 => v19}/github/github.go | 33 +++- .../{v18 => v19}/github/gitignore.go | 0 .../go-github/{v18 => v19}/github/issues.go | 0 .../{v18 => v19}/github/issues_assignees.go | 0 .../{v18 => v19}/github/issues_comments.go | 0 .../{v18 => v19}/github/issues_events.go | 0 .../{v18 => v19}/github/issues_labels.go | 0 .../{v18 => v19}/github/issues_milestones.go | 0 .../{v18 => v19}/github/issues_timeline.go | 0 .../go-github/{v18 => v19}/github/licenses.go | 0 .../go-github/{v18 => v19}/github/messages.go | 73 ++++---- .../{v18 => v19}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v18 => v19}/github/migrations_user.go | 0 .../go-github/{v18 => v19}/github/misc.go | 0 .../go-github/{v18 => v19}/github/orgs.go | 10 ++ .../{v18 => v19}/github/orgs_hooks.go | 3 +- .../{v18 => v19}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v18 => v19}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v18 => v19}/github/projects.go | 2 +- .../go-github/{v18 => v19}/github/pulls.go | 6 +- .../{v18 => v19}/github/pulls_comments.go | 0 .../{v18 => v19}/github/pulls_reviewers.go | 0 .../{v18 => v19}/github/pulls_reviews.go | 0 .../{v18 => v19}/github/reactions.go | 0 .../go-github/{v18 => v19}/github/repos.go | 68 ++++++++ .../github/repos_collaborators.go | 0 .../{v18 => v19}/github/repos_comments.go | 0 .../{v18 => v19}/github/repos_commits.go | 21 +-- .../github/repos_community_health.go | 0 .../{v18 => v19}/github/repos_contents.go | 0 .../{v18 => v19}/github/repos_deployments.go | 11 +- .../{v18 => v19}/github/repos_forks.go | 13 +- .../{v18 => v19}/github/repos_hooks.go | 10 +- .../{v18 => v19}/github/repos_invitations.go | 0 .../{v18 => v19}/github/repos_keys.go | 0 .../{v18 => v19}/github/repos_merging.go | 0 .../{v18 => v19}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v18 => v19}/github/repos_projects.go | 0 .../{v18 => v19}/github/repos_releases.go | 0 .../{v18 => v19}/github/repos_stats.go | 0 .../{v18 => v19}/github/repos_statuses.go | 0 .../{v18 => v19}/github/repos_traffic.go | 0 .../go-github/{v18 => v19}/github/search.go | 0 .../go-github/{v18 => v19}/github/strings.go | 0 .../go-github/{v18 => v19}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v18 => v19}/github/teams_discussions.go | 0 .../{v18 => v19}/github/teams_members.go | 0 .../{v18 => v19}/github/timestamp.go | 0 .../go-github/{v18 => v19}/github/users.go | 58 +++---- .../github/users_administration.go | 0 .../{v18 => v19}/github/users_blocking.go | 0 .../{v18 => v19}/github/users_emails.go | 0 .../{v18 => v19}/github/users_followers.go | 0 .../{v18 => v19}/github/users_gpg_keys.go | 0 .../{v18 => v19}/github/users_keys.go | 0 .../{v18 => v19}/github/with_appengine.go | 0 .../{v18 => v19}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 127 files changed, 473 insertions(+), 199 deletions(-) rename vendor/github.com/google/go-github/{v18 => v19}/AUTHORS (94%) rename vendor/github.com/google/go-github/{v18 => v19}/LICENSE (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/activity_events.go (99%) rename vendor/github.com/google/go-github/{v18 => v19}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/apps.go (99%) rename vendor/github.com/google/go-github/{v18 => v19}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/apps_marketplace.go (68%) rename vendor/github.com/google/go-github/{v18 => v19}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/checks.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/doc.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/event_types.go (96%) rename vendor/github.com/google/go-github/{v18 => v19}/github/gen-accessors.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git_commits.go (98%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git_tags.go (98%) rename vendor/github.com/google/go-github/{v18 => v19}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/github-accessors.go (98%) rename vendor/github.com/google/go-github/{v18 => v19}/github/github.go (97%) rename vendor/github.com/google/go-github/{v18 => v19}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/messages.go (76%) rename vendor/github.com/google/go-github/{v18 => v19}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs.go (91%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs_hooks.go (98%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/projects.go (99%) rename vendor/github.com/google/go-github/{v18 => v19}/github/pulls.go (98%) rename vendor/github.com/google/go-github/{v18 => v19}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos.go (94%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_commits.go (92%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_deployments.go (93%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_forks.go (91%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_hooks.go (96%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/search.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/teams.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users.go (79%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v18 => v19}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index a65738c1fb..07dba53834 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index c0be9f6fce..ba7d0e9bfd 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 1018f07759..10ba84e6f4 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index 683aacc280..c085714aa8 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index cb5e33f81e..41a490cfdc 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index e5b2c3880d..1a56e1a23f 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index f49f974f12..f070b7e3de 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 7ca75349dc..d086a6f3fc 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 5a6b05df4e..9da57695b5 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 6b5a402098..a516e48d49 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index ae3765ddad..849d791126 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 5889c359b7..259ceca7b8 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) @@ -68,7 +68,6 @@ func resourceGithubOrganizationWebhookObject(d *schema.ResourceData) *github.Hoo } hook := &github.Hook{ - Name: github.String(d.Get("name").(string)), URL: github.String(d.Get("url").(string)), Events: events, Active: github.Bool(d.Get("active").(bool)), @@ -89,8 +88,8 @@ func resourceGithubOrganizationWebhookCreate(d *schema.ResourceData, meta interf webhookObj := resourceGithubOrganizationWebhookObject(d) ctx := context.Background() - log.Printf("[DEBUG] Creating organization webhook: %s (%s)", - webhookObj.GetName(), orgName) + log.Printf("[DEBUG] Creating organization webhook: %d (%s)", + webhookObj.GetID(), orgName) hook, _, err := client.Organizations.CreateHook(ctx, orgName, webhookObj) if err != nil { @@ -132,7 +131,6 @@ func resourceGithubOrganizationWebhookRead(d *schema.ResourceData, meta interfac } d.Set("etag", resp.Header.Get("ETag")) - d.Set("name", hook.Name) d.Set("url", hook.URL) d.Set("active", hook.Active) d.Set("events", hook.Events) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index 04b8fee4f1..4172363b8e 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -122,9 +122,6 @@ type testAccGithubOrganizationWebhookExpectedAttributes struct { func testAccCheckGithubOrganizationWebhookAttributes(hook *github.Hook, want *testAccGithubOrganizationWebhookExpectedAttributes) resource.TestCheckFunc { return func(s *terraform.State) error { - if *hook.Name != want.Name { - return fmt.Errorf("got hook %q; want %q", *hook.Name, want.Name) - } if *hook.Active != want.Active { return fmt.Errorf("got hook %t; want %t", *hook.Active, want.Active) } diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index f14c91554f..370ae7e6f4 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index bcf3fd1423..4cb7195001 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 32473a0b37..4a199b3891 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index e6d929be0b..df86acda0f 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index e0e24bf163..fae3f07b52 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 23ebb43fcf..f4080e0fcd 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index bbdbfb365a..9d830c6042 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index ea7b73ffca..000543ba26 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 055bd55186..6d54171864 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) @@ -76,10 +76,8 @@ func resourceGithubRepositoryWebhookObject(d *schema.ResourceData) *github.Hook for _, v := range eventSet.List() { events = append(events, v.(string)) } - name := d.Get("name").(string) hook := &github.Hook{ - Name: &name, URL: &url, Events: events, Active: &active, @@ -101,7 +99,7 @@ func resourceGithubRepositoryWebhookCreate(d *schema.ResourceData, meta interfac hk := resourceGithubRepositoryWebhookObject(d) ctx := context.Background() - log.Printf("[DEBUG] Creating repository webhook: %s (%s/%s)", hk.GetName(), orgName, repoName) + log.Printf("[DEBUG] Creating repository webhook: %d (%s/%s)", hk.GetID(), orgName, repoName) hook, _, err := client.Repositories.CreateHook(ctx, orgName, repoName, hk) if err != nil { return err @@ -141,7 +139,6 @@ func resourceGithubRepositoryWebhookRead(d *schema.ResourceData, meta interface{ } return err } - d.Set("name", hook.Name) d.Set("url", hook.URL) d.Set("active", hook.Active) d.Set("events", hook.Events) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index fec385b0fb..bc6ef8744b 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" @@ -167,9 +167,6 @@ type testAccGithubRepositoryWebhookExpectedAttributes struct { func testAccCheckGithubRepositoryWebhookAttributes(hook *github.Hook, want *testAccGithubRepositoryWebhookExpectedAttributes) resource.TestCheckFunc { return func(s *terraform.State) error { - if *hook.Name != want.Name { - return fmt.Errorf("got hook %q; want %q", *hook.Name, want.Name) - } if *hook.Active != want.Active { return fmt.Errorf("got hook %t; want %t", *hook.Active, want.Active) } diff --git a/github/resource_github_team.go b/github/resource_github_team.go index ccab22eea0..a8e17726ae 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 429aba464d..f15ae40999 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 614552c095..0d905a05d3 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index e3939fc122..bd2dbd37d7 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index 4ff89a21fa..80c418c410 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index c6f01b4cbb..1bed762ac8 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index a08ec8d538..c58def0849 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index 92b5eda7df..b6ef9f5d41 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index e15142ea1a..80635ac765 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index ff6a7bc0da..3b7e5588fd 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/transport.go b/github/transport.go index 9b16caf841..c5a9dfbb5e 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 4f81ee87e1..4ef18f0498 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index c84b29be61..ba6f6da7d6 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v19/github" ) const ( diff --git a/go.mod b/go.mod index 1d06cb143a..28f847db4c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v18 v18.2.0 + github.com/google/go-github/v19 v19.1.0 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 85b89f14f0..5ef10a8901 100644 --- a/go.sum +++ b/go.sum @@ -74,13 +74,8 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-github/v18 v18.0.0 h1:87etQr/RdxNeKgMN05p2JEfYKI4KzH47CbFvE7YpeoI= -github.com/google/go-github/v18 v18.0.0/go.mod h1:PVFtHjn6GZk2Z2E2siqOl01XmaQwtfnikCPCM+7WEVc= -github.com/google/go-github/v18 v18.1.0 h1:JxMC0jl4hfMLn3Z0xjm/tRUH2okpE8geAXLE7iH+hxw= -github.com/google/go-github/v18 v18.1.0/go.mod h1:PVFtHjn6GZk2Z2E2siqOl01XmaQwtfnikCPCM+7WEVc= -github.com/google/go-github/v18 v18.2.0 h1:s7Y4I8ZlIL1Ofxpj4AQRJcSGAr0Jl2AHThHgXpsUCfU= -github.com/google/go-github/v18 v18.2.0/go.mod h1:Bf4Ut1RTeH0WuX7Z4Zf7N+qp/YqgcFOxvTLuSO+aY/k= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-github/v19 v19.1.0 h1:EXbrEGEwc4zOSl/exLvlHW+y6hEbhI/En/w7lW2PaBI= +github.com/google/go-github/v19 v19.1.0/go.mod h1:GVHidlOJOqnOChZvI4HBBXoOaZ64OfJRoSoY6uo5BSI= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= @@ -264,18 +259,12 @@ github.com/zclconf/go-cty v0.0.0-20180302160414-49fa5e03c418/go.mod h1:LnDKxj8gN github.com/zclconf/go-cty v0.0.0-20180328152515-d006e4534bc4 h1:39jDtvQg1gEEbyXll7V0KcMgHuF92XC8HbyFzDJA6Uo= github.com/zclconf/go-cty v0.0.0-20180328152515-d006e4534bc4/go.mod h1:LnDKxj8gN4aatfXUqmUNooaDjvmDcLPbAN3hYBIVoJE= golang.org/x/crypto v0.0.0-20180211211603-9de5f2eaf759/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f h1:EDv9U2dOjZ9sVn985FJw58XWqRwhtTnd0RxCfIzqKI8= -golang.org/x/crypto v0.0.0-20180330210355-12892e8c234f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/net v0.0.0-20171004034648-a04bdaca5b32/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7 h1:vwPhSHmZ2xckGbhyz9c/u82CIp9iyzUDJHNXrRP0Xx8= -golang.org/x/net v0.0.0-20180509002218-f73e4c9ed3b7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/oauth2 v0.0.0-20170928010508-bb50c06baba3/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179 h1:i7nIATcLJZqBHx/NOl8hfnkelUjmcyEhCN1/oISBrUc= -golang.org/x/oauth2 v0.0.0-20180503012634-cdc340f7c179/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= @@ -291,8 +280,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb google.golang.org/api v0.0.0-20171005000305-7a7376eff6a5 h1:PDkJGYjSvxJyevtZRGmBSO+HjbIKuqYEEc8gB51or4o= google.golang.org/api v0.0.0-20171005000305-7a7376eff6a5/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.0.0 h1:dN4LljjBKVChsv0XCSI+zbyzdqrkEwX5LQFUMRSGqOc= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20171002232614-f676e0f3ac63/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/vendor/github.com/google/go-github/v18/AUTHORS b/vendor/github.com/google/go-github/v19/AUTHORS similarity index 94% rename from vendor/github.com/google/go-github/v18/AUTHORS rename to vendor/github.com/google/go-github/v19/AUTHORS index 862f2c8644..53c189eda6 100644 --- a/vendor/github.com/google/go-github/v18/AUTHORS +++ b/vendor/github.com/google/go-github/v19/AUTHORS @@ -13,6 +13,7 @@ Abhinav Gupta Ahmed Hagy Ainsley Chong Akeda Bagus +Akhil Mohan Alec Thomas Aleks Clark Alex Bramley @@ -21,9 +22,11 @@ Allen Sun Amey Sakhadeo Andreas Garnæs Andrew Ryabchun +Andy Grunwald Andy Hume Andy Lindeman Anshuman Bhartiya +Antoine Antoine Pelisse Anubha Kushwaha appilon @@ -55,6 +58,7 @@ Craig Peterson Cristian Maglie Daehyeok Mun Daniel Leavitt +Daniel Nilsson Dave Du Cros Dave Henderson David Deng @@ -84,6 +88,7 @@ George Kontridze Georgy Buranov Gnahz Google Inc. +Grachev Mikhail griffin_stewie Guillaume Jacquet Guz Alexander @@ -98,6 +103,7 @@ Isao Jonas isqua Jameel Haffejee Jan Kosecki +Javier Campanini Jeremy Morris Jesse Newland Jihoon Chung @@ -106,6 +112,7 @@ Joan Saum Joe Tsai John Barton John Engelman +JP Phillips jpbelanger-mtl Juan Basso Julien Garcia Gonzalez @@ -132,12 +139,14 @@ Marwan Sulaiman Mat Geist Matt Matt Brender +Matt Gaunt Matt Landis Maxime Bury Michael Spiegel Michael Tiller Michał Glapa Nathan VanBenschoten +Navaneeth Suresh Neil O'Toole Nick Miyake Nick Spragg @@ -180,11 +189,13 @@ Sebastian Mandrean Sebastian Mæland Pedersen Sevki Shagun Khemka +shakeelrao Shawn Catanzarite Shawn Smith sona-tar SoundCloud, Ltd. Stian Eikeland +Tasya Aditya Rukmana Thomas Bruyelle Timothée Peignier Trey Tacon @@ -195,6 +206,7 @@ Victor Vrantchan Vlad Ungureanu Will Maier William Bailey +xibz Yann Malet Yannick Utard Yicheng Qin diff --git a/vendor/github.com/google/go-github/v18/LICENSE b/vendor/github.com/google/go-github/v19/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v18/LICENSE rename to vendor/github.com/google/go-github/v19/LICENSE diff --git a/vendor/github.com/google/go-github/v18/github/activity.go b/vendor/github.com/google/go-github/v19/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/activity.go rename to vendor/github.com/google/go-github/v19/github/activity.go diff --git a/vendor/github.com/google/go-github/v18/github/activity_events.go b/vendor/github.com/google/go-github/v19/github/activity_events.go similarity index 99% rename from vendor/github.com/google/go-github/v18/github/activity_events.go rename to vendor/github.com/google/go-github/v19/github/activity_events.go index a919b11c5d..47f0c735bd 100644 --- a/vendor/github.com/google/go-github/v18/github/activity_events.go +++ b/vendor/github.com/google/go-github/v19/github/activity_events.go @@ -96,6 +96,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &ReleaseEvent{} case "RepositoryEvent": payload = &RepositoryEvent{} + case "RepositoryVulnerabilityAlertEvent": + payload = &RepositoryVulnerabilityAlertEvent{} case "StatusEvent": payload = &StatusEvent{} case "TeamEvent": diff --git a/vendor/github.com/google/go-github/v18/github/activity_notifications.go b/vendor/github.com/google/go-github/v19/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/activity_notifications.go rename to vendor/github.com/google/go-github/v19/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v18/github/activity_star.go b/vendor/github.com/google/go-github/v19/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/activity_star.go rename to vendor/github.com/google/go-github/v19/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v18/github/activity_watching.go b/vendor/github.com/google/go-github/v19/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/activity_watching.go rename to vendor/github.com/google/go-github/v19/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v18/github/admin.go b/vendor/github.com/google/go-github/v19/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/admin.go rename to vendor/github.com/google/go-github/v19/github/admin.go diff --git a/vendor/github.com/google/go-github/v18/github/admin_stats.go b/vendor/github.com/google/go-github/v19/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/admin_stats.go rename to vendor/github.com/google/go-github/v19/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v18/github/apps.go b/vendor/github.com/google/go-github/v19/github/apps.go similarity index 99% rename from vendor/github.com/google/go-github/v18/github/apps.go rename to vendor/github.com/google/go-github/v19/github/apps.go index 32d4f2f450..ae3aabda31 100644 --- a/vendor/github.com/google/go-github/v18/github/apps.go +++ b/vendor/github.com/google/go-github/v19/github/apps.go @@ -164,7 +164,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opt *ListOption // // GitHub API docs: https://developer.github.com/v3/apps/#create-a-new-installation-token func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64) (*InstallationToken, *Response, error) { - u := fmt.Sprintf("installations/%v/access_tokens", id) + u := fmt.Sprintf("app/installations/%v/access_tokens", id) req, err := s.client.NewRequest("POST", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v18/github/apps_installation.go b/vendor/github.com/google/go-github/v19/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/apps_installation.go rename to vendor/github.com/google/go-github/v19/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v18/github/apps_marketplace.go b/vendor/github.com/google/go-github/v19/github/apps_marketplace.go similarity index 68% rename from vendor/github.com/google/go-github/v18/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v19/github/apps_marketplace.go index 3f35b91557..6dd568a2dc 100644 --- a/vendor/github.com/google/go-github/v18/github/apps_marketplace.go +++ b/vendor/github.com/google/go-github/v19/github/apps_marketplace.go @@ -27,36 +27,52 @@ type MarketplaceService struct { // MarketplacePlan represents a GitHub Apps Marketplace Listing Plan. type MarketplacePlan struct { - URL *string `json:"url,omitempty"` - AccountsURL *string `json:"accounts_url,omitempty"` - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - MonthlyPriceInCents *int `json:"monthly_price_in_cents,omitempty"` - YearlyPriceInCents *int `json:"yearly_price_in_cents,omitempty"` - PriceModel *string `json:"price_model,omitempty"` - UnitName *string `json:"unit_name,omitempty"` - Bullets *[]string `json:"bullets,omitempty"` + URL *string `json:"url,omitempty"` + AccountsURL *string `json:"accounts_url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + MonthlyPriceInCents *int `json:"monthly_price_in_cents,omitempty"` + YearlyPriceInCents *int `json:"yearly_price_in_cents,omitempty"` + // The pricing model for this listing. Can be one of "flat-rate", "per-unit", or "free". + PriceModel *string `json:"price_model,omitempty"` + UnitName *string `json:"unit_name,omitempty"` + Bullets *[]string `json:"bullets,omitempty"` + // State can be one of the values "draft" or "published". + State *string `json:"state,omitempty"` + HasFreeTrial *bool `json:"has_free_trial,omitempty"` } // MarketplacePurchase represents a GitHub Apps Marketplace Purchase. type MarketplacePurchase struct { + // BillingCycle can be one of the values "yearly", "monthly" or nil. BillingCycle *string `json:"billing_cycle,omitempty"` - NextBillingDate *string `json:"next_billing_date,omitempty"` + NextBillingDate *Timestamp `json:"next_billing_date,omitempty"` UnitCount *int `json:"unit_count,omitempty"` Plan *MarketplacePlan `json:"plan,omitempty"` Account *MarketplacePlanAccount `json:"account,omitempty"` + OnFreeTrial *bool `json:"on_free_trial,omitempty"` + FreeTrialEndsOn *Timestamp `json:"free_trial_ends_on,omitempty"` +} + +// MarketplacePendingChange represents a pending change to a GitHub Apps Marketplace Plan. +type MarketplacePendingChange struct { + EffectiveDate *Timestamp `json:"effective_date,omitempty"` + UnitCount *int `json:"unit_count,omitempty"` + ID *int64 `json:"id,omitempty"` + Plan *MarketplacePlan `json:"plan,omitempty"` } // MarketplacePlanAccount represents a GitHub Account (user or organization) on a specific plan. type MarketplacePlanAccount struct { - URL *string `json:"url,omitempty"` - Type *string `json:"type,omitempty"` - ID *int64 `json:"id,omitempty"` - Login *string `json:"login,omitempty"` - Email *string `json:"email,omitempty"` - OrganizationBillingEmail *string `json:"organization_billing_email,omitempty"` - MarketplacePurchase *MarketplacePurchase `json:"marketplace_purchase,omitempty"` + URL *string `json:"url,omitempty"` + Type *string `json:"type,omitempty"` + ID *int64 `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + Email *string `json:"email,omitempty"` + OrganizationBillingEmail *string `json:"organization_billing_email,omitempty"` + MarketplacePurchase *MarketplacePurchase `json:"marketplace_purchase,omitempty"` + MarketplacePendingChange *MarketplacePendingChange `json:"marketplace_pending_change,omitempty"` } // ListPlans lists all plans for your Marketplace listing. @@ -155,7 +171,6 @@ func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context if err != nil { return nil, resp, err } - return purchases, resp, nil } diff --git a/vendor/github.com/google/go-github/v18/github/authorizations.go b/vendor/github.com/google/go-github/v19/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/authorizations.go rename to vendor/github.com/google/go-github/v19/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v18/github/checks.go b/vendor/github.com/google/go-github/v19/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/checks.go rename to vendor/github.com/google/go-github/v19/github/checks.go diff --git a/vendor/github.com/google/go-github/v18/github/doc.go b/vendor/github.com/google/go-github/v19/github/doc.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/doc.go rename to vendor/github.com/google/go-github/v19/github/doc.go diff --git a/vendor/github.com/google/go-github/v18/github/event_types.go b/vendor/github.com/google/go-github/v19/github/event_types.go similarity index 96% rename from vendor/github.com/google/go-github/v18/github/event_types.go rename to vendor/github.com/google/go-github/v19/github/event_types.go index 9f49b34f9b..d3f7d33202 100644 --- a/vendor/github.com/google/go-github/v18/github/event_types.go +++ b/vendor/github.com/google/go-github/v19/github/event_types.go @@ -308,7 +308,7 @@ type LabelEvent struct { // Github API docs: https://developer.github.com/v3/activity/events/types/#marketplacepurchaseevent type MarketplacePurchaseEvent struct { // Action is the action that was performed. Possible values are: - // "purchased", "cancelled", "changed". + // "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed". Action *string `json:"action,omitempty"` // The following fields are only populated by Webhook events. @@ -710,6 +710,27 @@ type RepositoryEvent struct { Installation *Installation `json:"installation,omitempty"` } +// RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. +// +// GitHub API docs: https://developer.github.com/v3/activity/events/types/#repositoryvulnerabilityalertevent +type RepositoryVulnerabilityAlertEvent struct { + // Action is the action that was performed. This can be: "create", "dismiss", "resolve". + Action *string `json:"action,omitempty"` + + //The security alert of the vulnerable dependency. + Alert *struct { + ID *int64 `json:"id,omitempty"` + AffectedRange *string `json:"affected_range,omitempty"` + AffectedPackageName *string `json:"affected_package_name,omitempty"` + ExternalReference *string `json:"external_reference,omitempty"` + ExternalIdentifier *string `json:"external_identifier,omitempty"` + FixedIn *string `json:"fixed_in,omitempty"` + Dismisser *User `json:"dismisser,omitempty"` + DismissReason *string `json:"dismiss_reason,omitempty"` + DismissedAt *Timestamp `json:"dismissed_at,omitempty"` + } `json:"alert,omitempty"` +} + // StatusEvent is triggered when the status of a Git commit changes. // The Webhook event name is "status". // diff --git a/vendor/github.com/google/go-github/v18/github/gen-accessors.go b/vendor/github.com/google/go-github/v19/github/gen-accessors.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/gen-accessors.go rename to vendor/github.com/google/go-github/v19/github/gen-accessors.go diff --git a/vendor/github.com/google/go-github/v18/github/gists.go b/vendor/github.com/google/go-github/v19/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/gists.go rename to vendor/github.com/google/go-github/v19/github/gists.go diff --git a/vendor/github.com/google/go-github/v18/github/gists_comments.go b/vendor/github.com/google/go-github/v19/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/gists_comments.go rename to vendor/github.com/google/go-github/v19/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v18/github/git.go b/vendor/github.com/google/go-github/v19/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/git.go rename to vendor/github.com/google/go-github/v19/github/git.go diff --git a/vendor/github.com/google/go-github/v18/github/git_blobs.go b/vendor/github.com/google/go-github/v19/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/git_blobs.go rename to vendor/github.com/google/go-github/v19/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v18/github/git_commits.go b/vendor/github.com/google/go-github/v19/github/git_commits.go similarity index 98% rename from vendor/github.com/google/go-github/v18/github/git_commits.go rename to vendor/github.com/google/go-github/v19/github/git_commits.go index 1eb48a8e2c..a2b17fcc30 100644 --- a/vendor/github.com/google/go-github/v18/github/git_commits.go +++ b/vendor/github.com/google/go-github/v19/github/git_commits.go @@ -58,7 +58,7 @@ func (c CommitAuthor) String() string { return Stringify(c) } -// GetCommit fetchs the Commit object for a given SHA. +// GetCommit fetches the Commit object for a given SHA. // // GitHub API docs: https://developer.github.com/v3/git/commits/#get-a-commit func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { diff --git a/vendor/github.com/google/go-github/v18/github/git_refs.go b/vendor/github.com/google/go-github/v19/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/git_refs.go rename to vendor/github.com/google/go-github/v19/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v18/github/git_tags.go b/vendor/github.com/google/go-github/v19/github/git_tags.go similarity index 98% rename from vendor/github.com/google/go-github/v18/github/git_tags.go rename to vendor/github.com/google/go-github/v19/github/git_tags.go index 90398b3806..f66e4028fe 100644 --- a/vendor/github.com/google/go-github/v18/github/git_tags.go +++ b/vendor/github.com/google/go-github/v19/github/git_tags.go @@ -33,7 +33,7 @@ type createTagRequest struct { Tagger *CommitAuthor `json:"tagger,omitempty"` } -// GetTag fetchs a tag from a repo given a SHA. +// GetTag fetches a tag from a repo given a SHA. // // GitHub API docs: https://developer.github.com/v3/git/tags/#get-a-tag func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { diff --git a/vendor/github.com/google/go-github/v18/github/git_trees.go b/vendor/github.com/google/go-github/v19/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/git_trees.go rename to vendor/github.com/google/go-github/v19/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v18/github/github-accessors.go b/vendor/github.com/google/go-github/v19/github/github-accessors.go similarity index 98% rename from vendor/github.com/google/go-github/v18/github/github-accessors.go rename to vendor/github.com/google/go-github/v19/github/github-accessors.go index 888273d7ef..776ef42ece 100644 --- a/vendor/github.com/google/go-github/v18/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v19/github/github-accessors.go @@ -1292,6 +1292,14 @@ func (c *CommitFile) GetPatch() string { return *c.Patch } +// GetPreviousFilename returns the PreviousFilename field if it's non-nil, zero value otherwise. +func (c *CommitFile) GetPreviousFilename() string { + if c == nil || c.PreviousFilename == nil { + return "" + } + return *c.PreviousFilename +} + // GetRawURL returns the RawURL field if it's non-nil, zero value otherwise. func (c *CommitFile) GetRawURL() string { if c == nil || c.RawURL == nil { @@ -2292,6 +2300,14 @@ func (d *DeploymentStatusRequest) GetDescription() string { return *d.Description } +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (d *DeploymentStatusRequest) GetEnvironment() string { + if d == nil || d.Environment == nil { + return "" + } + return *d.Environment +} + // GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise. func (d *DeploymentStatusRequest) GetEnvironmentURL() string { if d == nil || d.EnvironmentURL == nil { @@ -3140,14 +3156,6 @@ func (h *Hook) GetID() int64 { return *h.ID } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (h *Hook) GetName() string { - if h == nil || h.Name == nil { - return "" - } - return *h.Name -} - // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (h *Hook) GetUpdatedAt() time.Time { if h == nil || h.UpdatedAt == nil { @@ -4644,6 +4652,38 @@ func (l *ListCheckSuiteResults) GetTotal() int { return *l.Total } +// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. +func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { + if m == nil || m.EffectiveDate == nil { + return Timestamp{} + } + return *m.EffectiveDate +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (m *MarketplacePendingChange) GetID() int64 { + if m == nil || m.ID == nil { + return 0 + } + return *m.ID +} + +// GetPlan returns the Plan field. +func (m *MarketplacePendingChange) GetPlan() *MarketplacePlan { + if m == nil { + return nil + } + return m.Plan +} + +// GetUnitCount returns the UnitCount field if it's non-nil, zero value otherwise. +func (m *MarketplacePendingChange) GetUnitCount() int { + if m == nil || m.UnitCount == nil { + return 0 + } + return *m.UnitCount +} + // GetAccountsURL returns the AccountsURL field if it's non-nil, zero value otherwise. func (m *MarketplacePlan) GetAccountsURL() string { if m == nil || m.AccountsURL == nil { @@ -4668,6 +4708,14 @@ func (m *MarketplacePlan) GetDescription() string { return *m.Description } +// GetHasFreeTrial returns the HasFreeTrial field if it's non-nil, zero value otherwise. +func (m *MarketplacePlan) GetHasFreeTrial() bool { + if m == nil || m.HasFreeTrial == nil { + return false + } + return *m.HasFreeTrial +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (m *MarketplacePlan) GetID() int64 { if m == nil || m.ID == nil { @@ -4700,6 +4748,14 @@ func (m *MarketplacePlan) GetPriceModel() string { return *m.PriceModel } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (m *MarketplacePlan) GetState() string { + if m == nil || m.State == nil { + return "" + } + return *m.State +} + // GetUnitName returns the UnitName field if it's non-nil, zero value otherwise. func (m *MarketplacePlan) GetUnitName() string { if m == nil || m.UnitName == nil { @@ -4748,6 +4804,14 @@ func (m *MarketplacePlanAccount) GetLogin() string { return *m.Login } +// GetMarketplacePendingChange returns the MarketplacePendingChange field. +func (m *MarketplacePlanAccount) GetMarketplacePendingChange() *MarketplacePendingChange { + if m == nil { + return nil + } + return m.MarketplacePendingChange +} + // GetMarketplacePurchase returns the MarketplacePurchase field. func (m *MarketplacePlanAccount) GetMarketplacePurchase() *MarketplacePurchase { if m == nil { @@ -4796,14 +4860,30 @@ func (m *MarketplacePurchase) GetBillingCycle() string { return *m.BillingCycle } +// GetFreeTrialEndsOn returns the FreeTrialEndsOn field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchase) GetFreeTrialEndsOn() Timestamp { + if m == nil || m.FreeTrialEndsOn == nil { + return Timestamp{} + } + return *m.FreeTrialEndsOn +} + // GetNextBillingDate returns the NextBillingDate field if it's non-nil, zero value otherwise. -func (m *MarketplacePurchase) GetNextBillingDate() string { +func (m *MarketplacePurchase) GetNextBillingDate() Timestamp { if m == nil || m.NextBillingDate == nil { - return "" + return Timestamp{} } return *m.NextBillingDate } +// GetOnFreeTrial returns the OnFreeTrial field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchase) GetOnFreeTrial() bool { + if m == nil || m.OnFreeTrial == nil { + return false + } + return *m.OnFreeTrial +} + // GetPlan returns the Plan field. func (m *MarketplacePurchase) GetPlan() *MarketplacePlan { if m == nil { @@ -5556,6 +5636,22 @@ func (o *Organization) GetCreatedAt() time.Time { return *o.CreatedAt } +// GetDefaultRepoPermission returns the DefaultRepoPermission field if it's non-nil, zero value otherwise. +func (o *Organization) GetDefaultRepoPermission() string { + if o == nil || o.DefaultRepoPermission == nil { + return "" + } + return *o.DefaultRepoPermission +} + +// GetDefaultRepoSettings returns the DefaultRepoSettings field if it's non-nil, zero value otherwise. +func (o *Organization) GetDefaultRepoSettings() string { + if o == nil || o.DefaultRepoSettings == nil { + return "" + } + return *o.DefaultRepoSettings +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (o *Organization) GetDescription() string { if o == nil || o.Description == nil { @@ -5652,6 +5748,14 @@ func (o *Organization) GetLogin() string { return *o.Login } +// GetMembersCanCreateRepos returns the MembersCanCreateRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanCreateRepos() bool { + if o == nil || o.MembersCanCreateRepos == nil { + return false + } + return *o.MembersCanCreateRepos +} + // GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise. func (o *Organization) GetMembersURL() string { if o == nil || o.MembersURL == nil { @@ -9940,6 +10044,14 @@ func (r *RepositoryTag) GetZipballURL() string { return *r.ZipballURL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlertEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + // GetForkRepos returns the ForkRepos field if it's non-nil, zero value otherwise. func (r *RepoStats) GetForkRepos() int { if r == nil || r.ForkRepos == nil { @@ -10076,6 +10188,22 @@ func (s *ServiceHook) GetName() string { return *s.Name } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (s *SignaturesProtectedBranch) GetEnabled() bool { + if s == nil || s.Enabled == nil { + return false + } + return *s.Enabled +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SignaturesProtectedBranch) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + // GetPayload returns the Payload field if it's non-nil, zero value otherwise. func (s *SignatureVerification) GetPayload() string { if s == nil || s.Payload == nil { @@ -11540,6 +11668,14 @@ func (u *User) GetTotalPrivateRepos() int { return *u.TotalPrivateRepos } +// GetTwoFactorAuthentication returns the TwoFactorAuthentication field if it's non-nil, zero value otherwise. +func (u *User) GetTwoFactorAuthentication() bool { + if u == nil || u.TwoFactorAuthentication == nil { + return false + } + return *u.TwoFactorAuthentication +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (u *User) GetType() string { if u == nil || u.Type == nil { diff --git a/vendor/github.com/google/go-github/v18/github/github.go b/vendor/github.com/google/go-github/v19/github/github.go similarity index 97% rename from vendor/github.com/google/go-github/v18/github/github.go rename to vendor/github.com/google/go-github/v19/github/github.go index af1f1b23eb..c58d7f9b3f 100644 --- a/vendor/github.com/google/go-github/v18/github/github.go +++ b/vendor/github.com/google/go-github/v19/github/github.go @@ -54,6 +54,9 @@ const ( // https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/ mediaTypeDeploymentStatusPreview = "application/vnd.github.ant-man-preview+json" + // https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/ + mediaTypeExpandDeploymentStatusPreview = "application/vnd.github.flash-preview+json" + // https://developer.github.com/changes/2016-02-19-source-import-preview-api/ mediaTypeImportPreview = "application/vnd.github.barred-rock-preview" @@ -122,6 +125,9 @@ const ( // https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/ mediaTypePreReceiveHooksPreview = "application/vnd.github.eye-scream-preview" + + // https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/ + mediaTypeSignaturePreview = "application/vnd.github.zzzax-preview+json" ) // A Client manages communication with the GitHub API. @@ -502,13 +508,23 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Res err = CheckResponse(resp) if err != nil { - // Even though there was an error, we still return the response - // in case the caller wants to inspect it further. - // However, if the error is AcceptedError, decode it below before - // returning from this function and closing the response body. - if _, ok := err.(*AcceptedError); !ok { - return response, err + // Special case for AcceptedErrors. If an AcceptedError + // has been encountered, the response's payload will be + // added to the AcceptedError and returned. + // + // Issue #1022 + aerr, ok := err.(*AcceptedError) + if ok { + b, readErr := ioutil.ReadAll(resp.Body) + if readErr != nil { + return response, readErr + } + + aerr.Raw = b + return response, aerr } + + return response, err } if v != nil { @@ -610,7 +626,10 @@ func (r *RateLimitError) Error() string { // Technically, 202 Accepted is not a real error, it's just used to // indicate that results are not ready yet, but should be available soon. // The request can be repeated after some time. -type AcceptedError struct{} +type AcceptedError struct { + // Raw contains the response body. + Raw []byte +} func (*AcceptedError) Error() string { return "job scheduled on GitHub side; try again later" diff --git a/vendor/github.com/google/go-github/v18/github/gitignore.go b/vendor/github.com/google/go-github/v19/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/gitignore.go rename to vendor/github.com/google/go-github/v19/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v18/github/issues.go b/vendor/github.com/google/go-github/v19/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues.go rename to vendor/github.com/google/go-github/v19/github/issues.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_assignees.go b/vendor/github.com/google/go-github/v19/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_assignees.go rename to vendor/github.com/google/go-github/v19/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_comments.go b/vendor/github.com/google/go-github/v19/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_comments.go rename to vendor/github.com/google/go-github/v19/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_events.go b/vendor/github.com/google/go-github/v19/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_events.go rename to vendor/github.com/google/go-github/v19/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_labels.go b/vendor/github.com/google/go-github/v19/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_labels.go rename to vendor/github.com/google/go-github/v19/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_milestones.go b/vendor/github.com/google/go-github/v19/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_milestones.go rename to vendor/github.com/google/go-github/v19/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v18/github/issues_timeline.go b/vendor/github.com/google/go-github/v19/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/issues_timeline.go rename to vendor/github.com/google/go-github/v19/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v18/github/licenses.go b/vendor/github.com/google/go-github/v19/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/licenses.go rename to vendor/github.com/google/go-github/v19/github/licenses.go diff --git a/vendor/github.com/google/go-github/v18/github/messages.go b/vendor/github.com/google/go-github/v19/github/messages.go similarity index 76% rename from vendor/github.com/google/go-github/v18/github/messages.go rename to vendor/github.com/google/go-github/v19/github/messages.go index 519c1c03db..75bc770512 100644 --- a/vendor/github.com/google/go-github/v18/github/messages.go +++ b/vendor/github.com/google/go-github/v19/github/messages.go @@ -41,42 +41,43 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. eventTypeMapping = map[string]string{ - "check_run": "CheckRunEvent", - "check_suite": "CheckSuiteEvent", - "commit_comment": "CommitCommentEvent", - "create": "CreateEvent", - "delete": "DeleteEvent", - "deployment": "DeploymentEvent", - "deployment_status": "DeploymentStatusEvent", - "fork": "ForkEvent", - "gollum": "GollumEvent", - "installation": "InstallationEvent", - "installation_repositories": "InstallationRepositoriesEvent", - "issue_comment": "IssueCommentEvent", - "issues": "IssuesEvent", - "label": "LabelEvent", - "marketplace_purchase": "MarketplacePurchaseEvent", - "member": "MemberEvent", - "membership": "MembershipEvent", - "milestone": "MilestoneEvent", - "organization": "OrganizationEvent", - "org_block": "OrgBlockEvent", - "page_build": "PageBuildEvent", - "ping": "PingEvent", - "project": "ProjectEvent", - "project_card": "ProjectCardEvent", - "project_column": "ProjectColumnEvent", - "public": "PublicEvent", - "pull_request_review": "PullRequestReviewEvent", - "pull_request_review_comment": "PullRequestReviewCommentEvent", - "pull_request": "PullRequestEvent", - "push": "PushEvent", - "repository": "RepositoryEvent", - "release": "ReleaseEvent", - "status": "StatusEvent", - "team": "TeamEvent", - "team_add": "TeamAddEvent", - "watch": "WatchEvent", + "check_run": "CheckRunEvent", + "check_suite": "CheckSuiteEvent", + "commit_comment": "CommitCommentEvent", + "create": "CreateEvent", + "delete": "DeleteEvent", + "deployment": "DeploymentEvent", + "deployment_status": "DeploymentStatusEvent", + "fork": "ForkEvent", + "gollum": "GollumEvent", + "installation": "InstallationEvent", + "installation_repositories": "InstallationRepositoriesEvent", + "issue_comment": "IssueCommentEvent", + "issues": "IssuesEvent", + "label": "LabelEvent", + "marketplace_purchase": "MarketplacePurchaseEvent", + "member": "MemberEvent", + "membership": "MembershipEvent", + "milestone": "MilestoneEvent", + "organization": "OrganizationEvent", + "org_block": "OrgBlockEvent", + "page_build": "PageBuildEvent", + "ping": "PingEvent", + "project": "ProjectEvent", + "project_card": "ProjectCardEvent", + "project_column": "ProjectColumnEvent", + "public": "PublicEvent", + "pull_request_review": "PullRequestReviewEvent", + "pull_request_review_comment": "PullRequestReviewCommentEvent", + "pull_request": "PullRequestEvent", + "push": "PushEvent", + "repository": "RepositoryEvent", + "repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent", + "release": "ReleaseEvent", + "status": "StatusEvent", + "team": "TeamEvent", + "team_add": "TeamAddEvent", + "watch": "WatchEvent", } ) diff --git a/vendor/github.com/google/go-github/v18/github/migrations.go b/vendor/github.com/google/go-github/v19/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/migrations.go rename to vendor/github.com/google/go-github/v19/github/migrations.go diff --git a/vendor/github.com/google/go-github/v18/github/migrations_source_import.go b/vendor/github.com/google/go-github/v19/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v19/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v18/github/migrations_user.go b/vendor/github.com/google/go-github/v19/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/migrations_user.go rename to vendor/github.com/google/go-github/v19/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v18/github/misc.go b/vendor/github.com/google/go-github/v19/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/misc.go rename to vendor/github.com/google/go-github/v19/github/misc.go diff --git a/vendor/github.com/google/go-github/v18/github/orgs.go b/vendor/github.com/google/go-github/v19/github/orgs.go similarity index 91% rename from vendor/github.com/google/go-github/v18/github/orgs.go rename to vendor/github.com/google/go-github/v19/github/orgs.go index 3be91a3eed..c70039ba08 100644 --- a/vendor/github.com/google/go-github/v18/github/orgs.go +++ b/vendor/github.com/google/go-github/v19/github/orgs.go @@ -46,6 +46,16 @@ type Organization struct { Plan *Plan `json:"plan,omitempty"` TwoFactorRequirementEnabled *bool `json:"two_factor_requirement_enabled,omitempty"` + // DefaultRepoPermission can be one of: "read", "write", "admin", or "none". (Default: "read"). + // It is only used in OrganizationsService.Edit. + DefaultRepoPermission *string `json:"default_repository_permission,omitempty"` + // DefaultRepoSettings can be one of: "read", "write", "admin", or "none". (Default: "read"). + // It is only used in OrganizationsService.Get. + DefaultRepoSettings *string `json:"default_repository_settings,omitempty"` + + // MembersCanCreateRepos default value is true and is only used in Organizations.Edit. + MembersCanCreateRepos *bool `json:"members_can_create_repositories,omitempty"` + // API URLs URL *string `json:"url,omitempty"` EventsURL *string `json:"events_url,omitempty"` diff --git a/vendor/github.com/google/go-github/v18/github/orgs_hooks.go b/vendor/github.com/google/go-github/v19/github/orgs_hooks.go similarity index 98% rename from vendor/github.com/google/go-github/v18/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v19/github/orgs_hooks.go index c4dc134c4e..b710ea4023 100644 --- a/vendor/github.com/google/go-github/v18/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/v19/github/orgs_hooks.go @@ -49,7 +49,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 } // CreateHook creates a Hook for the specified org. -// Name and Config are required fields. +// Config is a required field. // // Note that only a subset of the hook fields are used and hook must // not be nil. @@ -59,7 +59,6 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook u := fmt.Sprintf("orgs/%v/hooks", org) hookReq := &createHookRequest{ - Name: hook.Name, Events: hook.Events, Active: hook.Active, Config: hook.Config, diff --git a/vendor/github.com/google/go-github/v18/github/orgs_members.go b/vendor/github.com/google/go-github/v19/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/orgs_members.go rename to vendor/github.com/google/go-github/v19/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v18/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v19/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v19/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v18/github/orgs_projects.go b/vendor/github.com/google/go-github/v19/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/orgs_projects.go rename to vendor/github.com/google/go-github/v19/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v18/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v19/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v19/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v18/github/projects.go b/vendor/github.com/google/go-github/v19/github/projects.go similarity index 99% rename from vendor/github.com/google/go-github/v18/github/projects.go rename to vendor/github.com/google/go-github/v19/github/projects.go index 76ef1e0a3b..210e3b5c3b 100644 --- a/vendor/github.com/google/go-github/v18/github/projects.go +++ b/vendor/github.com/google/go-github/v19/github/projects.go @@ -366,7 +366,7 @@ type ProjectCardOptions struct { // The ID (not Number) of the Issue to associate with this card. // Note and ContentID are mutually exclusive. ContentID int64 `json:"content_id,omitempty"` - // The type of content to associate with this card. Possible values are: "Issue". + // The type of content to associate with this card. Possible values are: "Issue" and "PullRequest". ContentType string `json:"content_type,omitempty"` // Use true to archive a project card. // Specify false if you need to restore a previously archived project card. diff --git a/vendor/github.com/google/go-github/v18/github/pulls.go b/vendor/github.com/google/go-github/v19/github/pulls.go similarity index 98% rename from vendor/github.com/google/go-github/v18/github/pulls.go rename to vendor/github.com/google/go-github/v19/github/pulls.go index 32655651e3..6026114211 100644 --- a/vendor/github.com/google/go-github/v18/github/pulls.go +++ b/vendor/github.com/google/go-github/v19/github/pulls.go @@ -60,6 +60,10 @@ type PullRequest struct { NodeID *string `json:"node_id,omitempty"` RequestedReviewers []*User `json:"requested_reviewers,omitempty"` + // RequestedTeams is populated as part of the PullRequestEvent. + // See, https://developer.github.com/v3/activity/events/types/#pullrequestevent for an example. + RequestedTeams []*Team `json:"requested_teams,omitempty"` + Links *PRLinks `json:"_links,omitempty"` Head *PullRequestBranch `json:"head,omitempty"` Base *PullRequestBranch `json:"base,omitempty"` @@ -103,7 +107,7 @@ type PullRequestBranch struct { // PullRequestsService.List method. type PullRequestListOptions struct { // State filters pull requests based on their state. Possible values are: - // open, closed. Default is "open". + // open, closed, all. Default is "open". State string `url:"state,omitempty"` // Head filters pull requests by head user and branch name in the format of: diff --git a/vendor/github.com/google/go-github/v18/github/pulls_comments.go b/vendor/github.com/google/go-github/v19/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/pulls_comments.go rename to vendor/github.com/google/go-github/v19/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v18/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v19/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v19/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v18/github/pulls_reviews.go b/vendor/github.com/google/go-github/v19/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v19/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v18/github/reactions.go b/vendor/github.com/google/go-github/v19/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/reactions.go rename to vendor/github.com/google/go-github/v19/github/reactions.go diff --git a/vendor/github.com/google/go-github/v18/github/repos.go b/vendor/github.com/google/go-github/v19/github/repos.go similarity index 94% rename from vendor/github.com/google/go-github/v18/github/repos.go rename to vendor/github.com/google/go-github/v19/github/repos.go index e783ccbea0..d09b5cc87e 100644 --- a/vendor/github.com/google/go-github/v18/github/repos.go +++ b/vendor/github.com/google/go-github/v19/github/repos.go @@ -698,6 +698,13 @@ type DismissalRestrictionsRequest struct { Teams *[]string `json:"teams,omitempty"` } +// SignaturesProtectedBranch represents the protection status of an individual branch. +type SignaturesProtectedBranch struct { + URL *string `json:"url,omitempty"` + // Commits pushed to matching branches must have verified signatures. + Enabled *bool `json:"enabled,omitempty"` +} + // ListBranches lists branches for the specified repository. // // GitHub API docs: https://developer.github.com/v3/repos/#list-branches @@ -850,6 +857,67 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, return s.client.Do(ctx, req, nil) } +// GetSignaturesProtectedBranch gets required signatures of protected branch. +// +// GitHub API docs: https://developer.github.com/v3/repos/branches/#get-required-signatures-of-protected-branch +func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches + req.Header.Set("Accept", mediaTypeSignaturePreview) + + p := new(SignaturesProtectedBranch) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} + +// RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch. +// It requires admin access and branch protection to be enabled. +// +// GitHub API docs: https://developer.github.com/v3/repos/branches/#add-required-signatures-of-protected-branch +func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches + req.Header.Set("Accept", mediaTypeSignaturePreview) + + r := new(SignaturesProtectedBranch) + resp, err := s.client.Do(ctx, req, r) + if err != nil { + return nil, resp, err + } + + return r, resp, err +} + +// OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch. +// +// GitHub API docs: https://developer.github.com/v3/repos/branches/#remove-required-signatures-of-protected-branch +func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches + req.Header.Set("Accept", mediaTypeSignaturePreview) + + return s.client.Do(ctx, req, nil) +} + // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // // GitHub API docs: https://developer.github.com/v3/repos/branches/#update-required-status-checks-of-protected-branch diff --git a/vendor/github.com/google/go-github/v18/github/repos_collaborators.go b/vendor/github.com/google/go-github/v19/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v19/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_comments.go b/vendor/github.com/google/go-github/v19/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_comments.go rename to vendor/github.com/google/go-github/v19/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_commits.go b/vendor/github.com/google/go-github/v19/github/repos_commits.go similarity index 92% rename from vendor/github.com/google/go-github/v18/github/repos_commits.go rename to vendor/github.com/google/go-github/v19/github/repos_commits.go index 04faa3ea9c..1acfa5ad1b 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v19/github/repos_commits.go @@ -48,16 +48,17 @@ func (c CommitStats) String() string { // CommitFile represents a file modified in a commit. type CommitFile struct { - SHA *string `json:"sha,omitempty"` - Filename *string `json:"filename,omitempty"` - Additions *int `json:"additions,omitempty"` - Deletions *int `json:"deletions,omitempty"` - Changes *int `json:"changes,omitempty"` - Status *string `json:"status,omitempty"` - Patch *string `json:"patch,omitempty"` - BlobURL *string `json:"blob_url,omitempty"` - RawURL *string `json:"raw_url,omitempty"` - ContentsURL *string `json:"contents_url,omitempty"` + SHA *string `json:"sha,omitempty"` + Filename *string `json:"filename,omitempty"` + Additions *int `json:"additions,omitempty"` + Deletions *int `json:"deletions,omitempty"` + Changes *int `json:"changes,omitempty"` + Status *string `json:"status,omitempty"` + Patch *string `json:"patch,omitempty"` + BlobURL *string `json:"blob_url,omitempty"` + RawURL *string `json:"raw_url,omitempty"` + ContentsURL *string `json:"contents_url,omitempty"` + PreviousFilename *string `json:"previous_filename,omitempty"` } func (c CommitFile) String() string { diff --git a/vendor/github.com/google/go-github/v18/github/repos_community_health.go b/vendor/github.com/google/go-github/v19/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_community_health.go rename to vendor/github.com/google/go-github/v19/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_contents.go b/vendor/github.com/google/go-github/v19/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_contents.go rename to vendor/github.com/google/go-github/v19/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_deployments.go b/vendor/github.com/google/go-github/v19/github/repos_deployments.go similarity index 93% rename from vendor/github.com/google/go-github/v18/github/repos_deployments.go rename to vendor/github.com/google/go-github/v19/github/repos_deployments.go index 794c3232ed..604632e91b 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v19/github/repos_deployments.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "strings" ) // Deployment represents a deployment in a repo @@ -116,7 +117,8 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo } // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) + acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) d := new(Deployment) resp, err := s.client.Do(ctx, req, d) @@ -149,6 +151,7 @@ type DeploymentStatusRequest struct { State *string `json:"state,omitempty"` LogURL *string `json:"log_url,omitempty"` Description *string `json:"description,omitempty"` + Environment *string `json:"environment,omitempty"` EnvironmentURL *string `json:"environment_url,omitempty"` AutoInactive *bool `json:"auto_inactive,omitempty"` } @@ -189,7 +192,8 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re } // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) + acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) d := new(DeploymentStatus) resp, err := s.client.Do(ctx, req, d) @@ -212,7 +216,8 @@ func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, } // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) + acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) d := new(DeploymentStatus) resp, err := s.client.Do(ctx, req, d) diff --git a/vendor/github.com/google/go-github/v18/github/repos_forks.go b/vendor/github.com/google/go-github/v19/github/repos_forks.go similarity index 91% rename from vendor/github.com/google/go-github/v18/github/repos_forks.go rename to vendor/github.com/google/go-github/v19/github/repos_forks.go index d0bff54470..bfff27bb95 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_forks.go +++ b/vendor/github.com/google/go-github/v19/github/repos_forks.go @@ -8,6 +8,8 @@ package github import ( "context" "fmt" + + "encoding/json" ) // RepositoryListForksOptions specifies the optional parameters to the @@ -78,10 +80,15 @@ func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string fork := new(Repository) resp, err := s.client.Do(ctx, req, fork) - if _, ok := err.(*AcceptedError); ok { - return fork, resp, err - } if err != nil { + // Persist AcceptedError's metadata to the Repository object. + if aerr, ok := err.(*AcceptedError); ok { + if err := json.Unmarshal(aerr.Raw, fork); err != nil { + return fork, resp, err + } + + return fork, resp, err + } return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v18/github/repos_hooks.go b/vendor/github.com/google/go-github/v19/github/repos_hooks.go similarity index 96% rename from vendor/github.com/google/go-github/v18/github/repos_hooks.go rename to vendor/github.com/google/go-github/v19/github/repos_hooks.go index 564f5e576f..56374b3ec1 100644 --- a/vendor/github.com/google/go-github/v18/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v19/github/repos_hooks.go @@ -75,8 +75,7 @@ type Hook struct { ID *int64 `json:"id,omitempty"` // Only the following fields are used when creating a hook. - // Name and Config are required. - Name *string `json:"name,omitempty"` + // Config is required. Config map[string]interface{} `json:"config,omitempty"` Events []string `json:"events,omitempty"` Active *bool `json:"active,omitempty"` @@ -92,16 +91,14 @@ func (h Hook) String() string { // See https://github.com/google/go-github/issues/1015 for more // information. type createHookRequest struct { - // Name and Config are required. - // Name must be passed as "web". - Name *string `json:"name,omitempty"` + // Config is required. Config map[string]interface{} `json:"config,omitempty"` Events []string `json:"events,omitempty"` Active *bool `json:"active,omitempty"` } // CreateHook creates a Hook for the specified repository. -// Name and Config are required fields. +// Config is a required field. // // Note that only a subset of the hook fields are used and hook must // not be nil. @@ -111,7 +108,6 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) hookReq := &createHookRequest{ - Name: hook.Name, Events: hook.Events, Active: hook.Active, Config: hook.Config, diff --git a/vendor/github.com/google/go-github/v18/github/repos_invitations.go b/vendor/github.com/google/go-github/v19/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_invitations.go rename to vendor/github.com/google/go-github/v19/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_keys.go b/vendor/github.com/google/go-github/v19/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_keys.go rename to vendor/github.com/google/go-github/v19/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_merging.go b/vendor/github.com/google/go-github/v19/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_merging.go rename to vendor/github.com/google/go-github/v19/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_pages.go b/vendor/github.com/google/go-github/v19/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_pages.go rename to vendor/github.com/google/go-github/v19/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v19/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v19/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_projects.go b/vendor/github.com/google/go-github/v19/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_projects.go rename to vendor/github.com/google/go-github/v19/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_releases.go b/vendor/github.com/google/go-github/v19/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_releases.go rename to vendor/github.com/google/go-github/v19/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_stats.go b/vendor/github.com/google/go-github/v19/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_stats.go rename to vendor/github.com/google/go-github/v19/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_statuses.go b/vendor/github.com/google/go-github/v19/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_statuses.go rename to vendor/github.com/google/go-github/v19/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v18/github/repos_traffic.go b/vendor/github.com/google/go-github/v19/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/repos_traffic.go rename to vendor/github.com/google/go-github/v19/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v18/github/search.go b/vendor/github.com/google/go-github/v19/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/search.go rename to vendor/github.com/google/go-github/v19/github/search.go diff --git a/vendor/github.com/google/go-github/v18/github/strings.go b/vendor/github.com/google/go-github/v19/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/strings.go rename to vendor/github.com/google/go-github/v19/github/strings.go diff --git a/vendor/github.com/google/go-github/v18/github/teams.go b/vendor/github.com/google/go-github/v19/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/teams.go rename to vendor/github.com/google/go-github/v19/github/teams.go diff --git a/vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v19/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v19/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v18/github/teams_discussions.go b/vendor/github.com/google/go-github/v19/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/teams_discussions.go rename to vendor/github.com/google/go-github/v19/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v18/github/teams_members.go b/vendor/github.com/google/go-github/v19/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/teams_members.go rename to vendor/github.com/google/go-github/v19/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v18/github/timestamp.go b/vendor/github.com/google/go-github/v19/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/timestamp.go rename to vendor/github.com/google/go-github/v19/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v18/github/users.go b/vendor/github.com/google/go-github/v19/github/users.go similarity index 79% rename from vendor/github.com/google/go-github/v18/github/users.go rename to vendor/github.com/google/go-github/v19/github/users.go index f164d559ed..a4f74904c3 100644 --- a/vendor/github.com/google/go-github/v18/github/users.go +++ b/vendor/github.com/google/go-github/v19/github/users.go @@ -18,34 +18,35 @@ type UsersService service // User represents a GitHub user. type User struct { - Login *string `json:"login,omitempty"` - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - AvatarURL *string `json:"avatar_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - GravatarID *string `json:"gravatar_id,omitempty"` - Name *string `json:"name,omitempty"` - Company *string `json:"company,omitempty"` - Blog *string `json:"blog,omitempty"` - Location *string `json:"location,omitempty"` - Email *string `json:"email,omitempty"` - Hireable *bool `json:"hireable,omitempty"` - Bio *string `json:"bio,omitempty"` - PublicRepos *int `json:"public_repos,omitempty"` - PublicGists *int `json:"public_gists,omitempty"` - Followers *int `json:"followers,omitempty"` - Following *int `json:"following,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - SuspendedAt *Timestamp `json:"suspended_at,omitempty"` - Type *string `json:"type,omitempty"` - SiteAdmin *bool `json:"site_admin,omitempty"` - TotalPrivateRepos *int `json:"total_private_repos,omitempty"` - OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` - PrivateGists *int `json:"private_gists,omitempty"` - DiskUsage *int `json:"disk_usage,omitempty"` - Collaborators *int `json:"collaborators,omitempty"` - Plan *Plan `json:"plan,omitempty"` + Login *string `json:"login,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + AvatarURL *string `json:"avatar_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + GravatarID *string `json:"gravatar_id,omitempty"` + Name *string `json:"name,omitempty"` + Company *string `json:"company,omitempty"` + Blog *string `json:"blog,omitempty"` + Location *string `json:"location,omitempty"` + Email *string `json:"email,omitempty"` + Hireable *bool `json:"hireable,omitempty"` + Bio *string `json:"bio,omitempty"` + PublicRepos *int `json:"public_repos,omitempty"` + PublicGists *int `json:"public_gists,omitempty"` + Followers *int `json:"followers,omitempty"` + Following *int `json:"following,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + SuspendedAt *Timestamp `json:"suspended_at,omitempty"` + Type *string `json:"type,omitempty"` + SiteAdmin *bool `json:"site_admin,omitempty"` + TotalPrivateRepos *int `json:"total_private_repos,omitempty"` + OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` + PrivateGists *int `json:"private_gists,omitempty"` + DiskUsage *int `json:"disk_usage,omitempty"` + Collaborators *int `json:"collaborators,omitempty"` + TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"` + Plan *Plan `json:"plan,omitempty"` // API URLs URL *string `json:"url,omitempty"` @@ -76,6 +77,7 @@ func (u User) String() string { // user. // // GitHub API docs: https://developer.github.com/v3/users/#get-a-single-user +// and: https://developer.github.com/v3/users/#get-the-authenticated-user func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { diff --git a/vendor/github.com/google/go-github/v18/github/users_administration.go b/vendor/github.com/google/go-github/v19/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_administration.go rename to vendor/github.com/google/go-github/v19/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v18/github/users_blocking.go b/vendor/github.com/google/go-github/v19/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_blocking.go rename to vendor/github.com/google/go-github/v19/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v18/github/users_emails.go b/vendor/github.com/google/go-github/v19/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_emails.go rename to vendor/github.com/google/go-github/v19/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v18/github/users_followers.go b/vendor/github.com/google/go-github/v19/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_followers.go rename to vendor/github.com/google/go-github/v19/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v18/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v19/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v19/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v18/github/users_keys.go b/vendor/github.com/google/go-github/v19/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/users_keys.go rename to vendor/github.com/google/go-github/v19/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v18/github/with_appengine.go b/vendor/github.com/google/go-github/v19/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/with_appengine.go rename to vendor/github.com/google/go-github/v19/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v18/github/without_appengine.go b/vendor/github.com/google/go-github/v19/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v18/github/without_appengine.go rename to vendor/github.com/google/go-github/v19/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 869085287a..be0ef37217 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,8 +54,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v18 v18.2.0 -github.com/google/go-github/v18/github +# github.com/google/go-github/v19 v19.1.0 +github.com/google/go-github/v19/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce From f385348b8d4c089d6fe364f1afcb2f6f962d911f Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:49:38 +0000 Subject: [PATCH 6/9] vendor: github.com/google/go-github/github@v20.0.0 Signed-off-by: Trevor Bramwell --- github/config.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- ...source_github_organization_webhook_test.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 2 +- ...resource_github_repository_webhook_test.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 6 +- .../google/go-github/{v19 => v20}/AUTHORS | 2 + .../google/go-github/{v19 => v20}/LICENSE | 0 .../go-github/{v19 => v20}/github/activity.go | 0 .../{v19 => v20}/github/activity_events.go | 115 ---------------- .../github/activity_notifications.go | 0 .../{v19 => v20}/github/activity_star.go | 0 .../{v19 => v20}/github/activity_watching.go | 0 .../go-github/{v19 => v20}/github/admin.go | 0 .../{v19 => v20}/github/admin_stats.go | 0 .../go-github/{v19 => v20}/github/apps.go | 0 .../{v19 => v20}/github/apps_installation.go | 0 .../{v19 => v20}/github/apps_marketplace.go | 0 .../{v19 => v20}/github/authorizations.go | 0 .../go-github/{v19 => v20}/github/checks.go | 48 ++++--- .../go-github/{v19 => v20}/github/doc.go | 0 .../google/go-github/v20/github/event.go | 126 ++++++++++++++++++ .../{v19 => v20}/github/event_types.go | 23 +++- .../{v19 => v20}/github/gen-accessors.go | 0 .../go-github/{v19 => v20}/github/gists.go | 0 .../{v19 => v20}/github/gists_comments.go | 0 .../go-github/{v19 => v20}/github/git.go | 0 .../{v19 => v20}/github/git_blobs.go | 0 .../{v19 => v20}/github/git_commits.go | 3 - .../go-github/{v19 => v20}/github/git_refs.go | 0 .../go-github/{v19 => v20}/github/git_tags.go | 3 - .../{v19 => v20}/github/git_trees.go | 0 .../{v19 => v20}/github/github-accessors.go | 40 ++++++ .../go-github/{v19 => v20}/github/github.go | 9 +- .../{v19 => v20}/github/gitignore.go | 0 .../go-github/{v19 => v20}/github/issues.go | 0 .../{v19 => v20}/github/issues_assignees.go | 0 .../{v19 => v20}/github/issues_comments.go | 0 .../{v19 => v20}/github/issues_events.go | 19 +-- .../{v19 => v20}/github/issues_labels.go | 0 .../{v19 => v20}/github/issues_milestones.go | 0 .../{v19 => v20}/github/issues_timeline.go | 0 .../go-github/{v19 => v20}/github/licenses.go | 0 .../go-github/{v19 => v20}/github/messages.go | 0 .../{v19 => v20}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v19 => v20}/github/migrations_user.go | 2 +- .../go-github/{v19 => v20}/github/misc.go | 0 .../go-github/{v19 => v20}/github/orgs.go | 0 .../{v19 => v20}/github/orgs_hooks.go | 0 .../{v19 => v20}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v19 => v20}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v19 => v20}/github/projects.go | 0 .../go-github/{v19 => v20}/github/pulls.go | 3 - .../{v19 => v20}/github/pulls_comments.go | 0 .../{v19 => v20}/github/pulls_reviewers.go | 0 .../{v19 => v20}/github/pulls_reviews.go | 0 .../{v19 => v20}/github/reactions.go | 0 .../go-github/{v19 => v20}/github/repos.go | 0 .../github/repos_collaborators.go | 3 - .../{v19 => v20}/github/repos_comments.go | 0 .../{v19 => v20}/github/repos_commits.go | 6 - .../github/repos_community_health.go | 0 .../{v19 => v20}/github/repos_contents.go | 0 .../{v19 => v20}/github/repos_deployments.go | 0 .../{v19 => v20}/github/repos_forks.go | 0 .../{v19 => v20}/github/repos_hooks.go | 0 .../{v19 => v20}/github/repos_invitations.go | 9 -- .../{v19 => v20}/github/repos_keys.go | 0 .../{v19 => v20}/github/repos_merging.go | 0 .../{v19 => v20}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v19 => v20}/github/repos_projects.go | 0 .../{v19 => v20}/github/repos_releases.go | 0 .../{v19 => v20}/github/repos_stats.go | 0 .../{v19 => v20}/github/repos_statuses.go | 0 .../{v19 => v20}/github/repos_traffic.go | 0 .../go-github/{v19 => v20}/github/search.go | 0 .../go-github/{v19 => v20}/github/strings.go | 0 .../go-github/{v19 => v20}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v19 => v20}/github/teams_discussions.go | 0 .../{v19 => v20}/github/teams_members.go | 0 .../{v19 => v20}/github/timestamp.go | 0 .../go-github/{v19 => v20}/github/users.go | 9 -- .../github/users_administration.go | 0 .../{v19 => v20}/github/users_blocking.go | 0 .../{v19 => v20}/github/users_emails.go | 0 .../{v19 => v20}/github/users_followers.go | 0 .../{v19 => v20}/github/users_gpg_keys.go | 12 -- .../{v19 => v20}/github/users_keys.go | 0 .../{v19 => v20}/github/with_appengine.go | 0 .../{v19 => v20}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 128 files changed, 277 insertions(+), 239 deletions(-) rename vendor/github.com/google/go-github/{v19 => v20}/AUTHORS (98%) rename vendor/github.com/google/go-github/{v19 => v20}/LICENSE (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/activity_events.go (63%) rename vendor/github.com/google/go-github/{v19 => v20}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/checks.go (80%) rename vendor/github.com/google/go-github/{v19 => v20}/github/doc.go (100%) create mode 100644 vendor/github.com/google/go-github/v20/github/event.go rename vendor/github.com/google/go-github/{v19 => v20}/github/event_types.go (97%) rename vendor/github.com/google/go-github/{v19 => v20}/github/gen-accessors.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git_commits.go (97%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git_tags.go (95%) rename vendor/github.com/google/go-github/{v19 => v20}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/github-accessors.go (99%) rename vendor/github.com/google/go-github/{v19 => v20}/github/github.go (99%) rename vendor/github.com/google/go-github/{v19 => v20}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_events.go (87%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/messages.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/migrations_user.go (98%) rename vendor/github.com/google/go-github/{v19 => v20}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/pulls.go (99%) rename vendor/github.com/google/go-github/{v19 => v20}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_collaborators.go (97%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_commits.go (96%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_hooks.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_invitations.go (88%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/search.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/teams.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users.go (95%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_gpg_keys.go (89%) rename vendor/github.com/google/go-github/{v19 => v20}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v19 => v20}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index 07dba53834..f097035a5e 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index ba7d0e9bfd..cff1909825 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 10ba84e6f4..b2308433a2 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index c085714aa8..d6e229ccaf 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 41a490cfdc..8a2e5ff699 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index 1a56e1a23f..7011cc7283 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index f070b7e3de..ac3dfe3920 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index d086a6f3fc..518c26001a 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 9da57695b5..ed6d533433 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index a516e48d49..49ba403cd0 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index 849d791126..9580cf492a 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 259ceca7b8..b7ac00eb83 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index 4172363b8e..b53bbdc4ce 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index 370ae7e6f4..e3b23adb28 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 4cb7195001..8c4995dafd 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 4a199b3891..d4a2c418ce 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index df86acda0f..4d34270ebd 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index fae3f07b52..ea23ad0c6e 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index f4080e0fcd..9dbd8d2fdb 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index 9d830c6042..59d6bb697d 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 000543ba26..3e61419372 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 6d54171864..a2dbf7ecad 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index bc6ef8744b..93b33d83e8 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team.go b/github/resource_github_team.go index a8e17726ae..497655849b 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index f15ae40999..dbdda2a99b 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 0d905a05d3..0f6d53a47e 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index bd2dbd37d7..ad57bdc5a5 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index 80c418c410..e9f3b14c82 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index 1bed762ac8..5ff9ac72e0 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index c58def0849..3489f097a1 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index b6ef9f5d41..ab7ed2228b 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 80635ac765..2d1a184808 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index 3b7e5588fd..932a33072f 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/transport.go b/github/transport.go index c5a9dfbb5e..070a78da79 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 4ef18f0498..946f0b9380 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index ba6f6da7d6..0f1f4a921d 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v19/github" + "github.com/google/go-github/v20/github" ) const ( diff --git a/go.mod b/go.mod index 28f847db4c..a5ff9ee442 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v19 v19.1.0 + github.com/google/go-github/v20 v20.0.0 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 5ef10a8901..66bcb70dbc 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,10 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-github/v19 v19.1.0 h1:EXbrEGEwc4zOSl/exLvlHW+y6hEbhI/En/w7lW2PaBI= -github.com/google/go-github/v19 v19.1.0/go.mod h1:GVHidlOJOqnOChZvI4HBBXoOaZ64OfJRoSoY6uo5BSI= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github/v20 v20.0.0 h1:Ffvfyn3+lnxI1BtP4xcxV0S6TrCh6L1IUv5bN4GWsNA= +github.com/google/go-github/v20 v20.0.0/go.mod h1:IRYtAIrijh8T1S+AlIsVlBt3/GT4sAT110wzAVCzevM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= diff --git a/vendor/github.com/google/go-github/v19/AUTHORS b/vendor/github.com/google/go-github/v20/AUTHORS similarity index 98% rename from vendor/github.com/google/go-github/v19/AUTHORS rename to vendor/github.com/google/go-github/v20/AUTHORS index 53c189eda6..8d04ae7ce0 100644 --- a/vendor/github.com/google/go-github/v19/AUTHORS +++ b/vendor/github.com/google/go-github/v20/AUTHORS @@ -121,6 +121,7 @@ Justin Abrahms Jusung Lee jzhoucliqr Katrina Owen +Kautilya Tripathi < tripathi.kautilya@gmail.com> Keita Urashima Kevin Burke Konrad Malawski @@ -155,6 +156,7 @@ Noah Zoschke ns-cweber Oleg Kovalov Ondřej Kupka +Palash Nigam Panagiotis Moustafellos Parham Alvani Parker Moore diff --git a/vendor/github.com/google/go-github/v19/LICENSE b/vendor/github.com/google/go-github/v20/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v19/LICENSE rename to vendor/github.com/google/go-github/v20/LICENSE diff --git a/vendor/github.com/google/go-github/v19/github/activity.go b/vendor/github.com/google/go-github/v20/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/activity.go rename to vendor/github.com/google/go-github/v20/github/activity.go diff --git a/vendor/github.com/google/go-github/v19/github/activity_events.go b/vendor/github.com/google/go-github/v20/github/activity_events.go similarity index 63% rename from vendor/github.com/google/go-github/v19/github/activity_events.go rename to vendor/github.com/google/go-github/v20/github/activity_events.go index 47f0c735bd..1754b78e9d 100644 --- a/vendor/github.com/google/go-github/v19/github/activity_events.go +++ b/vendor/github.com/google/go-github/v20/github/activity_events.go @@ -7,124 +7,9 @@ package github import ( "context" - "encoding/json" "fmt" - "time" ) -// Event represents a GitHub event. -type Event struct { - Type *string `json:"type,omitempty"` - Public *bool `json:"public,omitempty"` - RawPayload *json.RawMessage `json:"payload,omitempty"` - Repo *Repository `json:"repo,omitempty"` - Actor *User `json:"actor,omitempty"` - Org *Organization `json:"org,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - ID *string `json:"id,omitempty"` -} - -func (e Event) String() string { - return Stringify(e) -} - -// ParsePayload parses the event payload. For recognized event types, -// a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (payload interface{}, err error) { - switch *e.Type { - case "CheckRunEvent": - payload = &CheckRunEvent{} - case "CheckSuiteEvent": - payload = &CheckSuiteEvent{} - case "CommitCommentEvent": - payload = &CommitCommentEvent{} - case "CreateEvent": - payload = &CreateEvent{} - case "DeleteEvent": - payload = &DeleteEvent{} - case "DeploymentEvent": - payload = &DeploymentEvent{} - case "DeploymentStatusEvent": - payload = &DeploymentStatusEvent{} - case "ForkEvent": - payload = &ForkEvent{} - case "GollumEvent": - payload = &GollumEvent{} - case "InstallationEvent": - payload = &InstallationEvent{} - case "InstallationRepositoriesEvent": - payload = &InstallationRepositoriesEvent{} - case "IssueCommentEvent": - payload = &IssueCommentEvent{} - case "IssuesEvent": - payload = &IssuesEvent{} - case "LabelEvent": - payload = &LabelEvent{} - case "MarketplacePurchaseEvent": - payload = &MarketplacePurchaseEvent{} - case "MemberEvent": - payload = &MemberEvent{} - case "MembershipEvent": - payload = &MembershipEvent{} - case "MilestoneEvent": - payload = &MilestoneEvent{} - case "OrganizationEvent": - payload = &OrganizationEvent{} - case "OrgBlockEvent": - payload = &OrgBlockEvent{} - case "PageBuildEvent": - payload = &PageBuildEvent{} - case "PingEvent": - payload = &PingEvent{} - case "ProjectEvent": - payload = &ProjectEvent{} - case "ProjectCardEvent": - payload = &ProjectCardEvent{} - case "ProjectColumnEvent": - payload = &ProjectColumnEvent{} - case "PublicEvent": - payload = &PublicEvent{} - case "PullRequestEvent": - payload = &PullRequestEvent{} - case "PullRequestReviewEvent": - payload = &PullRequestReviewEvent{} - case "PullRequestReviewCommentEvent": - payload = &PullRequestReviewCommentEvent{} - case "PushEvent": - payload = &PushEvent{} - case "ReleaseEvent": - payload = &ReleaseEvent{} - case "RepositoryEvent": - payload = &RepositoryEvent{} - case "RepositoryVulnerabilityAlertEvent": - payload = &RepositoryVulnerabilityAlertEvent{} - case "StatusEvent": - payload = &StatusEvent{} - case "TeamEvent": - payload = &TeamEvent{} - case "TeamAddEvent": - payload = &TeamAddEvent{} - case "WatchEvent": - payload = &WatchEvent{} - } - err = json.Unmarshal(*e.RawPayload, &payload) - return payload, err -} - -// Payload returns the parsed event payload. For recognized event types, -// a value of the corresponding struct type will be returned. -// -// Deprecated: Use ParsePayload instead, which returns an error -// rather than panics if JSON unmarshaling raw payload fails. -func (e *Event) Payload() (payload interface{}) { - var err error - payload, err = e.ParsePayload() - if err != nil { - panic(err) - } - return payload -} - // ListEvents drinks from the firehose of all public events across GitHub. // // GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events diff --git a/vendor/github.com/google/go-github/v19/github/activity_notifications.go b/vendor/github.com/google/go-github/v20/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/activity_notifications.go rename to vendor/github.com/google/go-github/v20/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v19/github/activity_star.go b/vendor/github.com/google/go-github/v20/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/activity_star.go rename to vendor/github.com/google/go-github/v20/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v19/github/activity_watching.go b/vendor/github.com/google/go-github/v20/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/activity_watching.go rename to vendor/github.com/google/go-github/v20/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v19/github/admin.go b/vendor/github.com/google/go-github/v20/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/admin.go rename to vendor/github.com/google/go-github/v20/github/admin.go diff --git a/vendor/github.com/google/go-github/v19/github/admin_stats.go b/vendor/github.com/google/go-github/v20/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/admin_stats.go rename to vendor/github.com/google/go-github/v20/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v19/github/apps.go b/vendor/github.com/google/go-github/v20/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/apps.go rename to vendor/github.com/google/go-github/v20/github/apps.go diff --git a/vendor/github.com/google/go-github/v19/github/apps_installation.go b/vendor/github.com/google/go-github/v20/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/apps_installation.go rename to vendor/github.com/google/go-github/v20/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v19/github/apps_marketplace.go b/vendor/github.com/google/go-github/v20/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v20/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v19/github/authorizations.go b/vendor/github.com/google/go-github/v20/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/authorizations.go rename to vendor/github.com/google/go-github/v20/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v19/github/checks.go b/vendor/github.com/google/go-github/v20/github/checks.go similarity index 80% rename from vendor/github.com/google/go-github/v19/github/checks.go rename to vendor/github.com/google/go-github/v20/github/checks.go index 2a6ce4193c..f27d40d4d3 100644 --- a/vendor/github.com/google/go-github/v19/github/checks.go +++ b/vendor/github.com/google/go-github/v20/github/checks.go @@ -24,6 +24,7 @@ type CheckRun struct { ExternalID *string `json:"external_id,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` + DetailsURL *string `json:"details_url,omitempty"` Status *string `json:"status,omitempty"` Conclusion *string `json:"conclusion,omitempty"` StartedAt *Timestamp `json:"started_at,omitempty"` @@ -133,16 +134,24 @@ func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, c // CreateCheckRunOptions sets up parameters needed to create a CheckRun. type CreateCheckRunOptions struct { - Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.) - HeadBranch string `json:"head_branch"` // The name of the branch to perform a check against. (Required.) - HeadSHA string `json:"head_sha"` // The SHA of the commit. (Required.) - DetailsURL *string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.) - ExternalID *string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.) - Status *string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.) - Conclusion *string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".) - StartedAt *Timestamp `json:"started_at,omitempty"` // The time that the check run began. (Optional.) - CompletedAt *Timestamp `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.) - Output *CheckRunOutput `json:"output,omitempty"` // Provide descriptive details about the run. (Optional) + Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.) + HeadBranch string `json:"head_branch"` // The name of the branch to perform a check against. (Required.) + HeadSHA string `json:"head_sha"` // The SHA of the commit. (Required.) + DetailsURL *string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.) + ExternalID *string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.) + Status *string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.) + Conclusion *string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".) + StartedAt *Timestamp `json:"started_at,omitempty"` // The time that the check run began. (Optional.) + CompletedAt *Timestamp `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.) + Output *CheckRunOutput `json:"output,omitempty"` // Provide descriptive details about the run. (Optional) + Actions []*CheckRunAction `json:"actions,omitempty"` // Possible further actions the integrator can perform, which a user may trigger. (Optional.) +} + +// CheckRunAction exposes further actions the integrator can perform, which a user may trigger. +type CheckRunAction struct { + Label string `json:"label"` // The text to be displayed on a button in the web UI. The maximum size is 20 characters. (Required.) + Description string `json:"description"` // A short explanation of what this action would do. The maximum size is 40 characters. (Required.) + Identifier string `json:"identifier"` // A reference for the action on the integrator's system. The maximum size is 20 characters. (Required.) } // CreateCheckRun creates a check run for repository. @@ -168,15 +177,16 @@ func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, // UpdateCheckRunOptions sets up parameters needed to update a CheckRun. type UpdateCheckRunOptions struct { - Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.) - HeadBranch *string `json:"head_branch,omitempty"` // The name of the branch to perform a check against. (Optional.) - HeadSHA *string `json:"head_sha,omitempty"` // The SHA of the commit. (Optional.) - DetailsURL *string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.) - ExternalID *string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.) - Status *string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.) - Conclusion *string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".) - CompletedAt *Timestamp `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.) - Output *CheckRunOutput `json:"output,omitempty"` // Provide descriptive details about the run. (Optional) + Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.) + HeadBranch *string `json:"head_branch,omitempty"` // The name of the branch to perform a check against. (Optional.) + HeadSHA *string `json:"head_sha,omitempty"` // The SHA of the commit. (Optional.) + DetailsURL *string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.) + ExternalID *string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.) + Status *string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.) + Conclusion *string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".) + CompletedAt *Timestamp `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.) + Output *CheckRunOutput `json:"output,omitempty"` // Provide descriptive details about the run. (Optional) + Actions []*CheckRunAction `json:"actions,omitempty"` // Possible further actions the integrator can perform, which a user may trigger. (Optional.) } // UpdateCheckRun updates a check run for a specific commit in a repository. diff --git a/vendor/github.com/google/go-github/v19/github/doc.go b/vendor/github.com/google/go-github/v20/github/doc.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/doc.go rename to vendor/github.com/google/go-github/v20/github/doc.go diff --git a/vendor/github.com/google/go-github/v20/github/event.go b/vendor/github.com/google/go-github/v20/github/event.go new file mode 100644 index 0000000000..04c8845a1f --- /dev/null +++ b/vendor/github.com/google/go-github/v20/github/event.go @@ -0,0 +1,126 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "encoding/json" + "time" +) + +// Event represents a GitHub event. +type Event struct { + Type *string `json:"type,omitempty"` + Public *bool `json:"public,omitempty"` + RawPayload *json.RawMessage `json:"payload,omitempty"` + Repo *Repository `json:"repo,omitempty"` + Actor *User `json:"actor,omitempty"` + Org *Organization `json:"org,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (e Event) String() string { + return Stringify(e) +} + +// ParsePayload parses the event payload. For recognized event types, +// a value of the corresponding struct type will be returned. +func (e *Event) ParsePayload() (payload interface{}, err error) { + switch *e.Type { + case "CheckRunEvent": + payload = &CheckRunEvent{} + case "CheckSuiteEvent": + payload = &CheckSuiteEvent{} + case "CommitCommentEvent": + payload = &CommitCommentEvent{} + case "CreateEvent": + payload = &CreateEvent{} + case "DeleteEvent": + payload = &DeleteEvent{} + case "DeploymentEvent": + payload = &DeploymentEvent{} + case "DeploymentStatusEvent": + payload = &DeploymentStatusEvent{} + case "ForkEvent": + payload = &ForkEvent{} + case "GitHubAppAuthorizationEvent": + payload = &GitHubAppAuthorizationEvent{} + case "GollumEvent": + payload = &GollumEvent{} + case "InstallationEvent": + payload = &InstallationEvent{} + case "InstallationRepositoriesEvent": + payload = &InstallationRepositoriesEvent{} + case "IssueCommentEvent": + payload = &IssueCommentEvent{} + case "IssuesEvent": + payload = &IssuesEvent{} + case "LabelEvent": + payload = &LabelEvent{} + case "MarketplacePurchaseEvent": + payload = &MarketplacePurchaseEvent{} + case "MemberEvent": + payload = &MemberEvent{} + case "MembershipEvent": + payload = &MembershipEvent{} + case "MilestoneEvent": + payload = &MilestoneEvent{} + case "OrganizationEvent": + payload = &OrganizationEvent{} + case "OrgBlockEvent": + payload = &OrgBlockEvent{} + case "PageBuildEvent": + payload = &PageBuildEvent{} + case "PingEvent": + payload = &PingEvent{} + case "ProjectEvent": + payload = &ProjectEvent{} + case "ProjectCardEvent": + payload = &ProjectCardEvent{} + case "ProjectColumnEvent": + payload = &ProjectColumnEvent{} + case "PublicEvent": + payload = &PublicEvent{} + case "PullRequestEvent": + payload = &PullRequestEvent{} + case "PullRequestReviewEvent": + payload = &PullRequestReviewEvent{} + case "PullRequestReviewCommentEvent": + payload = &PullRequestReviewCommentEvent{} + case "PushEvent": + payload = &PushEvent{} + case "ReleaseEvent": + payload = &ReleaseEvent{} + case "RepositoryEvent": + payload = &RepositoryEvent{} + case "RepositoryVulnerabilityAlertEvent": + payload = &RepositoryVulnerabilityAlertEvent{} + case "StatusEvent": + payload = &StatusEvent{} + case "TeamEvent": + payload = &TeamEvent{} + case "TeamAddEvent": + payload = &TeamAddEvent{} + case "WatchEvent": + payload = &WatchEvent{} + } + err = json.Unmarshal(*e.RawPayload, &payload) + return payload, err +} + +// Payload returns the parsed event payload. For recognized event types, +// a value of the corresponding struct type will be returned. +// +// Deprecated: Use ParsePayload instead, which returns an error +// rather than panics if JSON unmarshaling raw payload fails. +func (e *Event) Payload() (payload interface{}) { + var err error + payload, err = e.ParsePayload() + if err != nil { + panic(err) + } + return payload +} diff --git a/vendor/github.com/google/go-github/v19/github/event_types.go b/vendor/github.com/google/go-github/v20/github/event_types.go similarity index 97% rename from vendor/github.com/google/go-github/v19/github/event_types.go rename to vendor/github.com/google/go-github/v20/github/event_types.go index d3f7d33202..0d70a474c0 100644 --- a/vendor/github.com/google/go-github/v19/github/event_types.go +++ b/vendor/github.com/google/go-github/v20/github/event_types.go @@ -7,13 +7,19 @@ package github +// RequestedAction is included in a CheckRunEvent when a user has invoked an action, +// i.e. when the CheckRunEvent's Action field is "requested_action". +type RequestedAction struct { + Identifier string `json:"identifier"` // The integrator reference of the action requested by the user. +} + // CheckRunEvent is triggered when a check run is "created", "updated", or "re-requested". // The Webhook event name is "check_run". // // GitHub API docs: https://developer.github.com/v3/activity/events/types/#checkrunevent type CheckRunEvent struct { CheckRun *CheckRun `json:"check_run,omitempty"` - // The action performed. Can be "created", "updated" or "re-requested". + // The action performed. Can be "created", "updated", "rerequested" or "requested_action". Action *string `json:"action,omitempty"` // The following fields are only populated by Webhook events. @@ -21,6 +27,9 @@ type CheckRunEvent struct { Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The action requested by the user. Populated when the Action is "requested_action". + RequestedAction *RequestedAction `json:"requested_action,omitempty"` // } // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "re-requested". @@ -139,6 +148,18 @@ type ForkEvent struct { Installation *Installation `json:"installation,omitempty"` } +// GitHubAppAuthorizationEvent is triggered when a user's authorization for a +// GitHub Application is revoked. +// +// GitHub API docs: https://developer.github.com/v3/activity/events/types/#githubappauthorizationevent +type GitHubAppAuthorizationEvent struct { + // The action performed. Can be "revoked". + Action *string `json:"action,omitempty"` + + // The following fields are only populated by Webhook events. + Sender *User `json:"sender,omitempty"` +} + // Page represents a single Wiki page. type Page struct { PageName *string `json:"page_name,omitempty"` diff --git a/vendor/github.com/google/go-github/v19/github/gen-accessors.go b/vendor/github.com/google/go-github/v20/github/gen-accessors.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/gen-accessors.go rename to vendor/github.com/google/go-github/v20/github/gen-accessors.go diff --git a/vendor/github.com/google/go-github/v19/github/gists.go b/vendor/github.com/google/go-github/v20/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/gists.go rename to vendor/github.com/google/go-github/v20/github/gists.go diff --git a/vendor/github.com/google/go-github/v19/github/gists_comments.go b/vendor/github.com/google/go-github/v20/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/gists_comments.go rename to vendor/github.com/google/go-github/v20/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v19/github/git.go b/vendor/github.com/google/go-github/v20/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/git.go rename to vendor/github.com/google/go-github/v20/github/git.go diff --git a/vendor/github.com/google/go-github/v19/github/git_blobs.go b/vendor/github.com/google/go-github/v20/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/git_blobs.go rename to vendor/github.com/google/go-github/v20/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v19/github/git_commits.go b/vendor/github.com/google/go-github/v20/github/git_commits.go similarity index 97% rename from vendor/github.com/google/go-github/v19/github/git_commits.go rename to vendor/github.com/google/go-github/v20/github/git_commits.go index a2b17fcc30..7638acbd69 100644 --- a/vendor/github.com/google/go-github/v19/github/git_commits.go +++ b/vendor/github.com/google/go-github/v20/github/git_commits.go @@ -68,9 +68,6 @@ func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, s return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - c := new(Commit) resp, err := s.client.Do(ctx, req, c) if err != nil { diff --git a/vendor/github.com/google/go-github/v19/github/git_refs.go b/vendor/github.com/google/go-github/v20/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/git_refs.go rename to vendor/github.com/google/go-github/v20/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v19/github/git_tags.go b/vendor/github.com/google/go-github/v20/github/git_tags.go similarity index 95% rename from vendor/github.com/google/go-github/v19/github/git_tags.go rename to vendor/github.com/google/go-github/v20/github/git_tags.go index f66e4028fe..abdbde6821 100644 --- a/vendor/github.com/google/go-github/v19/github/git_tags.go +++ b/vendor/github.com/google/go-github/v20/github/git_tags.go @@ -43,9 +43,6 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - tag := new(Tag) resp, err := s.client.Do(ctx, req, tag) return tag, resp, err diff --git a/vendor/github.com/google/go-github/v19/github/git_trees.go b/vendor/github.com/google/go-github/v20/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/git_trees.go rename to vendor/github.com/google/go-github/v20/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v19/github/github-accessors.go b/vendor/github.com/google/go-github/v20/github/github-accessors.go similarity index 99% rename from vendor/github.com/google/go-github/v19/github/github-accessors.go rename to vendor/github.com/google/go-github/v20/github/github-accessors.go index 776ef42ece..1c461b557c 100644 --- a/vendor/github.com/google/go-github/v19/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v20/github/github-accessors.go @@ -492,6 +492,14 @@ func (c *CheckRun) GetConclusion() string { return *c.Conclusion } +// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise. +func (c *CheckRun) GetDetailsURL() string { + if c == nil || c.DetailsURL == nil { + return "" + } + return *c.DetailsURL +} + // GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. func (c *CheckRun) GetExternalID() string { if c == nil || c.ExternalID == nil { @@ -676,6 +684,14 @@ func (c *CheckRunEvent) GetRepo() *Repository { return c.Repo } +// GetRequestedAction returns the RequestedAction field. +func (c *CheckRunEvent) GetRequestedAction() *RequestedAction { + if c == nil { + return nil + } + return c.RequestedAction +} + // GetSender returns the Sender field. func (c *CheckRunEvent) GetSender() *User { if c == nil { @@ -2932,6 +2948,22 @@ func (g *GistStats) GetTotalGists() int { return *g.TotalGists } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (g *GitHubAppAuthorizationEvent) GetAction() string { + if g == nil || g.Action == nil { + return "" + } + return *g.Action +} + +// GetSender returns the Sender field. +func (g *GitHubAppAuthorizationEvent) GetSender() *User { + if g == nil { + return nil + } + return g.Sender +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (g *Gitignore) GetName() string { if g == nil || g.Name == nil { @@ -4076,6 +4108,14 @@ func (i *IssueEvent) GetMilestone() *Milestone { return i.Milestone } +// GetProjectCard returns the ProjectCard field. +func (i *IssueEvent) GetProjectCard() *ProjectCard { + if i == nil { + return nil + } + return i.ProjectCard +} + // GetRename returns the Rename field. func (i *IssueEvent) GetRename() *Rename { if i == nil { diff --git a/vendor/github.com/google/go-github/v19/github/github.go b/vendor/github.com/google/go-github/v20/github/github.go similarity index 99% rename from vendor/github.com/google/go-github/v19/github/github.go rename to vendor/github.com/google/go-github/v20/github/github.go index c58d7f9b3f..19ffecc7d2 100644 --- a/vendor/github.com/google/go-github/v19/github/github.go +++ b/vendor/github.com/google/go-github/v20/github/github.go @@ -63,15 +63,9 @@ const ( // https://developer.github.com/changes/2016-05-12-reactions-api-preview/ mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview" - // https://developer.github.com/changes/2016-04-04-git-signing-api-preview/ - mediaTypeGitSigningPreview = "application/vnd.github.cryptographer-preview+json" - // https://developer.github.com/changes/2016-05-23-timeline-preview-api/ mediaTypeTimelinePreview = "application/vnd.github.mockingbird-preview+json" - // https://developer.github.com/changes/2016-06-14-repository-invitations/ - mediaTypeRepositoryInvitationsPreview = "application/vnd.github.swamp-thing-preview+json" - // https://developer.github.com/changes/2016-07-06-github-pages-preiew-api/ mediaTypePagesPreview = "application/vnd.github.mister-fantastic-preview+json" @@ -128,6 +122,9 @@ const ( // https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/ mediaTypeSignaturePreview = "application/vnd.github.zzzax-preview+json" + + // https://developer.github.com/changes/2018-09-05-project-card-events/ + mediaTypeProjectCardDetailsPreview = "application/vnd.github.starfox-preview+json" ) // A Client manages communication with the GitHub API. diff --git a/vendor/github.com/google/go-github/v19/github/gitignore.go b/vendor/github.com/google/go-github/v20/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/gitignore.go rename to vendor/github.com/google/go-github/v20/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v19/github/issues.go b/vendor/github.com/google/go-github/v20/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues.go rename to vendor/github.com/google/go-github/v20/github/issues.go diff --git a/vendor/github.com/google/go-github/v19/github/issues_assignees.go b/vendor/github.com/google/go-github/v20/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues_assignees.go rename to vendor/github.com/google/go-github/v20/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v19/github/issues_comments.go b/vendor/github.com/google/go-github/v20/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues_comments.go rename to vendor/github.com/google/go-github/v20/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v19/github/issues_events.go b/vendor/github.com/google/go-github/v20/github/issues_events.go similarity index 87% rename from vendor/github.com/google/go-github/v19/github/issues_events.go rename to vendor/github.com/google/go-github/v20/github/issues_events.go index f71e46361c..6a43f1062d 100644 --- a/vendor/github.com/google/go-github/v19/github/issues_events.go +++ b/vendor/github.com/google/go-github/v20/github/issues_events.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "strings" "time" ) @@ -68,13 +69,14 @@ type IssueEvent struct { Issue *Issue `json:"issue,omitempty"` // Only present on certain events; see above. - Assignee *User `json:"assignee,omitempty"` - Assigner *User `json:"assigner,omitempty"` - CommitID *string `json:"commit_id,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - Label *Label `json:"label,omitempty"` - Rename *Rename `json:"rename,omitempty"` - LockReason *string `json:"lock_reason,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assigner *User `json:"assigner,omitempty"` + CommitID *string `json:"commit_id,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + Label *Label `json:"label,omitempty"` + Rename *Rename `json:"rename,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + ProjectCard *ProjectCard `json:"project_card,omitempty"` } // ListIssueEvents lists events for the specified issue. @@ -92,7 +94,8 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, return nil, nil, err } - req.Header.Set("Accept", mediaTypeLockReasonPreview) + acceptHeaders := []string{mediaTypeLockReasonPreview, mediaTypeProjectCardDetailsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var events []*IssueEvent resp, err := s.client.Do(ctx, req, &events) diff --git a/vendor/github.com/google/go-github/v19/github/issues_labels.go b/vendor/github.com/google/go-github/v20/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues_labels.go rename to vendor/github.com/google/go-github/v20/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v19/github/issues_milestones.go b/vendor/github.com/google/go-github/v20/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues_milestones.go rename to vendor/github.com/google/go-github/v20/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v19/github/issues_timeline.go b/vendor/github.com/google/go-github/v20/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/issues_timeline.go rename to vendor/github.com/google/go-github/v20/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v19/github/licenses.go b/vendor/github.com/google/go-github/v20/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/licenses.go rename to vendor/github.com/google/go-github/v20/github/licenses.go diff --git a/vendor/github.com/google/go-github/v19/github/messages.go b/vendor/github.com/google/go-github/v20/github/messages.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/messages.go rename to vendor/github.com/google/go-github/v20/github/messages.go diff --git a/vendor/github.com/google/go-github/v19/github/migrations.go b/vendor/github.com/google/go-github/v20/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/migrations.go rename to vendor/github.com/google/go-github/v20/github/migrations.go diff --git a/vendor/github.com/google/go-github/v19/github/migrations_source_import.go b/vendor/github.com/google/go-github/v20/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v20/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v19/github/migrations_user.go b/vendor/github.com/google/go-github/v20/github/migrations_user.go similarity index 98% rename from vendor/github.com/google/go-github/v19/github/migrations_user.go rename to vendor/github.com/google/go-github/v20/github/migrations_user.go index ae53e6870e..d45555f216 100644 --- a/vendor/github.com/google/go-github/v19/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v20/github/migrations_user.go @@ -193,7 +193,7 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* return s.client.Do(ctx, req, nil) } -// UnlockUserRepository will unlock a repo that was locked for migration. +// UnlockUserRepo will unlock a repo that was locked for migration. // id is migration ID. // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. diff --git a/vendor/github.com/google/go-github/v19/github/misc.go b/vendor/github.com/google/go-github/v20/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/misc.go rename to vendor/github.com/google/go-github/v20/github/misc.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs.go b/vendor/github.com/google/go-github/v20/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs.go rename to vendor/github.com/google/go-github/v20/github/orgs.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs_hooks.go b/vendor/github.com/google/go-github/v20/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v20/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs_members.go b/vendor/github.com/google/go-github/v20/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs_members.go rename to vendor/github.com/google/go-github/v20/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v20/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v20/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs_projects.go b/vendor/github.com/google/go-github/v20/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs_projects.go rename to vendor/github.com/google/go-github/v20/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v19/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v20/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v20/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v19/github/projects.go b/vendor/github.com/google/go-github/v20/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/projects.go rename to vendor/github.com/google/go-github/v20/github/projects.go diff --git a/vendor/github.com/google/go-github/v19/github/pulls.go b/vendor/github.com/google/go-github/v20/github/pulls.go similarity index 99% rename from vendor/github.com/google/go-github/v19/github/pulls.go rename to vendor/github.com/google/go-github/v20/github/pulls.go index 6026114211..aac34792bd 100644 --- a/vendor/github.com/google/go-github/v19/github/pulls.go +++ b/vendor/github.com/google/go-github/v20/github/pulls.go @@ -303,9 +303,6 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - var commits []*RepositoryCommit resp, err := s.client.Do(ctx, req, &commits) if err != nil { diff --git a/vendor/github.com/google/go-github/v19/github/pulls_comments.go b/vendor/github.com/google/go-github/v20/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/pulls_comments.go rename to vendor/github.com/google/go-github/v20/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v19/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v20/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v20/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v19/github/pulls_reviews.go b/vendor/github.com/google/go-github/v20/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v20/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v19/github/reactions.go b/vendor/github.com/google/go-github/v20/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/reactions.go rename to vendor/github.com/google/go-github/v20/github/reactions.go diff --git a/vendor/github.com/google/go-github/v19/github/repos.go b/vendor/github.com/google/go-github/v20/github/repos.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos.go rename to vendor/github.com/google/go-github/v20/github/repos.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_collaborators.go b/vendor/github.com/google/go-github/v20/github/repos_collaborators.go similarity index 97% rename from vendor/github.com/google/go-github/v19/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v20/github/repos_collaborators.go index 61ee9d39c6..757e9f39e4 100644 --- a/vendor/github.com/google/go-github/v19/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/v20/github/repos_collaborators.go @@ -120,9 +120,6 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v19/github/repos_comments.go b/vendor/github.com/google/go-github/v20/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_comments.go rename to vendor/github.com/google/go-github/v20/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_commits.go b/vendor/github.com/google/go-github/v20/github/repos_commits.go similarity index 96% rename from vendor/github.com/google/go-github/v19/github/repos_commits.go rename to vendor/github.com/google/go-github/v20/github/repos_commits.go index 1acfa5ad1b..0dcfe62cb4 100644 --- a/vendor/github.com/google/go-github/v19/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v20/github/repos_commits.go @@ -128,9 +128,6 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - var commits []*RepositoryCommit resp, err := s.client.Do(ctx, req, &commits) if err != nil { @@ -152,9 +149,6 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - commit := new(RepositoryCommit) resp, err := s.client.Do(ctx, req, commit) if err != nil { diff --git a/vendor/github.com/google/go-github/v19/github/repos_community_health.go b/vendor/github.com/google/go-github/v20/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_community_health.go rename to vendor/github.com/google/go-github/v20/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_contents.go b/vendor/github.com/google/go-github/v20/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_contents.go rename to vendor/github.com/google/go-github/v20/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_deployments.go b/vendor/github.com/google/go-github/v20/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_deployments.go rename to vendor/github.com/google/go-github/v20/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_forks.go b/vendor/github.com/google/go-github/v20/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_forks.go rename to vendor/github.com/google/go-github/v20/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_hooks.go b/vendor/github.com/google/go-github/v20/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_hooks.go rename to vendor/github.com/google/go-github/v20/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_invitations.go b/vendor/github.com/google/go-github/v20/github/repos_invitations.go similarity index 88% rename from vendor/github.com/google/go-github/v19/github/repos_invitations.go rename to vendor/github.com/google/go-github/v20/github/repos_invitations.go index 34bf3830fb..b88e9359f3 100644 --- a/vendor/github.com/google/go-github/v19/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v20/github/repos_invitations.go @@ -40,9 +40,6 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - invites := []*RepositoryInvitation{} resp, err := s.client.Do(ctx, req, &invites) if err != nil { @@ -62,9 +59,6 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - return s.client.Do(ctx, req, nil) } @@ -85,9 +79,6 @@ func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - invite := &RepositoryInvitation{} resp, err := s.client.Do(ctx, req, invite) if err != nil { diff --git a/vendor/github.com/google/go-github/v19/github/repos_keys.go b/vendor/github.com/google/go-github/v20/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_keys.go rename to vendor/github.com/google/go-github/v20/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_merging.go b/vendor/github.com/google/go-github/v20/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_merging.go rename to vendor/github.com/google/go-github/v20/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_pages.go b/vendor/github.com/google/go-github/v20/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_pages.go rename to vendor/github.com/google/go-github/v20/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v20/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v20/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_projects.go b/vendor/github.com/google/go-github/v20/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_projects.go rename to vendor/github.com/google/go-github/v20/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_releases.go b/vendor/github.com/google/go-github/v20/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_releases.go rename to vendor/github.com/google/go-github/v20/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_stats.go b/vendor/github.com/google/go-github/v20/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_stats.go rename to vendor/github.com/google/go-github/v20/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_statuses.go b/vendor/github.com/google/go-github/v20/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_statuses.go rename to vendor/github.com/google/go-github/v20/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v19/github/repos_traffic.go b/vendor/github.com/google/go-github/v20/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/repos_traffic.go rename to vendor/github.com/google/go-github/v20/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v19/github/search.go b/vendor/github.com/google/go-github/v20/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/search.go rename to vendor/github.com/google/go-github/v20/github/search.go diff --git a/vendor/github.com/google/go-github/v19/github/strings.go b/vendor/github.com/google/go-github/v20/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/strings.go rename to vendor/github.com/google/go-github/v20/github/strings.go diff --git a/vendor/github.com/google/go-github/v19/github/teams.go b/vendor/github.com/google/go-github/v20/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/teams.go rename to vendor/github.com/google/go-github/v20/github/teams.go diff --git a/vendor/github.com/google/go-github/v19/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v20/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v20/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v19/github/teams_discussions.go b/vendor/github.com/google/go-github/v20/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/teams_discussions.go rename to vendor/github.com/google/go-github/v20/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v19/github/teams_members.go b/vendor/github.com/google/go-github/v20/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/teams_members.go rename to vendor/github.com/google/go-github/v20/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v19/github/timestamp.go b/vendor/github.com/google/go-github/v20/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/timestamp.go rename to vendor/github.com/google/go-github/v20/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v19/github/users.go b/vendor/github.com/google/go-github/v20/github/users.go similarity index 95% rename from vendor/github.com/google/go-github/v19/github/users.go rename to vendor/github.com/google/go-github/v20/github/users.go index a4f74904c3..87cfa7f84b 100644 --- a/vendor/github.com/google/go-github/v19/github/users.go +++ b/vendor/github.com/google/go-github/v20/github/users.go @@ -239,9 +239,6 @@ func (s *UsersService) ListInvitations(ctx context.Context, opt *ListOptions) ([ return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - invites := []*RepositoryInvitation{} resp, err := s.client.Do(ctx, req, &invites) if err != nil { @@ -262,9 +259,6 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - return s.client.Do(ctx, req, nil) } @@ -279,8 +273,5 @@ func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64 return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) - return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v19/github/users_administration.go b/vendor/github.com/google/go-github/v20/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/users_administration.go rename to vendor/github.com/google/go-github/v20/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v19/github/users_blocking.go b/vendor/github.com/google/go-github/v20/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/users_blocking.go rename to vendor/github.com/google/go-github/v20/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v19/github/users_emails.go b/vendor/github.com/google/go-github/v20/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/users_emails.go rename to vendor/github.com/google/go-github/v20/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v19/github/users_followers.go b/vendor/github.com/google/go-github/v20/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/users_followers.go rename to vendor/github.com/google/go-github/v20/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v19/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v20/github/users_gpg_keys.go similarity index 89% rename from vendor/github.com/google/go-github/v19/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v20/github/users_gpg_keys.go index d8bbc5201f..07ed38dcbe 100644 --- a/vendor/github.com/google/go-github/v19/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v20/github/users_gpg_keys.go @@ -62,9 +62,6 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opt *ListOp return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - var keys []*GPGKey resp, err := s.client.Do(ctx, req, &keys) if err != nil { @@ -85,9 +82,6 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - key := &GPGKey{} resp, err := s.client.Do(ctx, req, key) if err != nil { @@ -110,9 +104,6 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - key := &GPGKey{} resp, err := s.client.Do(ctx, req, key) if err != nil { @@ -133,8 +124,5 @@ func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, e return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) - return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v19/github/users_keys.go b/vendor/github.com/google/go-github/v20/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/users_keys.go rename to vendor/github.com/google/go-github/v20/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v19/github/with_appengine.go b/vendor/github.com/google/go-github/v20/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/with_appengine.go rename to vendor/github.com/google/go-github/v20/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v19/github/without_appengine.go b/vendor/github.com/google/go-github/v20/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v19/github/without_appengine.go rename to vendor/github.com/google/go-github/v20/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index be0ef37217..f3510f36df 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,8 +54,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v19 v19.1.0 -github.com/google/go-github/v19/github +# github.com/google/go-github/v20 v20.0.0 +github.com/google/go-github/v20/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce From 66f6f4f08f4b87eafa15bdf0756cbdf0447f2541 Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Fri, 8 Feb 2019 21:50:43 +0000 Subject: [PATCH 7/9] vendor: github.com/google/go-github/github@v21.0.0 Signed-off-by: Trevor Bramwell --- github/config.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- ...source_github_organization_webhook_test.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 2 +- ...resource_github_repository_webhook_test.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../google/go-github/{v20 => v21}/AUTHORS | 6 + .../google/go-github/{v20 => v21}/LICENSE | 0 .../go-github/{v20 => v21}/github/activity.go | 0 .../{v20 => v21}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v20 => v21}/github/activity_star.go | 0 .../{v20 => v21}/github/activity_watching.go | 0 .../go-github/{v20 => v21}/github/admin.go | 0 .../{v20 => v21}/github/admin_stats.go | 0 .../go-github/{v20 => v21}/github/apps.go | 0 .../{v20 => v21}/github/apps_installation.go | 6 +- .../{v20 => v21}/github/apps_marketplace.go | 0 .../{v20 => v21}/github/authorizations.go | 0 .../go-github/{v20 => v21}/github/checks.go | 5 +- .../go-github/{v20 => v21}/github/doc.go | 3 +- .../go-github/{v20 => v21}/github/event.go | 0 .../{v20 => v21}/github/event_types.go | 0 .../{v20 => v21}/github/gen-accessors.go | 0 .../go-github/{v20 => v21}/github/gists.go | 0 .../{v20 => v21}/github/gists_comments.go | 0 .../go-github/{v20 => v21}/github/git.go | 0 .../{v20 => v21}/github/git_blobs.go | 0 .../{v20 => v21}/github/git_commits.go | 0 .../go-github/{v20 => v21}/github/git_refs.go | 7 +- .../go-github/{v20 => v21}/github/git_tags.go | 0 .../{v20 => v21}/github/git_trees.go | 0 .../{v20 => v21}/github/github-accessors.go | 104 ++++++++++++++ .../go-github/{v20 => v21}/github/github.go | 5 + .../{v20 => v21}/github/gitignore.go | 0 .../go-github/v21/github/interactions.go | 28 ++++ .../go-github/v21/github/interactions_orgs.go | 80 +++++++++++ .../v21/github/interactions_repos.go | 80 +++++++++++ .../go-github/{v20 => v21}/github/issues.go | 0 .../{v20 => v21}/github/issues_assignees.go | 0 .../{v20 => v21}/github/issues_comments.go | 0 .../{v20 => v21}/github/issues_events.go | 0 .../{v20 => v21}/github/issues_labels.go | 0 .../{v20 => v21}/github/issues_milestones.go | 0 .../{v20 => v21}/github/issues_timeline.go | 7 +- .../go-github/{v20 => v21}/github/licenses.go | 0 .../go-github/{v20 => v21}/github/messages.go | 0 .../{v20 => v21}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v20 => v21}/github/migrations_user.go | 0 .../go-github/{v20 => v21}/github/misc.go | 0 .../go-github/{v20 => v21}/github/orgs.go | 0 .../{v20 => v21}/github/orgs_hooks.go | 0 .../{v20 => v21}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v20 => v21}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v20 => v21}/github/projects.go | 132 ++++++++++++++++++ .../go-github/{v20 => v21}/github/pulls.go | 0 .../{v20 => v21}/github/pulls_comments.go | 0 .../{v20 => v21}/github/pulls_reviewers.go | 0 .../{v20 => v21}/github/pulls_reviews.go | 0 .../{v20 => v21}/github/reactions.go | 4 +- .../go-github/{v20 => v21}/github/repos.go | 4 +- .../github/repos_collaborators.go | 0 .../{v20 => v21}/github/repos_comments.go | 0 .../{v20 => v21}/github/repos_commits.go | 3 +- .../github/repos_community_health.go | 0 .../{v20 => v21}/github/repos_contents.go | 0 .../{v20 => v21}/github/repos_deployments.go | 0 .../{v20 => v21}/github/repos_forks.go | 0 .../{v20 => v21}/github/repos_hooks.go | 0 .../{v20 => v21}/github/repos_invitations.go | 0 .../{v20 => v21}/github/repos_keys.go | 0 .../{v20 => v21}/github/repos_merging.go | 0 .../{v20 => v21}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v20 => v21}/github/repos_projects.go | 0 .../{v20 => v21}/github/repos_releases.go | 0 .../{v20 => v21}/github/repos_stats.go | 0 .../{v20 => v21}/github/repos_statuses.go | 7 +- .../{v20 => v21}/github/repos_traffic.go | 0 .../go-github/{v20 => v21}/github/search.go | 0 .../go-github/{v20 => v21}/github/strings.go | 0 .../go-github/{v20 => v21}/github/teams.go | 100 +++++++++++++ .../github/teams_discussion_comments.go | 0 .../{v20 => v21}/github/teams_discussions.go | 0 .../{v20 => v21}/github/teams_members.go | 0 .../{v20 => v21}/github/timestamp.go | 0 .../go-github/{v20 => v21}/github/users.go | 0 .../github/users_administration.go | 0 .../{v20 => v21}/github/users_blocking.go | 0 .../{v20 => v21}/github/users_emails.go | 0 .../{v20 => v21}/github/users_followers.go | 0 .../{v20 => v21}/github/users_gpg_keys.go | 0 .../{v20 => v21}/github/users_keys.go | 0 .../{v20 => v21}/github/with_appengine.go | 0 .../{v20 => v21}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 131 files changed, 605 insertions(+), 58 deletions(-) rename vendor/github.com/google/go-github/{v20 => v21}/AUTHORS (97%) rename vendor/github.com/google/go-github/{v20 => v21}/LICENSE (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/apps_installation.go (92%) rename vendor/github.com/google/go-github/{v20 => v21}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/checks.go (99%) rename vendor/github.com/google/go-github/{v20 => v21}/github/doc.go (97%) rename vendor/github.com/google/go-github/{v20 => v21}/github/event.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/event_types.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/gen-accessors.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git_commits.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git_refs.go (96%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/github-accessors.go (99%) rename vendor/github.com/google/go-github/{v20 => v21}/github/github.go (99%) rename vendor/github.com/google/go-github/{v20 => v21}/github/gitignore.go (100%) create mode 100644 vendor/github.com/google/go-github/v21/github/interactions.go create mode 100644 vendor/github.com/google/go-github/v21/github/interactions_orgs.go create mode 100644 vendor/github.com/google/go-github/v21/github/interactions_repos.go rename vendor/github.com/google/go-github/{v20 => v21}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/issues_timeline.go (94%) rename vendor/github.com/google/go-github/{v20 => v21}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/messages.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/projects.go (74%) rename vendor/github.com/google/go-github/{v20 => v21}/github/pulls.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/reactions.go (99%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos.go (99%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_commits.go (98%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_hooks.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_statuses.go (96%) rename vendor/github.com/google/go-github/{v20 => v21}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/search.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/teams.go (74%) rename vendor/github.com/google/go-github/{v20 => v21}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v20 => v21}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index f097035a5e..05bf423024 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index cff1909825..ae4e076926 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index b2308433a2..18bb994486 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index d6e229ccaf..ef6f1ec024 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 8a2e5ff699..98be349c5e 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index 7011cc7283..3c33477001 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index ac3dfe3920..0b6435a524 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 518c26001a..1449b25538 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index ed6d533433..8f1605b4aa 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 49ba403cd0..d86e35b68a 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index 9580cf492a..b0c3d2d4d1 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index b7ac00eb83..a1c785c519 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index b53bbdc4ce..f36401ec37 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index e3b23adb28..2445a65d0a 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 8c4995dafd..8eaee20683 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index d4a2c418ce..87ef05411d 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index 4d34270ebd..4486271a56 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index ea23ad0c6e..cdac7f8452 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 9dbd8d2fdb..79d09970b8 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index 59d6bb697d..e376b44766 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 3e61419372..39bbe1f48a 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index a2dbf7ecad..955f94414b 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index 93b33d83e8..21f9723519 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 497655849b..6bc7f3969e 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index dbdda2a99b..a709caa1c1 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 0f6d53a47e..bf19602c61 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index ad57bdc5a5..c1e7a0920b 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index e9f3b14c82..c8cc781438 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index 5ff9ac72e0..d2ec0946d5 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 3489f097a1..9e8a839d75 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index ab7ed2228b..97fd879153 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 2d1a184808..288cff8a63 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index 932a33072f..301b6e030f 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/transport.go b/github/transport.go index 070a78da79..01dfafbca6 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 946f0b9380..dba4ab5082 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 0f1f4a921d..fe53abb9b2 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v20/github" + "github.com/google/go-github/v21/github" ) const ( diff --git a/go.mod b/go.mod index a5ff9ee442..d148b035be 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v20 v20.0.0 + github.com/google/go-github/v21 v21.0.1 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 66bcb70dbc..81cd7e09dd 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v20 v20.0.0 h1:Ffvfyn3+lnxI1BtP4xcxV0S6TrCh6L1IUv5bN4GWsNA= -github.com/google/go-github/v20 v20.0.0/go.mod h1:IRYtAIrijh8T1S+AlIsVlBt3/GT4sAT110wzAVCzevM= +github.com/google/go-github/v21 v21.0.1 h1:2pLOj+rs4UtoZmk5didluF5zZ6Z0kfs0z1FLa/j+4b8= +github.com/google/go-github/v21 v21.0.1/go.mod h1:RNbKQQDOg+lBuuu5l/v0joCrygzKEexxDEwaleXEHxA= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= diff --git a/vendor/github.com/google/go-github/v20/AUTHORS b/vendor/github.com/google/go-github/v21/AUTHORS similarity index 97% rename from vendor/github.com/google/go-github/v20/AUTHORS rename to vendor/github.com/google/go-github/v21/AUTHORS index 8d04ae7ce0..1f6dac5851 100644 --- a/vendor/github.com/google/go-github/v20/AUTHORS +++ b/vendor/github.com/google/go-github/v21/AUTHORS @@ -76,6 +76,7 @@ Eli Uriegas Elliott Beach Emerson Wood eperm +Erick Fejta erwinvaneyk Fabrice Filippo Valsorda @@ -122,6 +123,7 @@ Jusung Lee jzhoucliqr Katrina Owen Kautilya Tripathi < tripathi.kautilya@gmail.com> +Kautilya Tripathi Keita Urashima Kevin Burke Konrad Malawski @@ -129,6 +131,7 @@ Kookheon Kwon Krzysztof Kowalczyk Kshitij Saraogi kyokomi +Lovro Mažgon Lucas Alcantara Luke Evers Luke Kysow @@ -178,6 +181,7 @@ Rob Figueiredo Rohit Upadhyay Ronak Jain Ruben Vereecken +Ryan Leung Ryan Lower Sahil Dua saisi @@ -196,6 +200,7 @@ Shawn Catanzarite Shawn Smith sona-tar SoundCloud, Ltd. +Sridhar Mocherla Stian Eikeland Tasya Aditya Rukmana Thomas Bruyelle @@ -206,6 +211,7 @@ Varadarajan Aravamudhan Victor Castell Victor Vrantchan Vlad Ungureanu +Wasim Thabraze Will Maier William Bailey xibz diff --git a/vendor/github.com/google/go-github/v20/LICENSE b/vendor/github.com/google/go-github/v21/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v20/LICENSE rename to vendor/github.com/google/go-github/v21/LICENSE diff --git a/vendor/github.com/google/go-github/v20/github/activity.go b/vendor/github.com/google/go-github/v21/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/activity.go rename to vendor/github.com/google/go-github/v21/github/activity.go diff --git a/vendor/github.com/google/go-github/v20/github/activity_events.go b/vendor/github.com/google/go-github/v21/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/activity_events.go rename to vendor/github.com/google/go-github/v21/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v20/github/activity_notifications.go b/vendor/github.com/google/go-github/v21/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/activity_notifications.go rename to vendor/github.com/google/go-github/v21/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v20/github/activity_star.go b/vendor/github.com/google/go-github/v21/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/activity_star.go rename to vendor/github.com/google/go-github/v21/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v20/github/activity_watching.go b/vendor/github.com/google/go-github/v21/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/activity_watching.go rename to vendor/github.com/google/go-github/v21/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v20/github/admin.go b/vendor/github.com/google/go-github/v21/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/admin.go rename to vendor/github.com/google/go-github/v21/github/admin.go diff --git a/vendor/github.com/google/go-github/v20/github/admin_stats.go b/vendor/github.com/google/go-github/v21/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/admin_stats.go rename to vendor/github.com/google/go-github/v21/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v20/github/apps.go b/vendor/github.com/google/go-github/v21/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/apps.go rename to vendor/github.com/google/go-github/v21/github/apps.go diff --git a/vendor/github.com/google/go-github/v20/github/apps_installation.go b/vendor/github.com/google/go-github/v21/github/apps_installation.go similarity index 92% rename from vendor/github.com/google/go-github/v20/github/apps_installation.go rename to vendor/github.com/google/go-github/v21/github/apps_installation.go index ccfecb8d89..09d4043fe6 100644 --- a/vendor/github.com/google/go-github/v20/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v21/github/apps_installation.go @@ -72,11 +72,12 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opt *ListOpti // // GitHub API docs: https://developer.github.com/v3/apps/installations/#add-repository-to-installation func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { - u := fmt.Sprintf("apps/installations/%v/repositories/%v", instID, repoID) + u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) if err != nil { return nil, nil, err } + req.Header.Set("Accept", mediaTypeIntegrationPreview) r := new(Repository) resp, err := s.client.Do(ctx, req, r) @@ -91,11 +92,12 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // // GitHub docs: https://developer.github.com/v3/apps/installations/#remove-repository-from-installation func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { - u := fmt.Sprintf("apps/installations/%v/repositories/%v", instID, repoID) + u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err } + req.Header.Set("Accept", mediaTypeIntegrationPreview) return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v20/github/apps_marketplace.go b/vendor/github.com/google/go-github/v21/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v21/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v20/github/authorizations.go b/vendor/github.com/google/go-github/v21/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/authorizations.go rename to vendor/github.com/google/go-github/v21/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v20/github/checks.go b/vendor/github.com/google/go-github/v21/github/checks.go similarity index 99% rename from vendor/github.com/google/go-github/v20/github/checks.go rename to vendor/github.com/google/go-github/v21/github/checks.go index f27d40d4d3..8aaed8a56a 100644 --- a/vendor/github.com/google/go-github/v20/github/checks.go +++ b/vendor/github.com/google/go-github/v21/github/checks.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ChecksService provides access to the Checks API in the @@ -255,7 +256,7 @@ type ListCheckRunsResults struct { // // GitHub API docs: https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opt *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, url.QueryEscape(ref)) u, err := addOptions(u, opt) if err != nil { return nil, nil, err @@ -321,7 +322,7 @@ type ListCheckSuiteResults struct { // // GitHub API docs: https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opt *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, url.QueryEscape(ref)) u, err := addOptions(u, opt) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v20/github/doc.go b/vendor/github.com/google/go-github/v21/github/doc.go similarity index 97% rename from vendor/github.com/google/go-github/v20/github/doc.go rename to vendor/github.com/google/go-github/v21/github/doc.go index 96445d2648..165d63e266 100644 --- a/vendor/github.com/google/go-github/v20/github/doc.go +++ b/vendor/github.com/google/go-github/v21/github/doc.go @@ -8,7 +8,8 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/github" + import "github.com/google/go-github/v21/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to access different parts of the GitHub API. For example: diff --git a/vendor/github.com/google/go-github/v20/github/event.go b/vendor/github.com/google/go-github/v21/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/event.go rename to vendor/github.com/google/go-github/v21/github/event.go diff --git a/vendor/github.com/google/go-github/v20/github/event_types.go b/vendor/github.com/google/go-github/v21/github/event_types.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/event_types.go rename to vendor/github.com/google/go-github/v21/github/event_types.go diff --git a/vendor/github.com/google/go-github/v20/github/gen-accessors.go b/vendor/github.com/google/go-github/v21/github/gen-accessors.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/gen-accessors.go rename to vendor/github.com/google/go-github/v21/github/gen-accessors.go diff --git a/vendor/github.com/google/go-github/v20/github/gists.go b/vendor/github.com/google/go-github/v21/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/gists.go rename to vendor/github.com/google/go-github/v21/github/gists.go diff --git a/vendor/github.com/google/go-github/v20/github/gists_comments.go b/vendor/github.com/google/go-github/v21/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/gists_comments.go rename to vendor/github.com/google/go-github/v21/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v20/github/git.go b/vendor/github.com/google/go-github/v21/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/git.go rename to vendor/github.com/google/go-github/v21/github/git.go diff --git a/vendor/github.com/google/go-github/v20/github/git_blobs.go b/vendor/github.com/google/go-github/v21/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/git_blobs.go rename to vendor/github.com/google/go-github/v21/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v20/github/git_commits.go b/vendor/github.com/google/go-github/v21/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/git_commits.go rename to vendor/github.com/google/go-github/v21/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v20/github/git_refs.go b/vendor/github.com/google/go-github/v21/github/git_refs.go similarity index 96% rename from vendor/github.com/google/go-github/v20/github/git_refs.go rename to vendor/github.com/google/go-github/v21/github/git_refs.go index 3b2ced2333..3f381d5f2b 100644 --- a/vendor/github.com/google/go-github/v20/github/git_refs.go +++ b/vendor/github.com/google/go-github/v21/github/git_refs.go @@ -10,6 +10,7 @@ import ( "encoding/json" "errors" "fmt" + "net/url" "strings" ) @@ -57,7 +58,7 @@ type updateRefRequest struct { // GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -88,7 +89,7 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref // GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref string) ([]*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -208,7 +209,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // GitHub API docs: https://developer.github.com/v3/git/refs/#delete-a-reference func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err diff --git a/vendor/github.com/google/go-github/v20/github/git_tags.go b/vendor/github.com/google/go-github/v21/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/git_tags.go rename to vendor/github.com/google/go-github/v21/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v20/github/git_trees.go b/vendor/github.com/google/go-github/v21/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/git_trees.go rename to vendor/github.com/google/go-github/v21/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v20/github/github-accessors.go b/vendor/github.com/google/go-github/v21/github/github-accessors.go similarity index 99% rename from vendor/github.com/google/go-github/v20/github/github-accessors.go rename to vendor/github.com/google/go-github/v21/github/github-accessors.go index 1c461b557c..658cad2a26 100644 --- a/vendor/github.com/google/go-github/v20/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v21/github/github-accessors.go @@ -3612,6 +3612,30 @@ func (i *InstallationToken) GetToken() string { return *i.Token } +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (i *InteractionRestriction) GetExpiresAt() Timestamp { + if i == nil || i.ExpiresAt == nil { + return Timestamp{} + } + return *i.ExpiresAt +} + +// GetLimit returns the Limit field if it's non-nil, zero value otherwise. +func (i *InteractionRestriction) GetLimit() string { + if i == nil || i.Limit == nil { + return "" + } + return *i.Limit +} + +// GetOrigin returns the Origin field if it's non-nil, zero value otherwise. +func (i *InteractionRestriction) GetOrigin() string { + if i == nil || i.Origin == nil { + return "" + } + return *i.Origin +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (i *Invitation) GetCreatedAt() time.Time { if i == nil || i.CreatedAt == nil { @@ -4692,6 +4716,14 @@ func (l *ListCheckSuiteResults) GetTotal() int { return *l.Total } +// GetAffiliation returns the Affiliation field if it's non-nil, zero value otherwise. +func (l *ListCollaboratorOptions) GetAffiliation() string { + if l == nil || l.Affiliation == nil { + return "" + } + return *l.Affiliation +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -6532,6 +6564,14 @@ func (p *ProjectCard) GetColumnID() int64 { return *p.ColumnID } +// GetColumnName returns the ColumnName field if it's non-nil, zero value otherwise. +func (p *ProjectCard) GetColumnName() string { + if p == nil || p.ColumnName == nil { + return "" + } + return *p.ColumnName +} + // GetColumnURL returns the ColumnURL field if it's non-nil, zero value otherwise. func (p *ProjectCard) GetColumnURL() string { if p == nil || p.ColumnURL == nil { @@ -6588,6 +6628,30 @@ func (p *ProjectCard) GetNote() string { return *p.Note } +// GetPreviousColumnName returns the PreviousColumnName field if it's non-nil, zero value otherwise. +func (p *ProjectCard) GetPreviousColumnName() string { + if p == nil || p.PreviousColumnName == nil { + return "" + } + return *p.PreviousColumnName +} + +// GetProjectID returns the ProjectID field if it's non-nil, zero value otherwise. +func (p *ProjectCard) GetProjectID() int64 { + if p == nil || p.ProjectID == nil { + return 0 + } + return *p.ProjectID +} + +// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. +func (p *ProjectCard) GetProjectURL() string { + if p == nil || p.ProjectURL == nil { + return "" + } + return *p.ProjectURL +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *ProjectCard) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -6684,6 +6748,14 @@ func (p *ProjectCardOptions) GetArchived() bool { return *p.Archived } +// GetPermission returns the Permission field if it's non-nil, zero value otherwise. +func (p *ProjectCollaboratorOptions) GetPermission() string { + if p == nil || p.Permission == nil { + return "" + } + return *p.Permission +} + // GetCardsURL returns the CardsURL field if it's non-nil, zero value otherwise. func (p *ProjectColumn) GetCardsURL() string { if p == nil || p.CardsURL == nil { @@ -6908,6 +6980,22 @@ func (p *ProjectOptions) GetState() string { return *p.State } +// GetPermission returns the Permission field if it's non-nil, zero value otherwise. +func (p *ProjectPermissionLevel) GetPermission() string { + if p == nil || p.Permission == nil { + return "" + } + return *p.Permission +} + +// GetUser returns the User field. +func (p *ProjectPermissionLevel) GetUser() *User { + if p == nil { + return nil + } + return p.User +} + // GetEnforceAdmins returns the EnforceAdmins field. func (p *Protection) GetEnforceAdmins() *AdminEnforcement { if p == nil { @@ -11044,6 +11132,14 @@ func (t *TeamLDAPMapping) GetURL() string { return *t.URL } +// GetPermission returns the Permission field if it's non-nil, zero value otherwise. +func (t *TeamProjectOptions) GetPermission() string { + if t == nil || t.Permission == nil { + return "" + } + return *t.Permission +} + // GetFragment returns the Fragment field if it's non-nil, zero value otherwise. func (t *TextMatch) GetFragment() string { if t == nil || t.Fragment == nil { @@ -11148,6 +11244,14 @@ func (t *Timeline) GetMilestone() *Milestone { return t.Milestone } +// GetProjectCard returns the ProjectCard field. +func (t *Timeline) GetProjectCard() *ProjectCard { + if t == nil { + return nil + } + return t.ProjectCard +} + // GetRename returns the Rename field. func (t *Timeline) GetRename() *Rename { if t == nil { diff --git a/vendor/github.com/google/go-github/v20/github/github.go b/vendor/github.com/google/go-github/v21/github/github.go similarity index 99% rename from vendor/github.com/google/go-github/v20/github/github.go rename to vendor/github.com/google/go-github/v21/github/github.go index 19ffecc7d2..abed36dd9b 100644 --- a/vendor/github.com/google/go-github/v20/github/github.go +++ b/vendor/github.com/google/go-github/v21/github/github.go @@ -125,6 +125,9 @@ const ( // https://developer.github.com/changes/2018-09-05-project-card-events/ mediaTypeProjectCardDetailsPreview = "application/vnd.github.starfox-preview+json" + + // https://developer.github.com/changes/2018-12-18-interactions-preview/ + mediaTypeInteractionRestrictionsPreview = "application/vnd.github.sombra-preview+json" ) // A Client manages communication with the GitHub API. @@ -157,6 +160,7 @@ type Client struct { Gists *GistsService Git *GitService Gitignores *GitignoresService + Interactions *InteractionsService Issues *IssuesService Licenses *LicensesService Marketplace *MarketplaceService @@ -249,6 +253,7 @@ func NewClient(httpClient *http.Client) *Client { c.Gists = (*GistsService)(&c.common) c.Git = (*GitService)(&c.common) c.Gitignores = (*GitignoresService)(&c.common) + c.Interactions = (*InteractionsService)(&c.common) c.Issues = (*IssuesService)(&c.common) c.Licenses = (*LicensesService)(&c.common) c.Marketplace = &MarketplaceService{client: c} diff --git a/vendor/github.com/google/go-github/v20/github/gitignore.go b/vendor/github.com/google/go-github/v21/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/gitignore.go rename to vendor/github.com/google/go-github/v21/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v21/github/interactions.go b/vendor/github.com/google/go-github/v21/github/interactions.go new file mode 100644 index 0000000000..b9965491db --- /dev/null +++ b/vendor/github.com/google/go-github/v21/github/interactions.go @@ -0,0 +1,28 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +// InteractionsService handles communication with the repository and organization related +// methods of the GitHub API. +// +// GitHub API docs: https://developer.github.com/v3/interactions/ +type InteractionsService service + +// InteractionRestriction represents the interaction restrictions for repository and organization. +type InteractionRestriction struct { + // Specifies the group of GitHub users who can + // comment, open issues, or create pull requests for the given repository. + // Possible values are: "existing_users", "contributors_only" and "collaborators_only". + Limit *string `json:"limit,omitempty"` + + // Origin specifies the type of the resource to interact with. + // Possible values are: "repository" and "organization". + Origin *string `json:"origin,omitempty"` + + // ExpiresAt specifies the time after which the interaction restrictions expire. + // The default expiry time is 24 hours from the time restriction is created. + ExpiresAt *Timestamp `json:"expires_at,omitempty"` +} diff --git a/vendor/github.com/google/go-github/v21/github/interactions_orgs.go b/vendor/github.com/google/go-github/v21/github/interactions_orgs.go new file mode 100644 index 0000000000..af25f6567d --- /dev/null +++ b/vendor/github.com/google/go-github/v21/github/interactions_orgs.go @@ -0,0 +1,80 @@ +// Copyright 2019 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetRestrictionsForOrg fetches the interaction restrictions for an organization. +// +// GitHub API docs: https://developer.github.com/v3/interactions/orgs/#get-interaction-restrictions-for-an-organization +func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { + u := fmt.Sprintf("orgs/%v/interaction-limits", organization) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + organizationInteractions := new(InteractionRestriction) + + resp, err := s.client.Do(ctx, req, organizationInteractions) + if err != nil { + return nil, resp, err + } + + return organizationInteractions, resp, nil +} + +// UpdateRestrictionsForOrg adds or updates the interaction restrictions for an organization. +// +// limit specifies the group of GitHub users who can comment, open issues, or create pull requests +// in public repositories for the given organization. +// Possible values are: "existing_users", "contributors_only", "collaborators_only". +// +// GitHub API docs: https://developer.github.com/v3/interactions/orgs/#add-or-update-interaction-restrictions-for-an-organization +func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { + u := fmt.Sprintf("orgs/%v/interaction-limits", organization) + + interaction := &InteractionRestriction{Limit: String(limit)} + + req, err := s.client.NewRequest("PUT", u, interaction) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + organizationInteractions := new(InteractionRestriction) + + resp, err := s.client.Do(ctx, req, organizationInteractions) + if err != nil { + return nil, resp, err + } + + return organizationInteractions, resp, nil +} + +// RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. +// +// GitHub API docs: https://developer.github.com/v3/interactions/orgs/#remove-interaction-restrictions-for-an-organization +func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/interaction-limits", organization) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v21/github/interactions_repos.go b/vendor/github.com/google/go-github/v21/github/interactions_repos.go new file mode 100644 index 0000000000..58234822fd --- /dev/null +++ b/vendor/github.com/google/go-github/v21/github/interactions_repos.go @@ -0,0 +1,80 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetRestrictionsForRepo fetches the interaction restrictions for a repository. +// +// GitHub API docs: https://developer.github.com/v3/interactions/repos/#get-interaction-restrictions-for-a-repository +func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + repositoryInteractions := new(InteractionRestriction) + + resp, err := s.client.Do(ctx, req, repositoryInteractions) + if err != nil { + return nil, resp, err + } + + return repositoryInteractions, resp, nil +} + +// UpdateRestrictionsForRepo adds or updates the interaction restrictions for a repository. +// +// limit specifies the group of GitHub users who can comment, open issues, or create pull requests +// for the given repository. +// Possible values are: "existing_users", "contributors_only", "collaborators_only". +// +// GitHub API docs: https://developer.github.com/v3/interactions/repos/#add-or-update-interaction-restrictions-for-a-repository +func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) + + interaction := &InteractionRestriction{Limit: String(limit)} + + req, err := s.client.NewRequest("PUT", u, interaction) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + repositoryInteractions := new(InteractionRestriction) + + resp, err := s.client.Do(ctx, req, repositoryInteractions) + if err != nil { + return nil, resp, err + } + + return repositoryInteractions, resp, nil +} + +// RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. +// +// GitHub API docs: https://developer.github.com/v3/interactions/repos/#remove-interaction-restrictions-for-a-repository +func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v20/github/issues.go b/vendor/github.com/google/go-github/v21/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues.go rename to vendor/github.com/google/go-github/v21/github/issues.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_assignees.go b/vendor/github.com/google/go-github/v21/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues_assignees.go rename to vendor/github.com/google/go-github/v21/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_comments.go b/vendor/github.com/google/go-github/v21/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues_comments.go rename to vendor/github.com/google/go-github/v21/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_events.go b/vendor/github.com/google/go-github/v21/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues_events.go rename to vendor/github.com/google/go-github/v21/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_labels.go b/vendor/github.com/google/go-github/v21/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues_labels.go rename to vendor/github.com/google/go-github/v21/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_milestones.go b/vendor/github.com/google/go-github/v21/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/issues_milestones.go rename to vendor/github.com/google/go-github/v21/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v20/github/issues_timeline.go b/vendor/github.com/google/go-github/v21/github/issues_timeline.go similarity index 94% rename from vendor/github.com/google/go-github/v20/github/issues_timeline.go rename to vendor/github.com/google/go-github/v21/github/issues_timeline.go index 9cfda83202..5987bd06aa 100644 --- a/vendor/github.com/google/go-github/v20/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v21/github/issues_timeline.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "strings" "time" ) @@ -115,7 +116,8 @@ type Timeline struct { Source *Source `json:"source,omitempty"` // An object containing rename details including 'from' and 'to' attributes. // Only provided for 'renamed' events. - Rename *Rename `json:"rename,omitempty"` + Rename *Rename `json:"rename,omitempty"` + ProjectCard *ProjectCard `json:"project_card,omitempty"` } // Source represents a reference's source. @@ -141,7 +143,8 @@ func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo strin } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeTimelinePreview) + acceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var events []*Timeline resp, err := s.client.Do(ctx, req, &events) diff --git a/vendor/github.com/google/go-github/v20/github/licenses.go b/vendor/github.com/google/go-github/v21/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/licenses.go rename to vendor/github.com/google/go-github/v21/github/licenses.go diff --git a/vendor/github.com/google/go-github/v20/github/messages.go b/vendor/github.com/google/go-github/v21/github/messages.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/messages.go rename to vendor/github.com/google/go-github/v21/github/messages.go diff --git a/vendor/github.com/google/go-github/v20/github/migrations.go b/vendor/github.com/google/go-github/v21/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/migrations.go rename to vendor/github.com/google/go-github/v21/github/migrations.go diff --git a/vendor/github.com/google/go-github/v20/github/migrations_source_import.go b/vendor/github.com/google/go-github/v21/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v21/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v20/github/migrations_user.go b/vendor/github.com/google/go-github/v21/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/migrations_user.go rename to vendor/github.com/google/go-github/v21/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v20/github/misc.go b/vendor/github.com/google/go-github/v21/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/misc.go rename to vendor/github.com/google/go-github/v21/github/misc.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs.go b/vendor/github.com/google/go-github/v21/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs.go rename to vendor/github.com/google/go-github/v21/github/orgs.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs_hooks.go b/vendor/github.com/google/go-github/v21/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v21/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs_members.go b/vendor/github.com/google/go-github/v21/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs_members.go rename to vendor/github.com/google/go-github/v21/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v21/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v21/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs_projects.go b/vendor/github.com/google/go-github/v21/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs_projects.go rename to vendor/github.com/google/go-github/v21/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v20/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v21/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v21/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v20/github/projects.go b/vendor/github.com/google/go-github/v21/github/projects.go similarity index 74% rename from vendor/github.com/google/go-github/v20/github/projects.go rename to vendor/github.com/google/go-github/v21/github/projects.go index 210e3b5c3b..c7a68f53d9 100644 --- a/vendor/github.com/google/go-github/v20/github/projects.go +++ b/vendor/github.com/google/go-github/v21/github/projects.go @@ -296,6 +296,12 @@ type ProjectCard struct { // The following fields are only populated by Webhook events. ColumnID *int64 `json:"column_id,omitempty"` + + // The following fields are only populated by Events API. + ProjectID *int64 `json:"project_id,omitempty"` + ProjectURL *string `json:"project_url,omitempty"` + ColumnName *string `json:"column_name,omitempty"` + PreviousColumnName *string `json:"previous_column_name,omitempty"` // Populated in "moved_columns_in_project" event deliveries. } // ProjectCardListOptions specifies the optional parameters to the @@ -460,3 +466,129 @@ func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opt return s.client.Do(ctx, req, nil) } + +// ProjectCollaboratorOptions specifies the optional parameters to the +// ProjectsService.AddProjectCollaborator method. +type ProjectCollaboratorOptions struct { + // Permission specifies the permission to grant to the collaborator. + // Possible values are: + // "read" - can read, but not write to or administer this project. + // "write" - can read and write, but not administer this project. + // "admin" - can read, write and administer this project. + // + // Default value is "write" + Permission *string `json:"permission,omitempty"` +} + +// AddProjectCollaborator adds a collaborator to an organization project and sets +// their permission level. You must be an organization owner or a project admin to add a collaborator. +// +// GitHub API docs: https://developer.github.com/v3/projects/collaborators/#add-user-as-a-collaborator +func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opt *ProjectCollaboratorOptions) (*Response, error) { + u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeProjectsPreview) + + return s.client.Do(ctx, req, nil) +} + +// RemoveProjectCollaborator removes a collaborator from an organization project. +// You must be an organization owner or a project admin to remove a collaborator. +// +// GitHub API docs: https://developer.github.com/v3/projects/collaborators/#remove-user-as-a-collaborator +func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { + u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeProjectsPreview) + + return s.client.Do(ctx, req, nil) +} + +// ListCollaboratorOptions specifies the optional parameters to the +// ProjectsService.ListProjectCollaborators method. +type ListCollaboratorOptions struct { + // Affiliation specifies how collaborators should be filtered by their affiliation. + // Possible values are: + // "outside" - All outside collaborators of an organization-owned repository + // "direct" - All collaborators with permissions to an organization-owned repository, + // regardless of organization membership status + // "all" - All collaborators the authenticated user can see + // + // Default value is "all". + Affiliation *string `url:"affiliation,omitempty"` + + ListOptions +} + +// ListProjectCollaborators lists the collaborators for an organization project. For a project, +// the list of collaborators includes outside collaborators, organization members that are direct +// collaborators, organization members with access through team memberships, organization members +// with access through default organization permissions, and organization owners. You must be an +// organization owner or a project admin to list collaborators. +// +// GitHub API docs: https://developer.github.com/v3/projects/collaborators/#list-collaborators +func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opt *ListCollaboratorOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("projects/%v/collaborators", id) + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeProjectsPreview) + + var users []*User + resp, err := s.client.Do(ctx, req, &users) + if err != nil { + return nil, resp, err + } + + return users, resp, nil +} + +// ProjectPermissionLevel represents the permission level an organization +// member has for a given project. +type ProjectPermissionLevel struct { + // Possible values: "admin", "write", "read", "none" + Permission *string `json:"permission,omitempty"` + + User *User `json:"user,omitempty"` +} + +// ReviewProjectCollaboratorPermission returns the collaborator's permission level for an organization +// project. Possible values for the permission key: "admin", "write", "read", "none". +// You must be an organization owner or a project admin to review a user's permission level. +// +// GitHub API docs: https://developer.github.com/v3/projects/collaborators/#review-a-users-permission-level +func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { + u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeProjectsPreview) + + ppl := new(ProjectPermissionLevel) + resp, err := s.client.Do(ctx, req, ppl) + if err != nil { + return nil, resp, err + } + return ppl, resp, nil +} diff --git a/vendor/github.com/google/go-github/v20/github/pulls.go b/vendor/github.com/google/go-github/v21/github/pulls.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/pulls.go rename to vendor/github.com/google/go-github/v21/github/pulls.go diff --git a/vendor/github.com/google/go-github/v20/github/pulls_comments.go b/vendor/github.com/google/go-github/v21/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/pulls_comments.go rename to vendor/github.com/google/go-github/v21/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v20/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v21/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v21/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v20/github/pulls_reviews.go b/vendor/github.com/google/go-github/v21/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v21/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v20/github/reactions.go b/vendor/github.com/google/go-github/v21/github/reactions.go similarity index 99% rename from vendor/github.com/google/go-github/v20/github/reactions.go rename to vendor/github.com/google/go-github/v21/github/reactions.go index ddc055cb1b..0865f8cdca 100644 --- a/vendor/github.com/google/go-github/v20/github/reactions.go +++ b/vendor/github.com/google/go-github/v21/github/reactions.go @@ -329,7 +329,9 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex var m []*Reaction resp, err := s.client.Do(ctx, req, &m) - + if err != nil { + return nil, nil, err + } return m, resp, nil } diff --git a/vendor/github.com/google/go-github/v20/github/repos.go b/vendor/github.com/google/go-github/v21/github/repos.go similarity index 99% rename from vendor/github.com/google/go-github/v20/github/repos.go rename to vendor/github.com/google/go-github/v21/github/repos.go index d09b5cc87e..617c20db54 100644 --- a/vendor/github.com/google/go-github/v20/github/repos.go +++ b/vendor/github.com/google/go-github/v21/github/repos.go @@ -179,7 +179,7 @@ func (s *RepositoriesService) List(ctx context.Context, user string, opt *Reposi } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview} + acceptHeaders := []string{mediaTypeTopicsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*Repository @@ -217,7 +217,7 @@ func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opt *Re } // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview} + acceptHeaders := []string{mediaTypeTopicsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*Repository diff --git a/vendor/github.com/google/go-github/v20/github/repos_collaborators.go b/vendor/github.com/google/go-github/v21/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v21/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_comments.go b/vendor/github.com/google/go-github/v21/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_comments.go rename to vendor/github.com/google/go-github/v21/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_commits.go b/vendor/github.com/google/go-github/v21/github/repos_commits.go similarity index 98% rename from vendor/github.com/google/go-github/v20/github/repos_commits.go rename to vendor/github.com/google/go-github/v21/github/repos_commits.go index 0dcfe62cb4..a4c6215968 100644 --- a/vendor/github.com/google/go-github/v20/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v21/github/repos_commits.go @@ -9,6 +9,7 @@ import ( "bytes" "context" "fmt" + "net/url" "time" ) @@ -189,7 +190,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // // GitHub API docs: https://developer.github.com/v3/repos/commits/#get-the-sha-1-of-a-commit-reference func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, url.QueryEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v20/github/repos_community_health.go b/vendor/github.com/google/go-github/v21/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_community_health.go rename to vendor/github.com/google/go-github/v21/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_contents.go b/vendor/github.com/google/go-github/v21/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_contents.go rename to vendor/github.com/google/go-github/v21/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_deployments.go b/vendor/github.com/google/go-github/v21/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_deployments.go rename to vendor/github.com/google/go-github/v21/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_forks.go b/vendor/github.com/google/go-github/v21/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_forks.go rename to vendor/github.com/google/go-github/v21/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_hooks.go b/vendor/github.com/google/go-github/v21/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_hooks.go rename to vendor/github.com/google/go-github/v21/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_invitations.go b/vendor/github.com/google/go-github/v21/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_invitations.go rename to vendor/github.com/google/go-github/v21/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_keys.go b/vendor/github.com/google/go-github/v21/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_keys.go rename to vendor/github.com/google/go-github/v21/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_merging.go b/vendor/github.com/google/go-github/v21/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_merging.go rename to vendor/github.com/google/go-github/v21/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_pages.go b/vendor/github.com/google/go-github/v21/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_pages.go rename to vendor/github.com/google/go-github/v21/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v21/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v21/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_projects.go b/vendor/github.com/google/go-github/v21/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_projects.go rename to vendor/github.com/google/go-github/v21/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_releases.go b/vendor/github.com/google/go-github/v21/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_releases.go rename to vendor/github.com/google/go-github/v21/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_stats.go b/vendor/github.com/google/go-github/v21/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_stats.go rename to vendor/github.com/google/go-github/v21/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v20/github/repos_statuses.go b/vendor/github.com/google/go-github/v21/github/repos_statuses.go similarity index 96% rename from vendor/github.com/google/go-github/v20/github/repos_statuses.go rename to vendor/github.com/google/go-github/v21/github/repos_statuses.go index f94fdc858b..c889b31dd7 100644 --- a/vendor/github.com/google/go-github/v20/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v21/github/repos_statuses.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" "time" ) @@ -44,7 +45,7 @@ func (r RepoStatus) String() string { // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, url.QueryEscape(ref)) u, err := addOptions(u, opt) if err != nil { return nil, nil, err @@ -69,7 +70,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#create-a-status func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, url.QueryEscape(ref)) req, err := s.client.NewRequest("POST", u, status) if err != nil { return nil, nil, err @@ -108,7 +109,7 @@ func (s CombinedStatus) String() string { // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, ref) + u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, url.QueryEscape(ref)) u, err := addOptions(u, opt) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v20/github/repos_traffic.go b/vendor/github.com/google/go-github/v21/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/repos_traffic.go rename to vendor/github.com/google/go-github/v21/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v20/github/search.go b/vendor/github.com/google/go-github/v21/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/search.go rename to vendor/github.com/google/go-github/v21/github/search.go diff --git a/vendor/github.com/google/go-github/v20/github/strings.go b/vendor/github.com/google/go-github/v21/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/strings.go rename to vendor/github.com/google/go-github/v21/github/strings.go diff --git a/vendor/github.com/google/go-github/v20/github/teams.go b/vendor/github.com/google/go-github/v21/github/teams.go similarity index 74% rename from vendor/github.com/google/go-github/v20/github/teams.go rename to vendor/github.com/google/go-github/v21/github/teams.go index c3773e00e3..97d038d9b5 100644 --- a/vendor/github.com/google/go-github/v20/github/teams.go +++ b/vendor/github.com/google/go-github/v21/github/teams.go @@ -355,3 +355,103 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opt *ListOptions) ([]* return teams, resp, nil } + +// ListTeamProjects lists the organization projects for a team. +// +// GitHub API docs: https://developer.github.com/v3/teams/#list-team-projects +func (s *TeamsService) ListTeamProjects(ctx context.Context, teamID int64) ([]*Project, *Response, error) { + u := fmt.Sprintf("teams/%v/projects", teamID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeNestedTeamsPreview, mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + + var projects []*Project + resp, err := s.client.Do(ctx, req, &projects) + if err != nil { + return nil, resp, err + } + + return projects, resp, nil +} + +// ReviewTeamProjects checks whether a team has read, write, or admin +// permissions for an organization project. +// +// GitHub API docs: https://developer.github.com/v3/teams/#review-a-team-project +func (s *TeamsService) ReviewTeamProjects(ctx context.Context, teamID, projectID int64) (*Project, *Response, error) { + u := fmt.Sprintf("teams/%v/projects/%v", teamID, projectID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeNestedTeamsPreview, mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + + projects := &Project{} + resp, err := s.client.Do(ctx, req, &projects) + if err != nil { + return nil, resp, err + } + + return projects, resp, nil +} + +// TeamProjectOptions specifies the optional parameters to the +// TeamsService.AddTeamProject method. +type TeamProjectOptions struct { + // Permission specifies the permission to grant to the team for this project. + // Possible values are: + // "read" - team members can read, but not write to or administer this project. + // "write" - team members can read and write, but not administer this project. + // "admin" - team members can read, write and administer this project. + // + Permission *string `json:"permission,omitempty"` +} + +// AddTeamProject adds an organization project to a team. To add a project to a team or +// update the team's permission on a project, the authenticated user must have admin +// permissions for the project. +// +// GitHub API docs: https://developer.github.com/v3/teams/#add-or-update-team-project +func (s *TeamsService) AddTeamProject(ctx context.Context, teamID, projectID int64, opt *TeamProjectOptions) (*Response, error) { + u := fmt.Sprintf("teams/%v/projects/%v", teamID, projectID) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeNestedTeamsPreview, mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + + return s.client.Do(ctx, req, nil) +} + +// RemoveTeamProject removes an organization project from a team. An organization owner or +// a team maintainer can remove any project from the team. To remove a project from a team +// as an organization member, the authenticated user must have "read" access to both the team +// and project, or "admin" access to the team or project. +// Note: This endpoint removes the project from the team, but does not delete it. +// +// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-project +func (s *TeamsService) RemoveTeamProject(ctx context.Context, teamID int64, projectID int64) (*Response, error) { + u := fmt.Sprintf("teams/%v/projects/%v", teamID, projectID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeNestedTeamsPreview, mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v20/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v21/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v21/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v20/github/teams_discussions.go b/vendor/github.com/google/go-github/v21/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/teams_discussions.go rename to vendor/github.com/google/go-github/v21/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v20/github/teams_members.go b/vendor/github.com/google/go-github/v21/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/teams_members.go rename to vendor/github.com/google/go-github/v21/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v20/github/timestamp.go b/vendor/github.com/google/go-github/v21/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/timestamp.go rename to vendor/github.com/google/go-github/v21/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v20/github/users.go b/vendor/github.com/google/go-github/v21/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users.go rename to vendor/github.com/google/go-github/v21/github/users.go diff --git a/vendor/github.com/google/go-github/v20/github/users_administration.go b/vendor/github.com/google/go-github/v21/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_administration.go rename to vendor/github.com/google/go-github/v21/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v20/github/users_blocking.go b/vendor/github.com/google/go-github/v21/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_blocking.go rename to vendor/github.com/google/go-github/v21/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v20/github/users_emails.go b/vendor/github.com/google/go-github/v21/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_emails.go rename to vendor/github.com/google/go-github/v21/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v20/github/users_followers.go b/vendor/github.com/google/go-github/v21/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_followers.go rename to vendor/github.com/google/go-github/v21/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v20/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v21/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v21/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v20/github/users_keys.go b/vendor/github.com/google/go-github/v21/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/users_keys.go rename to vendor/github.com/google/go-github/v21/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v20/github/with_appengine.go b/vendor/github.com/google/go-github/v21/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/with_appengine.go rename to vendor/github.com/google/go-github/v21/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v20/github/without_appengine.go b/vendor/github.com/google/go-github/v21/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v20/github/without_appengine.go rename to vendor/github.com/google/go-github/v21/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index f3510f36df..a50114b086 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,8 +54,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v20 v20.0.0 -github.com/google/go-github/v20/github +# github.com/google/go-github/v21 v21.0.1 +github.com/google/go-github/v21/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce From 19c8a5786021b548a5d88de585e5413ffd712924 Mon Sep 17 00:00:00 2001 From: Matt Burgess Date: Tue, 12 Feb 2019 22:22:20 +0000 Subject: [PATCH 8/9] vendor: github.com/google/go-github/github@v24.0.0 Signed-off-by: Trevor Bramwell --- github/config.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- ...source_github_organization_webhook_test.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 2 +- ...resource_github_repository_webhook_test.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../google/go-github/{v21 => v24}/AUTHORS | 7 +++ .../google/go-github/{v21 => v24}/LICENSE | 0 .../go-github/{v21 => v24}/github/activity.go | 0 .../{v21 => v24}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v21 => v24}/github/activity_star.go | 0 .../{v21 => v24}/github/activity_watching.go | 0 .../go-github/{v21 => v24}/github/admin.go | 0 .../{v21 => v24}/github/admin_stats.go | 0 .../go-github/{v21 => v24}/github/apps.go | 0 .../{v21 => v24}/github/apps_installation.go | 0 .../{v21 => v24}/github/apps_marketplace.go | 0 .../{v21 => v24}/github/authorizations.go | 4 +- .../go-github/{v21 => v24}/github/checks.go | 0 .../go-github/{v21 => v24}/github/doc.go | 2 +- .../go-github/{v21 => v24}/github/event.go | 0 .../{v21 => v24}/github/event_types.go | 0 .../{v21 => v24}/github/gen-accessors.go | 0 .../go-github/{v21 => v24}/github/gists.go | 0 .../{v21 => v24}/github/gists_comments.go | 0 .../go-github/{v21 => v24}/github/git.go | 0 .../{v21 => v24}/github/git_blobs.go | 0 .../{v21 => v24}/github/git_commits.go | 4 ++ .../go-github/{v21 => v24}/github/git_refs.go | 0 .../go-github/{v21 => v24}/github/git_tags.go | 0 .../{v21 => v24}/github/git_trees.go | 0 .../{v21 => v24}/github/github-accessors.go | 48 +++++++++++++++++++ .../go-github/{v21 => v24}/github/github.go | 7 ++- .../{v21 => v24}/github/gitignore.go | 0 .../{v21 => v24}/github/interactions.go | 0 .../{v21 => v24}/github/interactions_orgs.go | 0 .../{v21 => v24}/github/interactions_repos.go | 0 .../go-github/{v21 => v24}/github/issues.go | 0 .../{v21 => v24}/github/issues_assignees.go | 0 .../{v21 => v24}/github/issues_comments.go | 0 .../{v21 => v24}/github/issues_events.go | 0 .../{v21 => v24}/github/issues_labels.go | 0 .../{v21 => v24}/github/issues_milestones.go | 0 .../{v21 => v24}/github/issues_timeline.go | 2 + .../go-github/{v21 => v24}/github/licenses.go | 0 .../go-github/{v21 => v24}/github/messages.go | 0 .../{v21 => v24}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v21 => v24}/github/migrations_user.go | 0 .../go-github/{v21 => v24}/github/misc.go | 0 .../go-github/{v21 => v24}/github/orgs.go | 0 .../{v21 => v24}/github/orgs_hooks.go | 0 .../{v21 => v24}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v21 => v24}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v21 => v24}/github/projects.go | 0 .../go-github/{v21 => v24}/github/pulls.go | 6 ++- .../{v21 => v24}/github/pulls_comments.go | 0 .../{v21 => v24}/github/pulls_reviewers.go | 0 .../{v21 => v24}/github/pulls_reviews.go | 0 .../{v21 => v24}/github/reactions.go | 0 .../go-github/{v21 => v24}/github/repos.go | 0 .../github/repos_collaborators.go | 0 .../{v21 => v24}/github/repos_comments.go | 0 .../{v21 => v24}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{v21 => v24}/github/repos_contents.go | 5 +- .../{v21 => v24}/github/repos_deployments.go | 0 .../{v21 => v24}/github/repos_forks.go | 0 .../{v21 => v24}/github/repos_hooks.go | 2 + .../{v21 => v24}/github/repos_invitations.go | 0 .../{v21 => v24}/github/repos_keys.go | 0 .../{v21 => v24}/github/repos_merging.go | 0 .../{v21 => v24}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v21 => v24}/github/repos_projects.go | 0 .../{v21 => v24}/github/repos_releases.go | 4 ++ .../{v21 => v24}/github/repos_stats.go | 0 .../{v21 => v24}/github/repos_statuses.go | 0 .../{v21 => v24}/github/repos_traffic.go | 0 .../go-github/{v21 => v24}/github/search.go | 13 ++--- .../go-github/{v21 => v24}/github/strings.go | 0 .../go-github/{v21 => v24}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v21 => v24}/github/teams_discussions.go | 0 .../{v21 => v24}/github/teams_members.go | 0 .../{v21 => v24}/github/timestamp.go | 0 .../go-github/{v21 => v24}/github/users.go | 0 .../github/users_administration.go | 17 ++++--- .../{v21 => v24}/github/users_blocking.go | 0 .../{v21 => v24}/github/users_emails.go | 0 .../{v21 => v24}/github/users_followers.go | 0 .../{v21 => v24}/github/users_gpg_keys.go | 0 .../{v21 => v24}/github/users_keys.go | 0 .../{v21 => v24}/github/with_appengine.go | 0 .../{v21 => v24}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 131 files changed, 141 insertions(+), 62 deletions(-) rename vendor/github.com/google/go-github/{v21 => v24}/AUTHORS (96%) rename vendor/github.com/google/go-github/{v21 => v24}/LICENSE (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/authorizations.go (98%) rename vendor/github.com/google/go-github/{v21 => v24}/github/checks.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/doc.go (99%) rename vendor/github.com/google/go-github/{v21 => v24}/github/event.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/event_types.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/gen-accessors.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git_commits.go (96%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/github-accessors.go (99%) rename vendor/github.com/google/go-github/{v21 => v24}/github/github.go (99%) rename vendor/github.com/google/go-github/{v21 => v24}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/issues_timeline.go (98%) rename vendor/github.com/google/go-github/{v21 => v24}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/messages.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/pulls.go (98%) rename vendor/github.com/google/go-github/{v21 => v24}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_commits.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_contents.go (97%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_hooks.go (99%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_releases.go (99%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/search.go (96%) rename vendor/github.com/google/go-github/{v21 => v24}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/teams.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_administration.go (64%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v21 => v24}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index 05bf423024..67643e75bf 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index ae4e076926..81595fbcf1 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 18bb994486..6b9a9d037b 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index ef6f1ec024..90b2ec46b5 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 98be349c5e..8ac50221ab 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index 3c33477001..ebe083ef8b 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index 0b6435a524..69010c9c99 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 1449b25538..4c7e71ad13 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 8f1605b4aa..61d73dee44 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index d86e35b68a..e70cf2702f 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index b0c3d2d4d1..cfa32b719f 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index a1c785c519..8b6bfc7145 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index f36401ec37..104c27f10c 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index 2445a65d0a..e48cfffba5 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 8eaee20683..75ac0677a9 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 87ef05411d..13b0fd5497 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index 4486271a56..8c8e978b9e 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index cdac7f8452..1f5663cc7b 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 79d09970b8..76c83e2205 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index e376b44766..5c416b3a8d 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 39bbe1f48a..6a27da356f 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 955f94414b..e38fbbed4f 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index 21f9723519..7610c185af 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 6bc7f3969e..2bd09c6fc4 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index a709caa1c1..0c910e93f4 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index bf19602c61..d647cd1879 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index c1e7a0920b..e4adb5a80b 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index c8cc781438..01cf9e7fa3 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index d2ec0946d5..09f8a5d06a 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 9e8a839d75..cfdabb53ae 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index 97fd879153..81e6158350 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 288cff8a63..83bd8e0ac7 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index 301b6e030f..73079bf38b 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/github/transport.go b/github/transport.go index 01dfafbca6..d9b686bb57 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index dba4ab5082..36e143c45e 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index fe53abb9b2..8dc8448442 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v21/github" + "github.com/google/go-github/v24/github" ) const ( diff --git a/go.mod b/go.mod index d148b035be..c0af5ca1bb 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/go-ini/ini v1.36.0 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/google/go-github/v21 v21.0.1 + github.com/google/go-github/v24 v24.0.1 github.com/hashicorp/terraform v0.11.12-beta1.0.20190214175014-182daa619826 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 81cd7e09dd..e51d0b6f10 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/go-cmp v0.1.1-0.20171002171727-8ebdfab36c66/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v21 v21.0.1 h1:2pLOj+rs4UtoZmk5didluF5zZ6Z0kfs0z1FLa/j+4b8= -github.com/google/go-github/v21 v21.0.1/go.mod h1:RNbKQQDOg+lBuuu5l/v0joCrygzKEexxDEwaleXEHxA= +github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= +github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= diff --git a/vendor/github.com/google/go-github/v21/AUTHORS b/vendor/github.com/google/go-github/v24/AUTHORS similarity index 96% rename from vendor/github.com/google/go-github/v21/AUTHORS rename to vendor/github.com/google/go-github/v24/AUTHORS index 1f6dac5851..1bde5b1f5c 100644 --- a/vendor/github.com/google/go-github/v21/AUTHORS +++ b/vendor/github.com/google/go-github/v24/AUTHORS @@ -31,9 +31,11 @@ Antoine Pelisse Anubha Kushwaha appilon Aravind +Arda Kuyumcu Arıl Bozoluk Austin Dizzy Ben Batha +Benjamen Keroack Beshr Kayali Beyang Liu Billy Lynch @@ -79,6 +81,7 @@ eperm Erick Fejta erwinvaneyk Fabrice +Felix Geisendörfer Filippo Valsorda Florian Forster Francesc Gil @@ -105,6 +108,7 @@ isqua Jameel Haffejee Jan Kosecki Javier Campanini +Jens Rantil Jeremy Morris Jesse Newland Jihoon Chung @@ -113,6 +117,8 @@ Joan Saum Joe Tsai John Barton John Engelman +Jordan Sussman +Joshua Bezaleel Abednego JP Phillips jpbelanger-mtl Juan Basso @@ -193,6 +199,7 @@ Sarasa Kisaragi Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen +Sergey Romanov Sevki Shagun Khemka shakeelrao diff --git a/vendor/github.com/google/go-github/v21/LICENSE b/vendor/github.com/google/go-github/v24/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v21/LICENSE rename to vendor/github.com/google/go-github/v24/LICENSE diff --git a/vendor/github.com/google/go-github/v21/github/activity.go b/vendor/github.com/google/go-github/v24/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/activity.go rename to vendor/github.com/google/go-github/v24/github/activity.go diff --git a/vendor/github.com/google/go-github/v21/github/activity_events.go b/vendor/github.com/google/go-github/v24/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/activity_events.go rename to vendor/github.com/google/go-github/v24/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v21/github/activity_notifications.go b/vendor/github.com/google/go-github/v24/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/activity_notifications.go rename to vendor/github.com/google/go-github/v24/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v21/github/activity_star.go b/vendor/github.com/google/go-github/v24/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/activity_star.go rename to vendor/github.com/google/go-github/v24/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v21/github/activity_watching.go b/vendor/github.com/google/go-github/v24/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/activity_watching.go rename to vendor/github.com/google/go-github/v24/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v21/github/admin.go b/vendor/github.com/google/go-github/v24/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/admin.go rename to vendor/github.com/google/go-github/v24/github/admin.go diff --git a/vendor/github.com/google/go-github/v21/github/admin_stats.go b/vendor/github.com/google/go-github/v24/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/admin_stats.go rename to vendor/github.com/google/go-github/v24/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v21/github/apps.go b/vendor/github.com/google/go-github/v24/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/apps.go rename to vendor/github.com/google/go-github/v24/github/apps.go diff --git a/vendor/github.com/google/go-github/v21/github/apps_installation.go b/vendor/github.com/google/go-github/v24/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/apps_installation.go rename to vendor/github.com/google/go-github/v24/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v21/github/apps_marketplace.go b/vendor/github.com/google/go-github/v24/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v24/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v21/github/authorizations.go b/vendor/github.com/google/go-github/v24/github/authorizations.go similarity index 98% rename from vendor/github.com/google/go-github/v21/github/authorizations.go rename to vendor/github.com/google/go-github/v24/github/authorizations.go index 190205b02a..8ad14328e9 100644 --- a/vendor/github.com/google/go-github/v21/github/authorizations.go +++ b/vendor/github.com/google/go-github/v24/github/authorizations.go @@ -403,7 +403,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, id int64) (*Res // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://developer.github.com/enterprise/2.5/v3/users/administration/#create-an-impersonation-oauth-token +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -423,7 +423,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://developer.github.com/enterprise/2.5/v3/users/administration/#delete-an-impersonation-oauth-token +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v21/github/checks.go b/vendor/github.com/google/go-github/v24/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/checks.go rename to vendor/github.com/google/go-github/v24/github/checks.go diff --git a/vendor/github.com/google/go-github/v21/github/doc.go b/vendor/github.com/google/go-github/v24/github/doc.go similarity index 99% rename from vendor/github.com/google/go-github/v21/github/doc.go rename to vendor/github.com/google/go-github/v24/github/doc.go index 165d63e266..21dc231d7b 100644 --- a/vendor/github.com/google/go-github/v21/github/doc.go +++ b/vendor/github.com/google/go-github/v24/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v21/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v24/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/vendor/github.com/google/go-github/v21/github/event.go b/vendor/github.com/google/go-github/v24/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/event.go rename to vendor/github.com/google/go-github/v24/github/event.go diff --git a/vendor/github.com/google/go-github/v21/github/event_types.go b/vendor/github.com/google/go-github/v24/github/event_types.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/event_types.go rename to vendor/github.com/google/go-github/v24/github/event_types.go diff --git a/vendor/github.com/google/go-github/v21/github/gen-accessors.go b/vendor/github.com/google/go-github/v24/github/gen-accessors.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/gen-accessors.go rename to vendor/github.com/google/go-github/v24/github/gen-accessors.go diff --git a/vendor/github.com/google/go-github/v21/github/gists.go b/vendor/github.com/google/go-github/v24/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/gists.go rename to vendor/github.com/google/go-github/v24/github/gists.go diff --git a/vendor/github.com/google/go-github/v21/github/gists_comments.go b/vendor/github.com/google/go-github/v24/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/gists_comments.go rename to vendor/github.com/google/go-github/v24/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v21/github/git.go b/vendor/github.com/google/go-github/v24/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/git.go rename to vendor/github.com/google/go-github/v24/github/git.go diff --git a/vendor/github.com/google/go-github/v21/github/git_blobs.go b/vendor/github.com/google/go-github/v24/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/git_blobs.go rename to vendor/github.com/google/go-github/v24/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v21/github/git_commits.go b/vendor/github.com/google/go-github/v24/github/git_commits.go similarity index 96% rename from vendor/github.com/google/go-github/v21/github/git_commits.go rename to vendor/github.com/google/go-github/v24/github/git_commits.go index 7638acbd69..9dfd3afb3b 100644 --- a/vendor/github.com/google/go-github/v21/github/git_commits.go +++ b/vendor/github.com/google/go-github/v24/github/git_commits.go @@ -84,6 +84,7 @@ type createCommit struct { Message *string `json:"message,omitempty"` Tree *string `json:"tree,omitempty"` Parents []string `json:"parents,omitempty"` + Signature *string `json:"signature,omitempty"` } // CreateCommit creates a new commit in a repository. @@ -115,6 +116,9 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string if commit.Tree != nil { body.Tree = commit.Tree.SHA } + if commit.Verification != nil { + body.Signature = commit.Verification.Signature + } req, err := s.client.NewRequest("POST", u, body) if err != nil { diff --git a/vendor/github.com/google/go-github/v21/github/git_refs.go b/vendor/github.com/google/go-github/v24/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/git_refs.go rename to vendor/github.com/google/go-github/v24/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v21/github/git_tags.go b/vendor/github.com/google/go-github/v24/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/git_tags.go rename to vendor/github.com/google/go-github/v24/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v21/github/git_trees.go b/vendor/github.com/google/go-github/v24/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/git_trees.go rename to vendor/github.com/google/go-github/v24/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v21/github/github-accessors.go b/vendor/github.com/google/go-github/v24/github/github-accessors.go similarity index 99% rename from vendor/github.com/google/go-github/v21/github/github-accessors.go rename to vendor/github.com/google/go-github/v24/github/github-accessors.go index 658cad2a26..b9deb7e1c2 100644 --- a/vendor/github.com/google/go-github/v21/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v24/github/github-accessors.go @@ -7196,6 +7196,14 @@ func (p *PullRequest) GetDiffURL() string { return *p.DiffURL } +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (p *PullRequest) GetDraft() bool { + if p == nil || p.Draft == nil { + return false + } + return *p.Draft +} + // GetHead returns the Head field. func (p *PullRequest) GetHead() *PullRequestBranch { if p == nil { @@ -7324,6 +7332,14 @@ func (p *PullRequest) GetPatchURL() string { return *p.PatchURL } +// GetReviewComments returns the ReviewComments field if it's non-nil, zero value otherwise. +func (p *PullRequest) GetReviewComments() int { + if p == nil || p.ReviewComments == nil { + return 0 + } + return *p.ReviewComments +} + // GetReviewCommentsURL returns the ReviewCommentsURL field if it's non-nil, zero value otherwise. func (p *PullRequest) GetReviewCommentsURL() string { if p == nil || p.ReviewCommentsURL == nil { @@ -9700,6 +9716,14 @@ func (r *RepositoryContent) GetSize() int { return *r.Size } +// GetTarget returns the Target field if it's non-nil, zero value otherwise. +func (r *RepositoryContent) GetTarget() string { + if r == nil || r.Target == nil { + return "" + } + return *r.Target +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (r *RepositoryContent) GetType() string { if r == nil || r.Type == nil { @@ -10380,6 +10404,22 @@ func (s *Source) GetID() int64 { return *s.ID } +// GetIssue returns the Issue field. +func (s *Source) GetIssue() *Issue { + if s == nil { + return nil + } + return s.Issue +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (s *Source) GetType() string { + if s == nil || s.Type == nil { + return "" + } + return *s.Type +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (s *Source) GetURL() string { if s == nil || s.URL == nil { @@ -12124,6 +12164,14 @@ func (u *UserStats) GetTotalUsers() int { return *u.TotalUsers } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (u *UserSuspendOptions) GetReason() string { + if u == nil || u.Reason == nil { + return "" + } + return *u.Reason +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (w *WatchEvent) GetAction() string { if w == nil || w.Action == nil { diff --git a/vendor/github.com/google/go-github/v21/github/github.go b/vendor/github.com/google/go-github/v24/github/github.go similarity index 99% rename from vendor/github.com/google/go-github/v21/github/github.go rename to vendor/github.com/google/go-github/v24/github/github.go index abed36dd9b..4d86d76b79 100644 --- a/vendor/github.com/google/go-github/v21/github/github.go +++ b/vendor/github.com/google/go-github/v24/github/github.go @@ -128,6 +128,9 @@ const ( // https://developer.github.com/changes/2018-12-18-interactions-preview/ mediaTypeInteractionRestrictionsPreview = "application/vnd.github.sombra-preview+json" + + // https://developer.github.com/changes/2019-02-14-draft-pull-requests/ + mediaTypeDraftPreview = "application/vnd.github.shadow-cat-preview+json" ) // A Client manages communication with the GitHub API. @@ -191,7 +194,9 @@ type ListOptions struct { // UploadOptions specifies the parameters to methods that support uploads. type UploadOptions struct { - Name string `url:"name,omitempty"` + Name string `url:"name,omitempty"` + Label string `url:"label,omitempty"` + MediaType string `url:"-"` } // RawType represents type of raw format of a request instead of JSON. diff --git a/vendor/github.com/google/go-github/v21/github/gitignore.go b/vendor/github.com/google/go-github/v24/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/gitignore.go rename to vendor/github.com/google/go-github/v24/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v21/github/interactions.go b/vendor/github.com/google/go-github/v24/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/interactions.go rename to vendor/github.com/google/go-github/v24/github/interactions.go diff --git a/vendor/github.com/google/go-github/v21/github/interactions_orgs.go b/vendor/github.com/google/go-github/v24/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v24/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v21/github/interactions_repos.go b/vendor/github.com/google/go-github/v24/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/interactions_repos.go rename to vendor/github.com/google/go-github/v24/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v21/github/issues.go b/vendor/github.com/google/go-github/v24/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues.go rename to vendor/github.com/google/go-github/v24/github/issues.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_assignees.go b/vendor/github.com/google/go-github/v24/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues_assignees.go rename to vendor/github.com/google/go-github/v24/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_comments.go b/vendor/github.com/google/go-github/v24/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues_comments.go rename to vendor/github.com/google/go-github/v24/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_events.go b/vendor/github.com/google/go-github/v24/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues_events.go rename to vendor/github.com/google/go-github/v24/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_labels.go b/vendor/github.com/google/go-github/v24/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues_labels.go rename to vendor/github.com/google/go-github/v24/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_milestones.go b/vendor/github.com/google/go-github/v24/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/issues_milestones.go rename to vendor/github.com/google/go-github/v24/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v21/github/issues_timeline.go b/vendor/github.com/google/go-github/v24/github/issues_timeline.go similarity index 98% rename from vendor/github.com/google/go-github/v21/github/issues_timeline.go rename to vendor/github.com/google/go-github/v24/github/issues_timeline.go index 5987bd06aa..d0e4a3a942 100644 --- a/vendor/github.com/google/go-github/v21/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v24/github/issues_timeline.go @@ -125,6 +125,8 @@ type Source struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` Actor *User `json:"actor,omitempty"` + Type *string `json:"type,omitempty"` + Issue *Issue `json:"issue,omitempty"` } // ListIssueTimeline lists events for the specified issue. diff --git a/vendor/github.com/google/go-github/v21/github/licenses.go b/vendor/github.com/google/go-github/v24/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/licenses.go rename to vendor/github.com/google/go-github/v24/github/licenses.go diff --git a/vendor/github.com/google/go-github/v21/github/messages.go b/vendor/github.com/google/go-github/v24/github/messages.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/messages.go rename to vendor/github.com/google/go-github/v24/github/messages.go diff --git a/vendor/github.com/google/go-github/v21/github/migrations.go b/vendor/github.com/google/go-github/v24/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/migrations.go rename to vendor/github.com/google/go-github/v24/github/migrations.go diff --git a/vendor/github.com/google/go-github/v21/github/migrations_source_import.go b/vendor/github.com/google/go-github/v24/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v24/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v21/github/migrations_user.go b/vendor/github.com/google/go-github/v24/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/migrations_user.go rename to vendor/github.com/google/go-github/v24/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v21/github/misc.go b/vendor/github.com/google/go-github/v24/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/misc.go rename to vendor/github.com/google/go-github/v24/github/misc.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs.go b/vendor/github.com/google/go-github/v24/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs.go rename to vendor/github.com/google/go-github/v24/github/orgs.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs_hooks.go b/vendor/github.com/google/go-github/v24/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v24/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs_members.go b/vendor/github.com/google/go-github/v24/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs_members.go rename to vendor/github.com/google/go-github/v24/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v24/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v24/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs_projects.go b/vendor/github.com/google/go-github/v24/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs_projects.go rename to vendor/github.com/google/go-github/v24/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v21/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v24/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v24/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v21/github/projects.go b/vendor/github.com/google/go-github/v24/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/projects.go rename to vendor/github.com/google/go-github/v24/github/projects.go diff --git a/vendor/github.com/google/go-github/v21/github/pulls.go b/vendor/github.com/google/go-github/v24/github/pulls.go similarity index 98% rename from vendor/github.com/google/go-github/v21/github/pulls.go rename to vendor/github.com/google/go-github/v24/github/pulls.go index aac34792bd..067e362be5 100644 --- a/vendor/github.com/google/go-github/v21/github/pulls.go +++ b/vendor/github.com/google/go-github/v24/github/pulls.go @@ -32,6 +32,7 @@ type PullRequest struct { MergedAt *time.Time `json:"merged_at,omitempty"` Labels []*Label `json:"labels,omitempty"` User *User `json:"user,omitempty"` + Draft *bool `json:"draft,omitempty"` Merged *bool `json:"merged,omitempty"` Mergeable *bool `json:"mergeable,omitempty"` MergeableState *string `json:"mergeable_state,omitempty"` @@ -52,6 +53,7 @@ type PullRequest struct { CommentsURL *string `json:"comments_url,omitempty"` ReviewCommentsURL *string `json:"review_comments_url,omitempty"` ReviewCommentURL *string `json:"review_comment_url,omitempty"` + ReviewComments *int `json:"review_comments,omitempty"` Assignee *User `json:"assignee,omitempty"` Assignees []*User `json:"assignees,omitempty"` Milestone *Milestone `json:"milestone,omitempty"` @@ -145,7 +147,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} + acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview, mediaTypeDraftPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var pulls []*PullRequest @@ -168,7 +170,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview} + acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview, mediaTypeDraftPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) pull := new(PullRequest) diff --git a/vendor/github.com/google/go-github/v21/github/pulls_comments.go b/vendor/github.com/google/go-github/v24/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/pulls_comments.go rename to vendor/github.com/google/go-github/v24/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v21/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v24/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v24/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v21/github/pulls_reviews.go b/vendor/github.com/google/go-github/v24/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v24/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v21/github/reactions.go b/vendor/github.com/google/go-github/v24/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/reactions.go rename to vendor/github.com/google/go-github/v24/github/reactions.go diff --git a/vendor/github.com/google/go-github/v21/github/repos.go b/vendor/github.com/google/go-github/v24/github/repos.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos.go rename to vendor/github.com/google/go-github/v24/github/repos.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_collaborators.go b/vendor/github.com/google/go-github/v24/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v24/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_comments.go b/vendor/github.com/google/go-github/v24/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_comments.go rename to vendor/github.com/google/go-github/v24/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_commits.go b/vendor/github.com/google/go-github/v24/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_commits.go rename to vendor/github.com/google/go-github/v24/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_community_health.go b/vendor/github.com/google/go-github/v24/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_community_health.go rename to vendor/github.com/google/go-github/v24/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_contents.go b/vendor/github.com/google/go-github/v24/github/repos_contents.go similarity index 97% rename from vendor/github.com/google/go-github/v21/github/repos_contents.go rename to vendor/github.com/google/go-github/v24/github/repos_contents.go index ffb56b90df..bf6cabc5c0 100644 --- a/vendor/github.com/google/go-github/v21/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v24/github/repos_contents.go @@ -21,7 +21,10 @@ import ( // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` + // Target is only set if the type is "symlink" and the target is not a normal file. + // If Target is set, Path will be the symlink path. + Target *string `json:"target,omitempty"` Encoding *string `json:"encoding,omitempty"` Size *int `json:"size,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/google/go-github/v21/github/repos_deployments.go b/vendor/github.com/google/go-github/v24/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_deployments.go rename to vendor/github.com/google/go-github/v24/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_forks.go b/vendor/github.com/google/go-github/v24/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_forks.go rename to vendor/github.com/google/go-github/v24/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_hooks.go b/vendor/github.com/google/go-github/v24/github/repos_hooks.go similarity index 99% rename from vendor/github.com/google/go-github/v21/github/repos_hooks.go rename to vendor/github.com/google/go-github/v24/github/repos_hooks.go index 56374b3ec1..7674947df3 100644 --- a/vendor/github.com/google/go-github/v21/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v24/github/repos_hooks.go @@ -92,6 +92,7 @@ func (h Hook) String() string { // information. type createHookRequest struct { // Config is required. + Name string `json:"name"` Config map[string]interface{} `json:"config,omitempty"` Events []string `json:"events,omitempty"` Active *bool `json:"active,omitempty"` @@ -108,6 +109,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) hookReq := &createHookRequest{ + Name: "web", Events: hook.Events, Active: hook.Active, Config: hook.Config, diff --git a/vendor/github.com/google/go-github/v21/github/repos_invitations.go b/vendor/github.com/google/go-github/v24/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_invitations.go rename to vendor/github.com/google/go-github/v24/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_keys.go b/vendor/github.com/google/go-github/v24/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_keys.go rename to vendor/github.com/google/go-github/v24/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_merging.go b/vendor/github.com/google/go-github/v24/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_merging.go rename to vendor/github.com/google/go-github/v24/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_pages.go b/vendor/github.com/google/go-github/v24/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_pages.go rename to vendor/github.com/google/go-github/v24/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v24/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v24/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_projects.go b/vendor/github.com/google/go-github/v24/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_projects.go rename to vendor/github.com/google/go-github/v24/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_releases.go b/vendor/github.com/google/go-github/v24/github/repos_releases.go similarity index 99% rename from vendor/github.com/google/go-github/v21/github/repos_releases.go rename to vendor/github.com/google/go-github/v24/github/repos_releases.go index bf58743ebd..5c0a1cea84 100644 --- a/vendor/github.com/google/go-github/v21/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v24/github/repos_releases.go @@ -356,6 +356,10 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep } mediaType := mime.TypeByExtension(filepath.Ext(file.Name())) + if opt.MediaType != "" { + mediaType = opt.MediaType + } + req, err := s.client.NewUploadRequest(u, file, stat.Size(), mediaType) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v21/github/repos_stats.go b/vendor/github.com/google/go-github/v24/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_stats.go rename to vendor/github.com/google/go-github/v24/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_statuses.go b/vendor/github.com/google/go-github/v24/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_statuses.go rename to vendor/github.com/google/go-github/v24/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v21/github/repos_traffic.go b/vendor/github.com/google/go-github/v24/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/repos_traffic.go rename to vendor/github.com/google/go-github/v24/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v21/github/search.go b/vendor/github.com/google/go-github/v24/github/search.go similarity index 96% rename from vendor/github.com/google/go-github/v21/github/search.go rename to vendor/github.com/google/go-github/v24/github/search.go index abaf5e1f0b..24156f3183 100644 --- a/vendor/github.com/google/go-github/v21/github/search.go +++ b/vendor/github.com/google/go-github/v24/github/search.go @@ -8,9 +8,7 @@ package github import ( "context" "fmt" - "net/url" "strconv" - "strings" qs "github.com/google/go-querystring/query" ) @@ -218,20 +216,19 @@ func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, // Helper function that executes search queries against different // GitHub search types (repositories, commits, code, issues, users, labels) +// +// If searchParameters.Query includes multiple condition, it MUST NOT include "+" as condition separator. +// For example, querying with "language:c++" and "leveldb", then searchParameters.Query should be "language:c++ leveldb" but not "language:c+++leveldb". func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opt *SearchOptions, result interface{}) (*Response, error) { params, err := qs.Values(opt) if err != nil { return nil, err } - q := strings.Replace(parameters.Query, " ", "+", -1) if parameters.RepositoryID != nil { params.Set("repository_id", strconv.FormatInt(*parameters.RepositoryID, 10)) } - query := "q=" + url.PathEscape(q) - if v := params.Encode(); v != "" { - query = query + "&" + v - } - u := fmt.Sprintf("search/%s?%s", searchType, query) + params.Set("q", parameters.Query) + u := fmt.Sprintf("search/%s?%s", searchType, params.Encode()) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v21/github/strings.go b/vendor/github.com/google/go-github/v24/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/strings.go rename to vendor/github.com/google/go-github/v24/github/strings.go diff --git a/vendor/github.com/google/go-github/v21/github/teams.go b/vendor/github.com/google/go-github/v24/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/teams.go rename to vendor/github.com/google/go-github/v24/github/teams.go diff --git a/vendor/github.com/google/go-github/v21/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v24/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v24/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v21/github/teams_discussions.go b/vendor/github.com/google/go-github/v24/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/teams_discussions.go rename to vendor/github.com/google/go-github/v24/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v21/github/teams_members.go b/vendor/github.com/google/go-github/v24/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/teams_members.go rename to vendor/github.com/google/go-github/v24/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v21/github/timestamp.go b/vendor/github.com/google/go-github/v24/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/timestamp.go rename to vendor/github.com/google/go-github/v24/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v21/github/users.go b/vendor/github.com/google/go-github/v24/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users.go rename to vendor/github.com/google/go-github/v24/github/users.go diff --git a/vendor/github.com/google/go-github/v21/github/users_administration.go b/vendor/github.com/google/go-github/v24/github/users_administration.go similarity index 64% rename from vendor/github.com/google/go-github/v21/github/users_administration.go rename to vendor/github.com/google/go-github/v24/github/users_administration.go index e042398d8c..1c483a7b17 100644 --- a/vendor/github.com/google/go-github/v21/github/users_administration.go +++ b/vendor/github.com/google/go-github/v24/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/v3/users/administration/#promote-an-ordinary-user-to-a-site-administrator +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +26,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/v3/users/administration/#demote-a-site-administrator-to-an-ordinary-user +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -38,13 +38,18 @@ func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Respo return s.client.Do(ctx, req, nil) } +// UserSuspendOptions represents the reason a user is being suspended. +type UserSuspendOptions struct { + Reason *string `json:"reason,omitempty"` +} + // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/v3/users/administration/#suspend-a-user -func (s *UsersService) Suspend(ctx context.Context, user string) (*Response, error) { +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user +func (s *UsersService) Suspend(ctx context.Context, user string, opt *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest("PUT", u, opt) if err != nil { return nil, err } @@ -54,7 +59,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string) (*Response, err // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/v3/users/administration/#unsuspend-a-user +// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/vendor/github.com/google/go-github/v21/github/users_blocking.go b/vendor/github.com/google/go-github/v24/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users_blocking.go rename to vendor/github.com/google/go-github/v24/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v21/github/users_emails.go b/vendor/github.com/google/go-github/v24/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users_emails.go rename to vendor/github.com/google/go-github/v24/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v21/github/users_followers.go b/vendor/github.com/google/go-github/v24/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users_followers.go rename to vendor/github.com/google/go-github/v24/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v21/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v24/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v24/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v21/github/users_keys.go b/vendor/github.com/google/go-github/v24/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/users_keys.go rename to vendor/github.com/google/go-github/v24/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v21/github/with_appengine.go b/vendor/github.com/google/go-github/v24/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/with_appengine.go rename to vendor/github.com/google/go-github/v24/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v21/github/without_appengine.go b/vendor/github.com/google/go-github/v24/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v21/github/without_appengine.go rename to vendor/github.com/google/go-github/v24/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index a50114b086..5f1d44ebd5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,8 +54,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-github/v21 v21.0.1 -github.com/google/go-github/v21/github +# github.com/google/go-github/v24 v24.0.1 +github.com/google/go-github/v24/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce From 2d01f85663e949d7f98f14a95670d6252956fb25 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Tue, 23 Apr 2019 11:57:05 -0300 Subject: [PATCH 9/9] Include required review count This commit includes the `required_approving_review_count` field on the `github_branch_protection` resource, allowing to manage the miminum amount of reviewers to allow a merge to happen. This field must be between 1 - 6, according to the docs, and must be valid if present. Bumping the `go-github` to `v24` made it default to `0` when not present, causing the followin error GitHub API error when count is 0 ``` 422 Invalid request. No subschema in "anyOf" matched. 0 must be greater than or equal to 1. Not all subschemas of "allOf" matched. For 'anyOf/1', {"dismissal_restrictions"=>{"users"=>[], "teams"=>[]}, "dismiss_stale_reviews"=>false, "require_code_owner_reviews"=>true, "required_approving_review_count"=>0} is not a null. [] Payload: { "required_status_checks": { "strict": true, "contexts": [ "lint", "test" ] }, "required_pull_request_reviews": { "dismissal_restrictions": { "users": [], "teams": [] }, "dismiss_stale_reviews": false, "require_code_owner_reviews": true, "required_approving_review_count": 0 }, "enforce_admins": true, "restrictions": null } ``` This PR is important when upgrading `go-github`. Built on top of: https://github.com/terraform-providers/terraform-provider-github/pull/207 --- github/resource_github_branch_protection.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index 90b2ec46b5..6392b77d88 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -9,6 +9,7 @@ import ( "github.com/google/go-github/v24/github" "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/helper/validation" ) func resourceGithubBranchProtection() *schema.Resource { @@ -96,6 +97,12 @@ func resourceGithubBranchProtection() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "required_approving_review_count": { + Type: schema.TypeInt, + Optional: true, + Default: 1, + ValidateFunc: validation.IntBetween(1, 6), + }, }, }, }, @@ -338,10 +345,11 @@ func flattenAndSetRequiredPullRequestReviews(d *schema.ResourceData, protection return d.Set("required_pull_request_reviews", []interface{}{ map[string]interface{}{ - "dismiss_stale_reviews": rprr.DismissStaleReviews, - "dismissal_users": schema.NewSet(schema.HashString, users), - "dismissal_teams": schema.NewSet(schema.HashString, teams), - "require_code_owner_reviews": rprr.RequireCodeOwnerReviews, + "dismiss_stale_reviews": rprr.DismissStaleReviews, + "dismissal_users": schema.NewSet(schema.HashString, users), + "dismissal_teams": schema.NewSet(schema.HashString, teams), + "require_code_owner_reviews": rprr.RequireCodeOwnerReviews, + "required_approving_review_count": rprr.RequiredApprovingReviewCount, }, }) } @@ -427,6 +435,7 @@ func expandRequiredPullRequestReviews(d *schema.ResourceData) (*github.PullReque rprr.DismissalRestrictionsRequest = drr rprr.DismissStaleReviews = m["dismiss_stale_reviews"].(bool) rprr.RequireCodeOwnerReviews = m["require_code_owner_reviews"].(bool) + rprr.RequiredApprovingReviewCount = m["required_approving_review_count"].(int) } return rprr, nil