mirror of
https://github.com/harness/drone.git
synced 2025-05-05 04:49:32 +08:00
[MISC] Move GitRPC to Read/WriteRequest, Update Create/Delete Branch to use Push, Setup githook Symlink, Accept Incoming X-Request-Id (#157)
This commit is contained in:
parent
d61e876de0
commit
6c567b38d0
@ -41,6 +41,11 @@ func load() (*types.Config, error) {
|
|||||||
return nil, fmt.Errorf("unable to ensure that git root is set in config: %w", err)
|
return nil, fmt.Errorf("unable to ensure that git root is set in config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = ensureGitServerHookIsSet(config)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to ensure that server hook is set in config: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +94,19 @@ func ensureGitRootIsSet(config *types.Config) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ensureGitServerHookIsSet(config *types.Config) error {
|
||||||
|
if config.Git.ServerHookPath == "" {
|
||||||
|
executablePath, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to get path of current executable: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
config.Git.ServerHookPath = executablePath
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// PackageConfigsWireSet contains providers that generate configs required for sub packages.
|
// PackageConfigsWireSet contains providers that generate configs required for sub packages.
|
||||||
var PackageConfigsWireSet = wire.NewSet(
|
var PackageConfigsWireSet = wire.NewSet(
|
||||||
ProvideGitRPCServerConfig,
|
ProvideGitRPCServerConfig,
|
||||||
@ -101,7 +119,8 @@ func ProvideGitRPCServerConfig(config *types.Config) server.Config {
|
|||||||
return server.Config{
|
return server.Config{
|
||||||
Bind: config.Server.GRPC.Bind,
|
Bind: config.Server.GRPC.Bind,
|
||||||
GitRoot: config.Git.Root,
|
GitRoot: config.Git.Root,
|
||||||
ReposTempPath: config.Git.ReposTempPath,
|
TmpDir: config.Git.TmpDir,
|
||||||
|
ServerHookPath: config.Git.ServerHookPath,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/harness/gitness/events"
|
"github.com/harness/gitness/events"
|
||||||
"github.com/harness/gitness/gitrpc"
|
"github.com/harness/gitness/gitrpc"
|
||||||
events2 "github.com/harness/gitness/gitrpc/events"
|
events2 "github.com/harness/gitness/gitrpc/events"
|
||||||
@ -129,7 +128,7 @@ func initSystem(ctx context.Context, config *types.Config) (*system, error) {
|
|||||||
routerRouter := router2.ProvideRouter(apiHandler, gitHandler, webHandler)
|
routerRouter := router2.ProvideRouter(apiHandler, gitHandler, webHandler)
|
||||||
serverServer := server.ProvideServer(config, routerRouter)
|
serverServer := server.ProvideServer(config, routerRouter)
|
||||||
serverConfig := ProvideGitRPCServerConfig(config)
|
serverConfig := ProvideGitRPCServerConfig(config)
|
||||||
server3, err := server2.ProvideServer(serverConfig, eventsSystem)
|
server3, err := server2.ProvideServer(serverConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ func initSystem(ctx context.Context, config *types.Config) (*system, error) {
|
|||||||
routerRouter := router.ProvideRouter(apiHandler, gitHandler, webHandler)
|
routerRouter := router.ProvideRouter(apiHandler, gitHandler, webHandler)
|
||||||
serverServer := server.ProvideServer(config, routerRouter)
|
serverServer := server.ProvideServer(config, routerRouter)
|
||||||
serverConfig := ProvideGitRPCServerConfig(config)
|
serverConfig := ProvideGitRPCServerConfig(config)
|
||||||
server3, err := server2.ProvideServer(serverConfig, eventsSystem)
|
server3, err := server2.ProvideServer(serverConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GetBlobParams struct {
|
type GetBlobParams struct {
|
||||||
RepoUID string
|
ReadParams
|
||||||
SHA string
|
SHA string
|
||||||
SizeLimit int64
|
SizeLimit int64
|
||||||
}
|
}
|
||||||
@ -33,8 +33,9 @@ func (c *Client) GetBlob(ctx context.Context, params *GetBlobParams) (*GetBlobOu
|
|||||||
if params == nil {
|
if params == nil {
|
||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := c.repoService.GetBlob(ctx, &rpc.GetBlobRequest{
|
resp, err := c.repoService.GetBlob(ctx, &rpc.GetBlobRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
Sha: params.SHA,
|
Sha: params.SHA,
|
||||||
SizeLimit: params.SizeLimit,
|
SizeLimit: params.SizeLimit,
|
||||||
})
|
})
|
||||||
|
@ -24,8 +24,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateBranchParams struct {
|
type CreateBranchParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
WriteParams
|
||||||
RepoUID string
|
|
||||||
// BranchName is the name of the branch
|
// BranchName is the name of the branch
|
||||||
BranchName string
|
BranchName string
|
||||||
// Target is a git reference (branch / tag / commit SHA)
|
// Target is a git reference (branch / tag / commit SHA)
|
||||||
@ -37,15 +36,13 @@ type CreateBranchOutput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DeleteBranchParams struct {
|
type DeleteBranchParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
WriteParams
|
||||||
RepoUID string
|
|
||||||
// Name is the name of the branch
|
// Name is the name of the branch
|
||||||
BranchName string
|
BranchName string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListBranchesParams struct {
|
type ListBranchesParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
IncludeCommit bool
|
IncludeCommit bool
|
||||||
Query string
|
Query string
|
||||||
Sort BranchSortOption
|
Sort BranchSortOption
|
||||||
@ -69,7 +66,7 @@ func (c *Client) CreateBranch(ctx context.Context, params *CreateBranchParams) (
|
|||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
resp, err := c.refService.CreateBranch(ctx, &rpc.CreateBranchRequest{
|
resp, err := c.refService.CreateBranch(ctx, &rpc.CreateBranchRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCWriteRequest(params.WriteParams),
|
||||||
Target: params.Target,
|
Target: params.Target,
|
||||||
BranchName: params.BranchName,
|
BranchName: params.BranchName,
|
||||||
})
|
})
|
||||||
@ -93,7 +90,7 @@ func (c *Client) DeleteBranch(ctx context.Context, params *DeleteBranchParams) e
|
|||||||
return ErrNoParamsProvided
|
return ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
_, err := c.refService.DeleteBranch(ctx, &rpc.DeleteBranchRequest{
|
_, err := c.refService.DeleteBranch(ctx, &rpc.DeleteBranchRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCWriteRequest(params.WriteParams),
|
||||||
BranchName: params.BranchName,
|
BranchName: params.BranchName,
|
||||||
// TODO: what are scenarios where we wouldn't want to force delete?
|
// TODO: what are scenarios where we wouldn't want to force delete?
|
||||||
// Branch protection is a different story, and build on top application layer.
|
// Branch protection is a different story, and build on top application layer.
|
||||||
@ -112,7 +109,7 @@ func (c *Client) ListBranches(ctx context.Context, params *ListBranchesParams) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream, err := c.refService.ListBranches(ctx, &rpc.ListBranchesRequest{
|
stream, err := c.refService.ListBranches(ctx, &rpc.ListBranchesRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
IncludeCommit: params.IncludeCommit,
|
IncludeCommit: params.IncludeCommit,
|
||||||
Query: params.Query,
|
Query: params.Query,
|
||||||
Sort: mapToRPCListBranchesSortOption(params.Sort),
|
Sort: mapToRPCListBranchesSortOption(params.Sort),
|
||||||
|
@ -11,11 +11,6 @@ import (
|
|||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config represents the config for the gitrpc client.
|
|
||||||
type Config struct {
|
|
||||||
Bind string
|
|
||||||
}
|
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
conn *grpc.ClientConn
|
conn *grpc.ClientConn
|
||||||
repoService rpc.RepositoryServiceClient
|
repoService rpc.RepositoryServiceClient
|
||||||
|
47
gitrpc/common.go
Normal file
47
gitrpc/common.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright 2022 Harness Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by the Polyform Free Trial License
|
||||||
|
// that can be found in the LICENSE.md file for this repository.
|
||||||
|
|
||||||
|
package gitrpc
|
||||||
|
|
||||||
|
import "github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
|
// ReadParams contains the base parameters for read operations.
|
||||||
|
type ReadParams struct {
|
||||||
|
RepoUID string
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteParams contains the base parameters for write operations.
|
||||||
|
type WriteParams struct {
|
||||||
|
RepoUID string
|
||||||
|
Actor Identity
|
||||||
|
EnvVars map[string]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func mapToRPCReadRequest(p ReadParams) *rpc.ReadRequest {
|
||||||
|
return &rpc.ReadRequest{
|
||||||
|
RepoUid: p.RepoUID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func mapToRPCWriteRequest(p WriteParams) *rpc.WriteRequest {
|
||||||
|
out := &rpc.WriteRequest{
|
||||||
|
RepoUid: p.RepoUID,
|
||||||
|
Actor: &rpc.Identity{
|
||||||
|
Name: p.Actor.Name,
|
||||||
|
Email: p.Actor.Email,
|
||||||
|
},
|
||||||
|
EnvVars: make([]*rpc.EnvVar, len(p.EnvVars)),
|
||||||
|
}
|
||||||
|
|
||||||
|
i := 0
|
||||||
|
for k, v := range p.EnvVars {
|
||||||
|
out.EnvVars[i] = &rpc.EnvVar{
|
||||||
|
Name: k,
|
||||||
|
Value: v,
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
return out
|
||||||
|
}
|
@ -2,9 +2,9 @@
|
|||||||
// Use of this source code is governed by the Polyform Free Trial License
|
// Use of this source code is governed by the Polyform Free Trial License
|
||||||
// that can be found in the LICENSE.md file for this repository.
|
// that can be found in the LICENSE.md file for this repository.
|
||||||
|
|
||||||
package rpc
|
package gitrpc
|
||||||
|
|
||||||
const (
|
// Config represents the config for the gitrpc client.
|
||||||
// MetadataKeyRequestID is the key used to store the request ID in the metadata.
|
type Config struct {
|
||||||
MetadataKeyRequestID = "request-id"
|
Bind string
|
||||||
)
|
}
|
@ -13,17 +13,17 @@ import (
|
|||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RawDiffRequest struct {
|
type RawDiffParams struct {
|
||||||
RepoID string
|
ReadParams
|
||||||
LeftCommitID string
|
LeftCommitID string
|
||||||
RightCommitID string
|
RightCommitID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) RawDiff(ctx context.Context, in *RawDiffRequest, w io.Writer) error {
|
func (c *Client) RawDiff(ctx context.Context, params *RawDiffParams, out io.Writer) error {
|
||||||
diff, err := c.diffService.RawDiff(ctx, &rpc.RawDiffRequest{
|
diff, err := c.diffService.RawDiff(ctx, &rpc.RawDiffRequest{
|
||||||
RepoId: in.RepoID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
LeftCommitId: in.LeftCommitID,
|
LeftCommitId: params.LeftCommitID,
|
||||||
RightCommitId: in.RightCommitID,
|
RightCommitId: params.RightCommitID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -35,7 +35,7 @@ func (c *Client) RawDiff(ctx context.Context, in *RawDiffRequest, w io.Writer) e
|
|||||||
return resp.GetData(), err
|
return resp.GetData(), err
|
||||||
})
|
})
|
||||||
|
|
||||||
if _, err = io.Copy(w, reader); err != nil {
|
if _, err = io.Copy(out, reader); err != nil {
|
||||||
return fmt.Errorf("copy rpc data: %w", err)
|
return fmt.Errorf("copy rpc data: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ type Interface interface {
|
|||||||
ListCommits(ctx context.Context, params *ListCommitsParams) (*ListCommitsOutput, error)
|
ListCommits(ctx context.Context, params *ListCommitsParams) (*ListCommitsOutput, error)
|
||||||
ListCommitTags(ctx context.Context, params *ListCommitTagsParams) (*ListCommitTagsOutput, error)
|
ListCommitTags(ctx context.Context, params *ListCommitTagsParams) (*ListCommitTagsOutput, error)
|
||||||
GetCommitDivergences(ctx context.Context, params *GetCommitDivergencesParams) (*GetCommitDivergencesOutput, error)
|
GetCommitDivergences(ctx context.Context, params *GetCommitDivergencesParams) (*GetCommitDivergencesOutput, error)
|
||||||
CommitFiles(ctx context.Context, params *CommitFilesOptions) (CommitFilesResponse, error)
|
CommitFiles(ctx context.Context, params *CommitFilesParams) (CommitFilesResponse, error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Git Cli Service
|
* Git Cli Service
|
||||||
@ -37,5 +37,5 @@ type Interface interface {
|
|||||||
/*
|
/*
|
||||||
* Diff services
|
* Diff services
|
||||||
*/
|
*/
|
||||||
RawDiff(ctx context.Context, in *RawDiffRequest, w io.Writer) error
|
RawDiff(ctx context.Context, in *RawDiffParams, w io.Writer) error
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,37 @@ func (g Adapter) CreateBranch(ctx context.Context, repoPath string,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetBranch gets an existing branch.
|
||||||
|
func (g Adapter) GetBranch(ctx context.Context, repoPath string,
|
||||||
|
branchName string) (*types.Branch, error) {
|
||||||
|
giteaRepo, err := gitea.OpenRepository(ctx, repoPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer giteaRepo.Close()
|
||||||
|
|
||||||
|
giteaBranch, err := giteaRepo.GetBranch(branchName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGiteaErrorf(err, "failed to get branch '%s'", branchName)
|
||||||
|
}
|
||||||
|
|
||||||
|
giteaCommit, err := giteaBranch.GetCommit()
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGiteaErrorf(err, "failed to get commit '%s'", branchName)
|
||||||
|
}
|
||||||
|
|
||||||
|
commit, err := mapGiteaCommit(giteaCommit)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to map gitea commit: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &types.Branch{
|
||||||
|
Name: giteaBranch.Name,
|
||||||
|
SHA: giteaCommit.ID.String(),
|
||||||
|
Commit: commit,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteBranch deletes an existing branch.
|
// DeleteBranch deletes an existing branch.
|
||||||
func (g Adapter) DeleteBranch(ctx context.Context, repoPath string, branchName string, force bool) (string, error) {
|
func (g Adapter) DeleteBranch(ctx context.Context, repoPath string, branchName string, force bool) (string, error) {
|
||||||
giteaRepo, err := gitea.OpenRepository(ctx, repoPath)
|
giteaRepo, err := gitea.OpenRepository(ctx, repoPath)
|
||||||
|
@ -19,6 +19,13 @@ import (
|
|||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
RequestIDNone string = "gitrpc_none"
|
||||||
|
)
|
||||||
|
|
||||||
|
// requestIDKey is context key for storing and retrieving the request ID to and from a context.
|
||||||
|
type requestIDKey struct{}
|
||||||
|
|
||||||
// LogInterceptor injects a zerolog logger with common grpc related annotations and logs the completion of the call.
|
// LogInterceptor injects a zerolog logger with common grpc related annotations and logs the completion of the call.
|
||||||
// If the metadata contains a request id, the logger is annotated with the same request ID, otherwise with a new one.
|
// If the metadata contains a request id, the logger is annotated with the same request ID, otherwise with a new one.
|
||||||
type LogInterceptor struct {
|
type LogInterceptor struct {
|
||||||
@ -31,7 +38,7 @@ func NewLogInterceptor() LogInterceptor {
|
|||||||
func (i LogInterceptor) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
func (i LogInterceptor) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
||||||
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
|
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
|
||||||
handler grpc.UnaryHandler) (interface{}, error) {
|
handler grpc.UnaryHandler) (interface{}, error) {
|
||||||
ctx = injectLogger(ctx, info.FullMethod)
|
ctx = injectLogging(ctx, info.FullMethod)
|
||||||
|
|
||||||
// measure execution time
|
// measure execution time
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
@ -46,7 +53,7 @@ func (i LogInterceptor) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
|||||||
func (i LogInterceptor) StreamInterceptor() grpc.StreamServerInterceptor {
|
func (i LogInterceptor) StreamInterceptor() grpc.StreamServerInterceptor {
|
||||||
return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo,
|
return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo,
|
||||||
handler grpc.StreamHandler) error {
|
handler grpc.StreamHandler) error {
|
||||||
ctx := injectLogger(stream.Context(), info.FullMethod)
|
ctx := injectLogging(stream.Context(), info.FullMethod)
|
||||||
|
|
||||||
// wrap stream with updated context
|
// wrap stream with updated context
|
||||||
stream = &logServerStream{
|
stream = &logServerStream{
|
||||||
@ -64,7 +71,22 @@ func (i LogInterceptor) StreamInterceptor() grpc.StreamServerInterceptor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func injectLogger(ctx context.Context, fullMethod string) context.Context {
|
// WithRequestID returns a copy of parent in which the request id value is set.
|
||||||
|
func WithRequestID(parent context.Context, v string) context.Context {
|
||||||
|
return context.WithValue(parent, requestIDKey{}, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RequestIDFrom retrieves the request id from the context.
|
||||||
|
// If no request id exists, RequestIDNone is returned.
|
||||||
|
func RequestIDFrom(ctx context.Context) string {
|
||||||
|
if v, ok := ctx.Value(requestIDKey{}).(string); ok {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
return RequestIDNone
|
||||||
|
}
|
||||||
|
|
||||||
|
func injectLogging(ctx context.Context, fullMethod string) context.Context {
|
||||||
// split fullMethod into service and method (expected format: "/package.service/method...")
|
// split fullMethod into service and method (expected format: "/package.service/method...")
|
||||||
// If it doesn't match the expected format, the full string is put into method.
|
// If it doesn't match the expected format, the full string is put into method.
|
||||||
service, method := "", fullMethod
|
service, method := "", fullMethod
|
||||||
@ -74,11 +96,15 @@ func injectLogger(ctx context.Context, fullMethod string) context.Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get request id (or create a new one) and inject it for later usage (git env variables)
|
||||||
|
requestID := getOrCreateRequestID(ctx)
|
||||||
|
ctx = WithRequestID(ctx, requestID)
|
||||||
|
|
||||||
// create new logCtx with injected info
|
// create new logCtx with injected info
|
||||||
logCtx := log.Logger.With().
|
logCtx := log.Logger.With().
|
||||||
Str("grpc.service", service).
|
Str("grpc.service", service).
|
||||||
Str("grpc.method", method).
|
Str("grpc.method", method).
|
||||||
Str("grpc.request_id", getOrCreateRequestID(ctx))
|
Str("grpc.request_id", requestID)
|
||||||
|
|
||||||
// add peer information if available
|
// add peer information if available
|
||||||
if p, ok := peer.FromContext(ctx); ok && p.Addr != nil {
|
if p, ok := peer.FromContext(ctx); ok && p.Addr != nil {
|
||||||
@ -110,7 +136,7 @@ func getOrCreateRequestID(ctx context.Context) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// use same type of request IDs as used for http
|
// use same type of request IDs as used by zerolog
|
||||||
return xid.New().String()
|
return xid.New().String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,11 +7,17 @@ package service
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s RepositoryService) GetBlob(ctx context.Context, request *rpc.GetBlobRequest) (*rpc.GetBlobResponse, error) {
|
func (s RepositoryService) GetBlob(ctx context.Context, request *rpc.GetBlobRequest) (*rpc.GetBlobResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
// TODO: do we need to validate request for nil?
|
// TODO: do we need to validate request for nil?
|
||||||
gitBlob, err := s.adapter.GetBlob(ctx, repoPath, request.GetSha(), request.GetSizeLimit())
|
gitBlob, err := s.adapter.GetBlob(ctx, repoPath, request.GetSha(), request.GetSizeLimit())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,11 +8,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/events"
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/gitea"
|
"github.com/harness/gitness/gitrpc/internal/gitea"
|
||||||
"github.com/harness/gitness/gitrpc/internal/types"
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
@ -22,20 +22,43 @@ var listBranchesRefFields = []types.GitReferenceField{types.GitReferenceFieldRef
|
|||||||
|
|
||||||
func (s ReferenceService) CreateBranch(ctx context.Context,
|
func (s ReferenceService) CreateBranch(ctx context.Context,
|
||||||
request *rpc.CreateBranchRequest) (*rpc.CreateBranchResponse, error) {
|
request *rpc.CreateBranchRequest) (*rpc.CreateBranchResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
gitBranch, err := s.adapter.CreateBranch(ctx, repoPath, request.GetBranchName(), request.GetTarget())
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
if err != nil {
|
|
||||||
return nil, processGitErrorf(err, "failed to create branch")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point the branch got created (emit event even if we'd fail to map the git branch)
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
s.eventReporter.BranchCreated(ctx, &events.BranchCreatedPayload{
|
|
||||||
RepoUID: request.RepoUid,
|
// TODO: why are we using gitea operations here?!
|
||||||
BranchName: request.BranchName,
|
repo, err := git.OpenRepository(ctx, repoPath)
|
||||||
FullRef: fmt.Sprintf("refs/heads/%s", request.BranchName),
|
if err != nil {
|
||||||
SHA: gitBranch.SHA,
|
return nil, processGitErrorf(err, "failed to open repo")
|
||||||
})
|
}
|
||||||
|
|
||||||
|
sharedRepo, err := NewSharedRepo(s.tmpDir, base.GetRepoUid(), repo)
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to create new shared repo")
|
||||||
|
}
|
||||||
|
defer sharedRepo.Close(ctx)
|
||||||
|
|
||||||
|
// clone repo
|
||||||
|
err = sharedRepo.Clone(ctx, request.GetTarget())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to clone shared repo with branch '%s'", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
|
// push to new branch (all changes should go through push flow for hooks and other safety meassures)
|
||||||
|
err = sharedRepo.Push(ctx, base, request.GetTarget(), request.GetBranchName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to push new branch '%s'", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
|
// get branch
|
||||||
|
// TODO: get it from shared repo to avoid opening another gitea repo
|
||||||
|
gitBranch, err := s.adapter.GetBranch(ctx, repoPath, request.GetBranchName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to get gitea branch '%s'", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
branch, err := mapGitBranch(gitBranch)
|
branch, err := mapGitBranch(gitBranch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -49,29 +72,59 @@ func (s ReferenceService) CreateBranch(ctx context.Context,
|
|||||||
|
|
||||||
func (s ReferenceService) DeleteBranch(ctx context.Context,
|
func (s ReferenceService) DeleteBranch(ctx context.Context,
|
||||||
request *rpc.DeleteBranchRequest) (*rpc.DeleteBranchResponse, error) {
|
request *rpc.DeleteBranchRequest) (*rpc.DeleteBranchResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
// TODO: block deletion of protected branch (in the future)
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
sha, err := s.adapter.DeleteBranch(ctx, repoPath, request.GetBranchName(), request.GetForce())
|
|
||||||
if err != nil {
|
|
||||||
return nil, processGitErrorf(err, "failed to delete branch")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point the branch got created (emit event even if we'd fail to map the git branch)
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
s.eventReporter.BranchDeleted(ctx, &events.BranchDeletedPayload{
|
|
||||||
RepoUID: request.RepoUid,
|
|
||||||
BranchName: request.BranchName,
|
|
||||||
FullRef: fmt.Sprintf("refs/heads/%s", request.BranchName),
|
|
||||||
SHA: sha,
|
|
||||||
})
|
|
||||||
|
|
||||||
return &rpc.DeleteBranchResponse{}, nil
|
// TODO: why are we using gitea operations here?!
|
||||||
|
repo, err := git.OpenRepository(ctx, repoPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to open repo")
|
||||||
|
}
|
||||||
|
|
||||||
|
sharedRepo, err := NewSharedRepo(s.tmpDir, base.GetRepoUid(), repo)
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to create new shared repo")
|
||||||
|
}
|
||||||
|
defer sharedRepo.Close(ctx)
|
||||||
|
|
||||||
|
// clone repo (technically we don't care about which branch we clone)
|
||||||
|
err = sharedRepo.Clone(ctx, request.GetBranchName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to clone shared repo with branch '%s'", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
|
// get latest branch commit before we delete
|
||||||
|
gitCommit, err := sharedRepo.GetBranchCommit(request.GetBranchName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to get gitea commit for branch '%s'", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
|
// push to new branch (all changes should go through push flow for hooks and other safety meassures)
|
||||||
|
// NOTE: setting sourceRef to empty will delete the remote branch when pushing:
|
||||||
|
// https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203
|
||||||
|
err = sharedRepo.Push(ctx, base, "", request.GetBranchName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, processGitErrorf(err, "failed to delete branch '%s' from remote repo", request.GetBranchName())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &rpc.DeleteBranchResponse{
|
||||||
|
Sha: gitCommit.ID.String(),
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ReferenceService) ListBranches(request *rpc.ListBranchesRequest,
|
func (s ReferenceService) ListBranches(request *rpc.ListBranchesRequest,
|
||||||
stream rpc.ReferenceService_ListBranchesServer) error {
|
stream rpc.ReferenceService_ListBranchesServer) error {
|
||||||
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
// get all required information from git refrences
|
// get all required information from git refrences
|
||||||
branches, err := s.listBranchesLoadReferenceData(ctx, repoPath, request)
|
branches, err := s.listBranchesLoadReferenceData(ctx, repoPath, request)
|
||||||
|
@ -17,8 +17,13 @@ import (
|
|||||||
|
|
||||||
func (s RepositoryService) ListCommits(request *rpc.ListCommitsRequest,
|
func (s RepositoryService) ListCommits(request *rpc.ListCommitsRequest,
|
||||||
stream rpc.RepositoryService_ListCommitsServer) error {
|
stream rpc.RepositoryService_ListCommitsServer) error {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
gitCommits, err := s.adapter.ListCommits(ctx, repoPath, request.GetGitRef(),
|
gitCommits, err := s.adapter.ListCommits(ctx, repoPath, request.GetGitRef(),
|
||||||
request.GetAfter(), int(request.GetPage()), int(request.GetLimit()))
|
request.GetAfter(), int(request.GetPage()), int(request.GetLimit()))
|
||||||
@ -58,7 +63,12 @@ func (s RepositoryService) getLatestCommit(ctx context.Context, repoPath string,
|
|||||||
|
|
||||||
func (s RepositoryService) GetCommitDivergences(ctx context.Context,
|
func (s RepositoryService) GetCommitDivergences(ctx context.Context,
|
||||||
request *rpc.GetCommitDivergencesRequest) (*rpc.GetCommitDivergencesResponse, error) {
|
request *rpc.GetCommitDivergencesRequest) (*rpc.GetCommitDivergencesResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
// map to gitea requests
|
// map to gitea requests
|
||||||
requests := request.GetRequests()
|
requests := request.GetRequests()
|
||||||
|
@ -30,21 +30,22 @@ func NewDiffService(adapter GitAdapter, reposRoot string) (*DiffService, error)
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s DiffService) RawDiff(req *rpc.RawDiffRequest, stream rpc.DiffService_RawDiffServer) error {
|
func (s DiffService) RawDiff(request *rpc.RawDiffRequest, stream rpc.DiffService_RawDiffServer) error {
|
||||||
err := validateDiffRequest(req)
|
err := validateDiffRequest(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
|
base := request.GetBase()
|
||||||
|
|
||||||
sw := streamio.NewWriter(func(p []byte) error {
|
sw := streamio.NewWriter(func(p []byte) error {
|
||||||
return stream.Send(&rpc.RawDiffResponse{Data: p})
|
return stream.Send(&rpc.RawDiffResponse{Data: p})
|
||||||
})
|
})
|
||||||
|
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, req.GetRepoId())
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
cmd := git.NewCommand(ctx, "diff", "--full-index", req.LeftCommitId, req.RightCommitId)
|
cmd := git.NewCommand(ctx, "diff", "--full-index", request.LeftCommitId, request.RightCommitId)
|
||||||
cmd.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))
|
cmd.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))
|
||||||
return cmd.Run(&git.RunOpts{
|
return cmd.Run(&git.RunOpts{
|
||||||
Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,
|
Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,
|
||||||
@ -54,12 +55,10 @@ func (s DiffService) RawDiff(req *rpc.RawDiffRequest, stream rpc.DiffService_Raw
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type requestWithLeftRightCommitIds interface {
|
func validateDiffRequest(in *rpc.RawDiffRequest) error {
|
||||||
GetLeftCommitId() string
|
if in.GetBase() == nil {
|
||||||
GetRightCommitId() string
|
return types.ErrBaseCannotBeEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateDiffRequest(in requestWithLeftRightCommitIds) error {
|
|
||||||
if in.GetLeftCommitId() == "" {
|
if in.GetLeftCommitId() == "" {
|
||||||
return types.ErrEmptyLeftCommitID
|
return types.ErrEmptyLeftCommitID
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,8 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EnvRepoUID = "GITNESS_REPO_UID"
|
EnvPusherName = "GITRPC_PUSHER_NAME"
|
||||||
EnvRepoName = "GITNESS_REPO_NAME"
|
EnvPusherEmail = "GITRPC_PUSHER_EMAIL"
|
||||||
EnvRepoID = "GITNESS_REPO_UID"
|
EnvRepoUID = "GITRPC_REPO_UID"
|
||||||
EnvPusherName = "GITNESS_PUSHER_NAME"
|
EnvRequestID = "GITRPC_REQUEST_ID"
|
||||||
EnvPusherID = "GITNESS_PUSHER_ID"
|
|
||||||
EnvAppURL = "GITNESS_ROOT_URL" // base url for Gitness server
|
|
||||||
EnvPusherEmail = "GITNESS_PUSHER_EMAIL"
|
|
||||||
)
|
)
|
||||||
|
@ -9,12 +9,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/streamio"
|
"github.com/harness/gitness/gitrpc/internal/streamio"
|
||||||
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
@ -23,10 +23,6 @@ import (
|
|||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
receivePack = "receive-pack"
|
|
||||||
)
|
|
||||||
|
|
||||||
var safeGitProtocolHeader = regexp.MustCompile(`^[0-9a-zA-Z]+=[0-9a-zA-Z]+(:[0-9a-zA-Z]+=[0-9a-zA-Z]+)*$`)
|
var safeGitProtocolHeader = regexp.MustCompile(`^[0-9a-zA-Z]+=[0-9a-zA-Z]+(:[0-9a-zA-Z]+=[0-9a-zA-Z]+)*$`)
|
||||||
|
|
||||||
type SmartHTTPService struct {
|
type SmartHTTPService struct {
|
||||||
@ -43,23 +39,29 @@ func NewHTTPService(adapter GitAdapter, reposRoot string) (*SmartHTTPService, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SmartHTTPService) InfoRefs(
|
func (s *SmartHTTPService) InfoRefs(
|
||||||
r *rpc.InfoRefsRequest,
|
request *rpc.InfoRefsRequest,
|
||||||
stream rpc.SmartHTTPService_InfoRefsServer,
|
stream rpc.SmartHTTPService_InfoRefsServer,
|
||||||
) error {
|
) error {
|
||||||
environ := make([]string, 0)
|
ctx := stream.Context()
|
||||||
environ = append(os.Environ(), environ...)
|
base := request.GetBase()
|
||||||
if r.GitProtocol != "" {
|
if base == nil {
|
||||||
environ = append(environ, "GIT_PROTOCOL="+r.GitProtocol)
|
return types.ErrBaseCannotBeEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, r.GetRepoUid())
|
// NOTE: Don't include os.Environ() as we don't have control over it - define everything explicitly
|
||||||
|
environ := []string{}
|
||||||
|
if request.GitProtocol != "" {
|
||||||
|
environ = append(environ, "GIT_PROTOCOL="+request.GitProtocol)
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
w := streamio.NewWriter(func(p []byte) error {
|
w := streamio.NewWriter(func(p []byte) error {
|
||||||
return stream.Send(&rpc.InfoRefsResponse{Data: p})
|
return stream.Send(&rpc.InfoRefsResponse{Data: p})
|
||||||
})
|
})
|
||||||
|
|
||||||
cmd := &bytes.Buffer{}
|
cmd := &bytes.Buffer{}
|
||||||
if err := git.NewCommand(stream.Context(), r.GetService(), "--stateless-rpc", "--advertise-refs", ".").
|
if err := git.NewCommand(ctx, request.GetService(), "--stateless-rpc", "--advertise-refs", ".").
|
||||||
Run(&git.RunOpts{
|
Run(&git.RunOpts{
|
||||||
Env: environ,
|
Env: environ,
|
||||||
Dir: repoPath,
|
Dir: repoPath,
|
||||||
@ -67,7 +69,7 @@ func (s *SmartHTTPService) InfoRefs(
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
return status.Errorf(codes.Internal, "InfoRefsUploadPack: cmd: %v", err)
|
return status.Errorf(codes.Internal, "InfoRefsUploadPack: cmd: %v", err)
|
||||||
}
|
}
|
||||||
if _, err := w.Write(packetWrite("# service=git-" + r.GetService() + "\n")); err != nil {
|
if _, err := w.Write(packetWrite("# service=git-" + request.GetService() + "\n")); err != nil {
|
||||||
return status.Errorf(codes.Internal, "InfoRefsUploadPack: pktLine: %v", err)
|
return status.Errorf(codes.Internal, "InfoRefsUploadPack: pktLine: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,20 +86,33 @@ func (s *SmartHTTPService) InfoRefs(
|
|||||||
func (s *SmartHTTPService) ServicePack(stream rpc.SmartHTTPService_ServicePackServer) error {
|
func (s *SmartHTTPService) ServicePack(stream rpc.SmartHTTPService_ServicePackServer) error {
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
// Get basic repo data
|
// Get basic repo data
|
||||||
req, err := stream.Recv()
|
request, err := stream.Recv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// if client sends data as []byte raise error, needs reader
|
// if client sends data as []byte raise error, needs reader
|
||||||
if req.Data != nil {
|
if request.GetData() != nil {
|
||||||
return status.Errorf(codes.InvalidArgument, "PostUploadPack(): non-empty Data")
|
return status.Errorf(codes.InvalidArgument, "ServicePack(): non-empty Data")
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.RepoUid == "" {
|
// ensure we have the correct base type that matches the services to be triggered
|
||||||
return status.Errorf(codes.InvalidArgument, "PostUploadPack(): repository UID is missing")
|
var repoUID string
|
||||||
|
switch request.GetService() {
|
||||||
|
case rpc.ServiceUploadPack:
|
||||||
|
if request.GetReadBase() == nil {
|
||||||
|
return status.Errorf(codes.InvalidArgument, "ServicePack(): read base is missing for upload-pack")
|
||||||
|
}
|
||||||
|
repoUID = request.GetReadBase().GetRepoUid()
|
||||||
|
case rpc.ServiceReceivePack:
|
||||||
|
if request.GetWriteBase() == nil {
|
||||||
|
return status.Errorf(codes.InvalidArgument, "ServicePack(): write base is missing for receive-pack")
|
||||||
|
}
|
||||||
|
repoUID = request.GetWriteBase().GetRepoUid()
|
||||||
|
default:
|
||||||
|
return status.Errorf(codes.InvalidArgument, "ServicePack(): unsupported service '%s'", request.GetService())
|
||||||
}
|
}
|
||||||
|
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, req.GetRepoUid())
|
repoPath := getFullPathForRepo(s.reposRoot, repoUID)
|
||||||
|
|
||||||
stdin := streamio.NewReader(func() ([]byte, error) {
|
stdin := streamio.NewReader(func() ([]byte, error) {
|
||||||
resp, streamErr := stream.Recv()
|
resp, streamErr := stream.Recv()
|
||||||
@ -108,21 +123,19 @@ func (s *SmartHTTPService) ServicePack(stream rpc.SmartHTTPService_ServicePackSe
|
|||||||
return stream.Send(&rpc.ServicePackResponse{Data: p})
|
return stream.Send(&rpc.ServicePackResponse{Data: p})
|
||||||
})
|
})
|
||||||
|
|
||||||
return serviceRPC(ctx, stdin, stdout, req, repoPath)
|
return serviceRPC(ctx, stdin, stdout, request, repoPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func serviceRPC(ctx context.Context, stdin io.Reader, stdout io.Writer, req *rpc.ServicePackRequest, dir string) error {
|
func serviceRPC(ctx context.Context, stdin io.Reader, stdout io.Writer,
|
||||||
protocol := req.GetGitProtocol()
|
request *rpc.ServicePackRequest, dir string) error {
|
||||||
service := req.GetService()
|
protocol := request.GetGitProtocol()
|
||||||
principalID := req.GetPrincipalId()
|
service := request.GetService()
|
||||||
repoUID := req.GetRepoUid()
|
|
||||||
|
|
||||||
environ := make([]string, 0)
|
// NOTE: Don't include os.Environ() as we don't have control over it - define everything explicitly
|
||||||
if service == receivePack && principalID != "" {
|
environ := []string{}
|
||||||
environ = []string{
|
if request.GetWriteBase() != nil {
|
||||||
EnvRepoUID + "=" + repoUID,
|
// in case of a write operation inject the provided environment variables
|
||||||
EnvPusherID + "=" + principalID,
|
environ = CreateEnvironmentForPush(ctx, request.GetWriteBase())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// set this for allow pre-receive and post-receive execute
|
// set this for allow pre-receive and post-receive execute
|
||||||
environ = append(environ, "SSH_ORIGINAL_COMMAND="+service)
|
environ = append(environ, "SSH_ORIGINAL_COMMAND="+service)
|
||||||
@ -138,7 +151,7 @@ func serviceRPC(ctx context.Context, stdin io.Reader, stdout io.Writer, req *rpc
|
|||||||
cmd.SetDescription(fmt.Sprintf("%s %s %s [repo_path: %s]", git.GitExecutable, service, "--stateless-rpc", dir))
|
cmd.SetDescription(fmt.Sprintf("%s %s %s [repo_path: %s]", git.GitExecutable, service, "--stateless-rpc", dir))
|
||||||
err := cmd.Run(&git.RunOpts{
|
err := cmd.Run(&git.RunOpts{
|
||||||
Dir: dir,
|
Dir: dir,
|
||||||
Env: append(os.Environ(), environ...),
|
Env: environ,
|
||||||
Stdout: stdout,
|
Stdout: stdout,
|
||||||
Stdin: stdin,
|
Stdin: stdin,
|
||||||
Stderr: &stderr,
|
Stderr: &stderr,
|
||||||
|
@ -33,6 +33,7 @@ type GitAdapter interface {
|
|||||||
GetAnnotatedTag(ctx context.Context, repoPath string, sha string) (*types.Tag, error)
|
GetAnnotatedTag(ctx context.Context, repoPath string, sha string) (*types.Tag, error)
|
||||||
GetAnnotatedTags(ctx context.Context, repoPath string, shas []string) ([]types.Tag, error)
|
GetAnnotatedTags(ctx context.Context, repoPath string, shas []string) ([]types.Tag, error)
|
||||||
CreateBranch(ctx context.Context, repoPath string, branchName string, target string) (*types.Branch, error)
|
CreateBranch(ctx context.Context, repoPath string, branchName string, target string) (*types.Branch, error)
|
||||||
|
GetBranch(ctx context.Context, repoPath string, branchName string) (*types.Branch, error)
|
||||||
DeleteBranch(ctx context.Context, repoPath string, branchName string, force bool) (string, error)
|
DeleteBranch(ctx context.Context, repoPath string, branchName string, force bool) (string, error)
|
||||||
GetCommitDivergences(ctx context.Context, repoPath string,
|
GetCommitDivergences(ctx context.Context, repoPath string,
|
||||||
requests []types.CommitDivergenceRequest, max int32) ([]types.CommitDivergence, error)
|
requests []types.CommitDivergenceRequest, max int32) ([]types.CommitDivergence, error)
|
||||||
|
@ -48,6 +48,7 @@ func NewCommitFilesService(adapter GitAdapter, reposRoot, reposTempDir string) (
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:funlen // needs refactoring
|
||||||
func (s *CommitFilesService) CommitFiles(stream rpc.CommitFilesService_CommitFilesServer) error {
|
func (s *CommitFilesService) CommitFiles(stream rpc.CommitFilesService_CommitFilesServer) error {
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
headerRequest, err := stream.Recv()
|
headerRequest, err := stream.Recv()
|
||||||
@ -60,9 +61,21 @@ func (s *CommitFilesService) CommitFiles(stream rpc.CommitFilesService_CommitFil
|
|||||||
return types.ErrHeaderCannotBeEmpty
|
return types.ErrHeaderCannotBeEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
author, committer := GetAuthorAndCommitter(header.Author, header.Committer)
|
base := header.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, header.GetRepoUid())
|
committer := base.GetActor()
|
||||||
|
author := header.GetAuthor()
|
||||||
|
// in case no explicit author is provided use actor as author.
|
||||||
|
if author == nil {
|
||||||
|
author = committer
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
|
// TODO: why are we using the giteat operations here?
|
||||||
repo, err := git.OpenRepository(ctx, repoPath)
|
repo, err := git.OpenRepository(ctx, repoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -78,7 +91,7 @@ func (s *CommitFilesService) CommitFiles(stream rpc.CommitFilesService_CommitFil
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create a shared repo
|
// create a shared repo
|
||||||
shared, err := NewSharedRepo(s.reposTempDir, header.GetRepoUid(), repo)
|
shared, err := NewSharedRepo(s.reposTempDir, base.GetRepoUid(), repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -117,7 +130,7 @@ func (s *CommitFilesService) CommitFiles(stream rpc.CommitFilesService_CommitFil
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = shared.Push(ctx, author, commitHash, header.GetNewBranchName()); err != nil {
|
if err = shared.Push(ctx, base, commitHash, header.GetNewBranchName()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,20 +457,3 @@ func parsePayload(payload io.Reader, content io.Writer) (string, error) {
|
|||||||
_, err := io.Copy(content, reader)
|
_, err := io.Copy(content, reader)
|
||||||
return newPath, err
|
return newPath, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAuthorAndCommitter Gets the author and committer user objects from the Identity.
|
|
||||||
func GetAuthorAndCommitter(author, committer *rpc.Identity) (authorUser, committerUser *rpc.Identity) {
|
|
||||||
authorUser = author
|
|
||||||
committerUser = committer
|
|
||||||
if author == nil && committer == nil {
|
|
||||||
authorUser = SystemIdentity
|
|
||||||
committer = SystemIdentity
|
|
||||||
}
|
|
||||||
if author == nil && committer != nil {
|
|
||||||
authorUser = committer
|
|
||||||
}
|
|
||||||
if committer == nil && author != nil {
|
|
||||||
committerUser = author
|
|
||||||
}
|
|
||||||
return authorUser, committerUser
|
|
||||||
}
|
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/events"
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/types"
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
@ -21,16 +20,16 @@ import (
|
|||||||
type ReferenceService struct {
|
type ReferenceService struct {
|
||||||
rpc.UnimplementedReferenceServiceServer
|
rpc.UnimplementedReferenceServiceServer
|
||||||
adapter GitAdapter
|
adapter GitAdapter
|
||||||
eventReporter *events.Reporter
|
|
||||||
reposRoot string
|
reposRoot string
|
||||||
|
tmpDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewReferenceService(adapter GitAdapter, eventReporter *events.Reporter,
|
func NewReferenceService(adapter GitAdapter,
|
||||||
reposRoot string) (*ReferenceService, error) {
|
reposRoot string, tmpDir string) (*ReferenceService, error) {
|
||||||
return &ReferenceService{
|
return &ReferenceService{
|
||||||
adapter: adapter,
|
adapter: adapter,
|
||||||
reposRoot: reposRoot,
|
reposRoot: reposRoot,
|
||||||
eventReporter: eventReporter,
|
tmpDir: tmpDir,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +179,12 @@ func wrapInstructorWithOptionalPagination(inner types.WalkReferencesInstructor,
|
|||||||
|
|
||||||
func (s ReferenceService) GetRef(ctx context.Context,
|
func (s ReferenceService) GetRef(ctx context.Context,
|
||||||
request *rpc.GetRefRequest) (*rpc.GetRefResponse, error) {
|
request *rpc.GetRefRequest) (*rpc.GetRefResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
var refType types.RefType
|
var refType types.RefType
|
||||||
switch request.RefType {
|
switch request.RefType {
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/types"
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
@ -26,14 +27,18 @@ const (
|
|||||||
|
|
||||||
gitReferenceNamePrefixBranch = "refs/heads/"
|
gitReferenceNamePrefixBranch = "refs/heads/"
|
||||||
gitReferenceNamePrefixTag = "refs/tags/"
|
gitReferenceNamePrefixTag = "refs/tags/"
|
||||||
|
|
||||||
|
gitHooksDir = "hooks"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: Should be matching the sytem identity from config.
|
// TODO: should be coming from caller ALWAYS.
|
||||||
SystemIdentity = &rpc.Identity{
|
SystemIdentity = &rpc.Identity{
|
||||||
Name: "gitness",
|
Name: "gitness",
|
||||||
Email: "system@gitness",
|
Email: "system@gitness",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitServerHookNames = []string{"pre-receive", "update", "post-receive"}
|
||||||
)
|
)
|
||||||
|
|
||||||
type Storage interface {
|
type Storage interface {
|
||||||
@ -45,34 +50,42 @@ type RepositoryService struct {
|
|||||||
adapter GitAdapter
|
adapter GitAdapter
|
||||||
store Storage
|
store Storage
|
||||||
reposRoot string
|
reposRoot string
|
||||||
|
serverHookPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRepositoryService(adapter GitAdapter, store Storage, reposRoot string) (*RepositoryService, error) {
|
func NewRepositoryService(adapter GitAdapter, store Storage, reposRoot string,
|
||||||
|
serverHookPath string) (*RepositoryService, error) {
|
||||||
return &RepositoryService{
|
return &RepositoryService{
|
||||||
adapter: adapter,
|
adapter: adapter,
|
||||||
store: store,
|
store: store,
|
||||||
reposRoot: reposRoot,
|
reposRoot: reposRoot,
|
||||||
|
serverHookPath: serverHookPath,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:gocognit // need to refactor this code
|
//nolint:gocognit,funlen // need to refactor this code
|
||||||
func (s RepositoryService) CreateRepository(stream rpc.RepositoryService_CreateRepositoryServer) error {
|
func (s RepositoryService) CreateRepository(stream rpc.RepositoryService_CreateRepositoryServer) error {
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
log := log.Ctx(ctx)
|
log := log.Ctx(ctx)
|
||||||
|
|
||||||
// first get repo params from stream
|
// first get repo params from stream
|
||||||
req, err := stream.Recv()
|
request, err := stream.Recv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return status.Errorf(codes.Internal, "cannot receive create repository data")
|
return status.Errorf(codes.Internal, "cannot receive create repository data")
|
||||||
}
|
}
|
||||||
|
|
||||||
header := req.GetHeader()
|
header := request.GetHeader()
|
||||||
if header == nil {
|
if header == nil {
|
||||||
return status.Errorf(codes.Internal, "expected header to be first message in stream")
|
return status.Errorf(codes.Internal, "expected header to be first message in stream")
|
||||||
}
|
}
|
||||||
log.Info().Msgf("received a create repository request %v", header)
|
log.Info().Msgf("received a create repository request %v", header)
|
||||||
|
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, header.GetUid())
|
base := header.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
if _, err = os.Stat(repoPath); !os.IsNotExist(err) {
|
if _, err = os.Stat(repoPath); !os.IsNotExist(err) {
|
||||||
return status.Errorf(codes.AlreadyExists, "repository exists already: %v", repoPath)
|
return status.Errorf(codes.AlreadyExists, "repository exists already: %v", repoPath)
|
||||||
}
|
}
|
||||||
@ -92,13 +105,13 @@ func (s RepositoryService) CreateRepository(stream rpc.RepositoryService_CreateR
|
|||||||
// update default branch (currently set to non-existent branch)
|
// update default branch (currently set to non-existent branch)
|
||||||
err = s.adapter.SetDefaultBranch(ctx, repoPath, header.GetDefaultBranch(), true)
|
err = s.adapter.SetDefaultBranch(ctx, repoPath, header.GetDefaultBranch(), true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return processGitErrorf(err, "error updating default branch for repo '%s'", header.GetUid())
|
return processGitErrorf(err, "error updating default branch for repo '%s'", base.GetRepoUid())
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need temp dir for cloning
|
// we need temp dir for cloning
|
||||||
tempDir, err := os.MkdirTemp("", "*-"+header.GetUid())
|
tempDir, err := os.MkdirTemp("", "*-"+base.GetRepoUid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating temp dir for repo %s: %w", header.GetUid(), err)
|
return fmt.Errorf("error creating temp dir for repo %s: %w", base.GetRepoUid(), err)
|
||||||
}
|
}
|
||||||
defer func(path string) {
|
defer func(path string) {
|
||||||
// when repo is successfully created remove temp dir
|
// when repo is successfully created remove temp dir
|
||||||
@ -144,6 +157,16 @@ func (s RepositoryService) CreateRepository(stream rpc.RepositoryService_CreateR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setup server hook symlinks pointing to configured server hook binary
|
||||||
|
for _, hook := range gitServerHookNames {
|
||||||
|
hookPath := path.Join(repoPath, gitHooksDir, hook)
|
||||||
|
err = os.Symlink(s.serverHookPath, hookPath)
|
||||||
|
if err != nil {
|
||||||
|
return status.Errorf(codes.Internal,
|
||||||
|
"failed to setup symlink for hook '%s' ('%s' -> '%s'): %s", hook, hookPath, s.serverHookPath, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res := &rpc.CreateRepositoryResponse{}
|
res := &rpc.CreateRepositoryResponse{}
|
||||||
err = stream.SendAndClose(res)
|
err = stream.SendAndClose(res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -10,11 +10,11 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/gitrpc/internal/middleware"
|
||||||
"github.com/harness/gitness/gitrpc/internal/tempdir"
|
"github.com/harness/gitness/gitrpc/internal/tempdir"
|
||||||
"github.com/harness/gitness/gitrpc/internal/types"
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
@ -28,20 +28,19 @@ type SharedRepo struct {
|
|||||||
repoUID string
|
repoUID string
|
||||||
repo *git.Repository
|
repo *git.Repository
|
||||||
remoteRepo *git.Repository
|
remoteRepo *git.Repository
|
||||||
TempBaseDir string
|
tmpPath string
|
||||||
basePath string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSharedRepo creates a new temporary upload repository.
|
// NewSharedRepo creates a new temporary upload repository.
|
||||||
func NewSharedRepo(tempDir, repoUID string, remoteRepo *git.Repository) (*SharedRepo, error) {
|
func NewSharedRepo(baseTmpDir, repoUID string, remoteRepo *git.Repository) (*SharedRepo, error) {
|
||||||
basePath, err := tempdir.CreateTemporaryPath(tempDir, repoUID)
|
tmpPath, err := tempdir.CreateTemporaryPath(baseTmpDir, repoUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
t := &SharedRepo{
|
t := &SharedRepo{
|
||||||
repoUID: repoUID,
|
repoUID: repoUID,
|
||||||
remoteRepo: remoteRepo,
|
remoteRepo: remoteRepo,
|
||||||
basePath: basePath,
|
tmpPath: tmpPath,
|
||||||
}
|
}
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
@ -49,15 +48,15 @@ func NewSharedRepo(tempDir, repoUID string, remoteRepo *git.Repository) (*Shared
|
|||||||
// Close the repository cleaning up all files.
|
// Close the repository cleaning up all files.
|
||||||
func (r *SharedRepo) Close(ctx context.Context) {
|
func (r *SharedRepo) Close(ctx context.Context) {
|
||||||
defer r.repo.Close()
|
defer r.repo.Close()
|
||||||
if err := tempdir.RemoveTemporaryPath(r.basePath); err != nil {
|
if err := tempdir.RemoveTemporaryPath(r.tmpPath); err != nil {
|
||||||
log.Ctx(ctx).Err(err).Msgf("Failed to remove temporary path %s", r.basePath)
|
log.Ctx(ctx).Err(err).Msgf("Failed to remove temporary path %s", r.tmpPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone the base repository to our path and set branch as the HEAD.
|
// Clone the base repository to our path and set branch as the HEAD.
|
||||||
func (r *SharedRepo) Clone(ctx context.Context, branch string) error {
|
func (r *SharedRepo) Clone(ctx context.Context, branch string) error {
|
||||||
if _, _, err := git.NewCommand(ctx, "clone", "-s", "--bare", "-b",
|
if _, _, err := git.NewCommand(ctx, "clone", "-s", "--bare", "-b",
|
||||||
branch, r.remoteRepo.Path, r.basePath).RunStdString(nil); err != nil {
|
branch, r.remoteRepo.Path, r.tmpPath).RunStdString(nil); err != nil {
|
||||||
stderr := err.Error()
|
stderr := err.Error()
|
||||||
if matched, _ := regexp.MatchString(".*Remote branch .* not found in upstream origin.*", stderr); matched {
|
if matched, _ := regexp.MatchString(".*Remote branch .* not found in upstream origin.*", stderr); matched {
|
||||||
return git.ErrBranchNotExist{
|
return git.ErrBranchNotExist{
|
||||||
@ -69,7 +68,7 @@ func (r *SharedRepo) Clone(ctx context.Context, branch string) error {
|
|||||||
return fmt.Errorf("Clone: %w %s", err, stderr)
|
return fmt.Errorf("Clone: %w %s", err, stderr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gitRepo, err := git.OpenRepository(ctx, r.basePath)
|
gitRepo, err := git.OpenRepository(ctx, r.tmpPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -79,10 +78,10 @@ func (r *SharedRepo) Clone(ctx context.Context, branch string) error {
|
|||||||
|
|
||||||
// Init the repository.
|
// Init the repository.
|
||||||
func (r *SharedRepo) Init(ctx context.Context) error {
|
func (r *SharedRepo) Init(ctx context.Context) error {
|
||||||
if err := git.InitRepository(ctx, r.basePath, false); err != nil {
|
if err := git.InitRepository(ctx, r.tmpPath, false); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
gitRepo, err := git.OpenRepository(ctx, r.basePath)
|
gitRepo, err := git.OpenRepository(ctx, r.tmpPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -92,7 +91,7 @@ func (r *SharedRepo) Init(ctx context.Context) error {
|
|||||||
|
|
||||||
// SetDefaultIndex sets the git index to our HEAD.
|
// SetDefaultIndex sets the git index to our HEAD.
|
||||||
func (r *SharedRepo) SetDefaultIndex(ctx context.Context) error {
|
func (r *SharedRepo) SetDefaultIndex(ctx context.Context) error {
|
||||||
if _, _, err := git.NewCommand(ctx, "read-tree", "HEAD").RunStdString(&git.RunOpts{Dir: r.basePath}); err != nil {
|
if _, _, err := git.NewCommand(ctx, "read-tree", "HEAD").RunStdString(&git.RunOpts{Dir: r.tmpPath}); err != nil {
|
||||||
return fmt.Errorf("SetDefaultIndex: %w", err)
|
return fmt.Errorf("SetDefaultIndex: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -112,7 +111,7 @@ func (r *SharedRepo) LsFiles(ctx context.Context, filenames ...string) ([]string
|
|||||||
|
|
||||||
if err := git.NewCommand(ctx, cmdArgs...).
|
if err := git.NewCommand(ctx, cmdArgs...).
|
||||||
Run(&git.RunOpts{
|
Run(&git.RunOpts{
|
||||||
Dir: r.basePath,
|
Dir: r.tmpPath,
|
||||||
Stdout: stdOut,
|
Stdout: stdOut,
|
||||||
Stderr: stdErr,
|
Stderr: stdErr,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@ -144,7 +143,7 @@ func (r *SharedRepo) RemoveFilesFromIndex(ctx context.Context, filenames ...stri
|
|||||||
|
|
||||||
if err := git.NewCommand(ctx, "update-index", "--remove", "-z", "--index-info").
|
if err := git.NewCommand(ctx, "update-index", "--remove", "-z", "--index-info").
|
||||||
Run(&git.RunOpts{
|
Run(&git.RunOpts{
|
||||||
Dir: r.basePath,
|
Dir: r.tmpPath,
|
||||||
Stdin: stdIn,
|
Stdin: stdIn,
|
||||||
Stdout: stdOut,
|
Stdout: stdOut,
|
||||||
Stderr: stdErr,
|
Stderr: stdErr,
|
||||||
@ -162,7 +161,7 @@ func (r *SharedRepo) HashObject(ctx context.Context, content io.Reader) (string,
|
|||||||
|
|
||||||
if err := git.NewCommand(ctx, "hash-object", "-w", "--stdin").
|
if err := git.NewCommand(ctx, "hash-object", "-w", "--stdin").
|
||||||
Run(&git.RunOpts{
|
Run(&git.RunOpts{
|
||||||
Dir: r.basePath,
|
Dir: r.tmpPath,
|
||||||
Stdin: content,
|
Stdin: content,
|
||||||
Stdout: stdOut,
|
Stdout: stdOut,
|
||||||
Stderr: stdErr,
|
Stderr: stdErr,
|
||||||
@ -192,7 +191,7 @@ func (r *SharedRepo) ShowFile(ctx context.Context, filePath, commitHash string,
|
|||||||
// AddObjectToIndex adds the provided object hash to the index with the provided mode and path.
|
// AddObjectToIndex adds the provided object hash to the index with the provided mode and path.
|
||||||
func (r *SharedRepo) AddObjectToIndex(ctx context.Context, mode, objectHash, objectPath string) error {
|
func (r *SharedRepo) AddObjectToIndex(ctx context.Context, mode, objectHash, objectPath string) error {
|
||||||
if _, _, err := git.NewCommand(ctx, "update-index", "--add", "--replace", "--cacheinfo", mode, objectHash,
|
if _, _, err := git.NewCommand(ctx, "update-index", "--add", "--replace", "--cacheinfo", mode, objectHash,
|
||||||
objectPath).RunStdString(&git.RunOpts{Dir: r.basePath}); err != nil {
|
objectPath).RunStdString(&git.RunOpts{Dir: r.tmpPath}); err != nil {
|
||||||
if matched, _ := regexp.MatchString(".*Invalid path '.*", err.Error()); matched {
|
if matched, _ := regexp.MatchString(".*Invalid path '.*", err.Error()); matched {
|
||||||
return types.ErrInvalidPath
|
return types.ErrInvalidPath
|
||||||
}
|
}
|
||||||
@ -204,7 +203,7 @@ func (r *SharedRepo) AddObjectToIndex(ctx context.Context, mode, objectHash, obj
|
|||||||
|
|
||||||
// WriteTree writes the current index as a tree to the object db and returns its hash.
|
// WriteTree writes the current index as a tree to the object db and returns its hash.
|
||||||
func (r *SharedRepo) WriteTree(ctx context.Context) (string, error) {
|
func (r *SharedRepo) WriteTree(ctx context.Context) (string, error) {
|
||||||
stdout, _, err := git.NewCommand(ctx, "write-tree").RunStdString(&git.RunOpts{Dir: r.basePath})
|
stdout, _, err := git.NewCommand(ctx, "write-tree").RunStdString(&git.RunOpts{Dir: r.tmpPath})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("unable to write-tree in temporary repo for: %s Error: %w",
|
return "", fmt.Errorf("unable to write-tree in temporary repo for: %s Error: %w",
|
||||||
r.repoUID, err)
|
r.repoUID, err)
|
||||||
@ -222,7 +221,7 @@ func (r *SharedRepo) GetLastCommitByRef(ctx context.Context, ref string) (string
|
|||||||
if ref == "" {
|
if ref == "" {
|
||||||
ref = "HEAD"
|
ref = "HEAD"
|
||||||
}
|
}
|
||||||
stdout, _, err := git.NewCommand(ctx, "rev-parse", ref).RunStdString(&git.RunOpts{Dir: r.basePath})
|
stdout, _, err := git.NewCommand(ctx, "rev-parse", ref).RunStdString(&git.RunOpts{Dir: r.tmpPath})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("unable to rev-parse %s in temporary repo for: %s Error: %w",
|
return "", fmt.Errorf("unable to rev-parse %s in temporary repo for: %s Error: %w",
|
||||||
ref, r.repoUID, err)
|
ref, r.repoUID, err)
|
||||||
@ -245,20 +244,16 @@ func (r *SharedRepo) CommitTreeWithDate(
|
|||||||
signoff bool,
|
signoff bool,
|
||||||
authorDate, committerDate time.Time,
|
authorDate, committerDate time.Time,
|
||||||
) (string, error) {
|
) (string, error) {
|
||||||
committerSig := &git.Signature{
|
// setup environment variables used by git-commit-tree
|
||||||
Name: committer.Name,
|
// See https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
|
||||||
Email: committer.Email,
|
env := []string{
|
||||||
When: time.Now(),
|
"GIT_AUTHOR_NAME=" + author.Name,
|
||||||
|
"GIT_AUTHOR_EMAIL=" + author.Email,
|
||||||
|
"GIT_AUTHOR_DATE=" + authorDate.Format(time.RFC3339),
|
||||||
|
"GIT_COMMITTER_NAME=" + committer.Name,
|
||||||
|
"GIT_COMMITTER_EMAIL=" + committer.Email,
|
||||||
|
"GIT_COMMITTER_DATE=" + committerDate.Format(time.RFC3339),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Because this may call hooks we should pass in the environment
|
|
||||||
env := append(os.Environ(),
|
|
||||||
"GIT_AUTHOR_NAME="+author.Name,
|
|
||||||
"GIT_AUTHOR_EMAIL="+author.Email,
|
|
||||||
"GIT_AUTHOR_DATE="+authorDate.Format(time.RFC3339),
|
|
||||||
"GIT_COMMITTER_DATE="+committerDate.Format(time.RFC3339),
|
|
||||||
)
|
|
||||||
|
|
||||||
messageBytes := new(bytes.Buffer)
|
messageBytes := new(bytes.Buffer)
|
||||||
_, _ = messageBytes.WriteString(message)
|
_, _ = messageBytes.WriteString(message)
|
||||||
_, _ = messageBytes.WriteString("\n")
|
_, _ = messageBytes.WriteString("\n")
|
||||||
@ -274,23 +269,23 @@ func (r *SharedRepo) CommitTreeWithDate(
|
|||||||
args = append(args, "--no-gpg-sign")
|
args = append(args, "--no-gpg-sign")
|
||||||
|
|
||||||
if signoff {
|
if signoff {
|
||||||
|
giteaSignature := &git.Signature{
|
||||||
|
Name: committer.Name,
|
||||||
|
Email: committer.Email,
|
||||||
|
When: committerDate,
|
||||||
|
}
|
||||||
// Signed-off-by
|
// Signed-off-by
|
||||||
_, _ = messageBytes.WriteString("\n")
|
_, _ = messageBytes.WriteString("\n")
|
||||||
_, _ = messageBytes.WriteString("Signed-off-by: ")
|
_, _ = messageBytes.WriteString("Signed-off-by: ")
|
||||||
_, _ = messageBytes.WriteString(committerSig.String())
|
_, _ = messageBytes.WriteString(giteaSignature.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
env = append(env,
|
|
||||||
"GIT_COMMITTER_NAME="+committerSig.Name,
|
|
||||||
"GIT_COMMITTER_EMAIL="+committerSig.Email,
|
|
||||||
)
|
|
||||||
|
|
||||||
stdout := new(bytes.Buffer)
|
stdout := new(bytes.Buffer)
|
||||||
stderr := new(bytes.Buffer)
|
stderr := new(bytes.Buffer)
|
||||||
if err := git.NewCommand(ctx, args...).
|
if err := git.NewCommand(ctx, args...).
|
||||||
Run(&git.RunOpts{
|
Run(&git.RunOpts{
|
||||||
Env: env,
|
Env: env,
|
||||||
Dir: r.basePath,
|
Dir: r.tmpPath,
|
||||||
Stdin: messageBytes,
|
Stdin: messageBytes,
|
||||||
Stdout: stdout,
|
Stdout: stdout,
|
||||||
Stderr: stderr,
|
Stderr: stderr,
|
||||||
@ -302,13 +297,12 @@ func (r *SharedRepo) CommitTreeWithDate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Push the provided commitHash to the repository branch by the provided user.
|
// Push the provided commitHash to the repository branch by the provided user.
|
||||||
func (r *SharedRepo) Push(ctx context.Context, doer *rpc.Identity, commitHash, branch string) error {
|
func (r *SharedRepo) Push(ctx context.Context, writeRequest *rpc.WriteRequest, sourceRef, branch string) error {
|
||||||
// Because calls hooks we need to pass in the environment
|
// Because calls hooks we need to pass in the environment
|
||||||
author, committer := doer, doer
|
env := CreateEnvironmentForPush(ctx, writeRequest)
|
||||||
env := PushingEnvironment(author, committer, r.repoUID)
|
if err := git.Push(ctx, r.tmpPath, git.PushOptions{
|
||||||
if err := git.Push(ctx, r.basePath, git.PushOptions{
|
|
||||||
Remote: r.remoteRepo.Path,
|
Remote: r.remoteRepo.Path,
|
||||||
Branch: strings.TrimSpace(commitHash) + ":" + git.BranchPrefix + strings.TrimSpace(branch),
|
Branch: strings.TrimSpace(sourceRef) + ":" + gitReferenceNamePrefixBranch + strings.TrimSpace(branch),
|
||||||
Env: env,
|
Env: env,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
if git.IsErrPushOutOfDate(err) {
|
if git.IsErrPushOutOfDate(err) {
|
||||||
@ -318,12 +312,12 @@ func (r *SharedRepo) Push(ctx context.Context, doer *rpc.Identity, commitHash, b
|
|||||||
if errors.As(err, &rejectErr) {
|
if errors.As(err, &rejectErr) {
|
||||||
log.Ctx(ctx).Info().Msgf("Unable to push back to repo from temporary repo due to rejection:"+
|
log.Ctx(ctx).Info().Msgf("Unable to push back to repo from temporary repo due to rejection:"+
|
||||||
" %s (%s)\nStdout: %s\nStderr: %s\nError: %v",
|
" %s (%s)\nStdout: %s\nStderr: %s\nError: %v",
|
||||||
r.repoUID, r.basePath, rejectErr.StdOut, rejectErr.StdErr, rejectErr.Err)
|
r.repoUID, r.tmpPath, rejectErr.StdOut, rejectErr.StdErr, rejectErr.Err)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return fmt.Errorf("unable to push back to repo from temporary repo: %s (%s) Error: %w",
|
return fmt.Errorf("unable to push back to repo from temporary repo: %s (%s) Error: %w",
|
||||||
r.repoUID, r.basePath, err)
|
r.repoUID, r.tmpPath, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -344,32 +338,24 @@ func (r *SharedRepo) GetCommit(commitID string) (*git.Commit, error) {
|
|||||||
return r.repo.GetCommit(commitID)
|
return r.repo.GetCommit(commitID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PushingEnvironment returns an os environment to allow hooks to work on push.
|
// ASSUMPTION: writeRequst and writeRequst.Actor is never nil.
|
||||||
func PushingEnvironment(
|
func CreateEnvironmentForPush(ctx context.Context, writeRequest *rpc.WriteRequest) []string {
|
||||||
author,
|
// don't send existing environment variables (os.Environ()), only send what's explicitly necessary.
|
||||||
committer *rpc.Identity,
|
// Otherwise we create implicit dependencies that are easy to break.
|
||||||
repoUID string,
|
environ := []string{
|
||||||
) []string {
|
// request id to use for hooks
|
||||||
authorSig := &git.Signature{
|
EnvRequestID + "=" + middleware.RequestIDFrom(ctx),
|
||||||
Name: author.Name,
|
// repo related info
|
||||||
Email: author.Email,
|
EnvRepoUID + "=" + writeRequest.RepoUid,
|
||||||
}
|
// pusher related info
|
||||||
committerSig := &git.Signature{
|
EnvPusherName + "=" + writeRequest.Actor.Name,
|
||||||
Name: committer.Name,
|
EnvPusherEmail + "=" + writeRequest.Actor.Email,
|
||||||
Email: committer.Email,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
environ := append(os.Environ(),
|
// add all environment variables coming from client
|
||||||
"GIT_AUTHOR_NAME="+authorSig.Name,
|
for _, envVar := range writeRequest.EnvVars {
|
||||||
"GIT_AUTHOR_EMAIL="+authorSig.Email,
|
environ = append(environ, fmt.Sprintf("%s=%s", envVar.Name, envVar.Value))
|
||||||
"GIT_COMMITTER_NAME="+committerSig.Name,
|
}
|
||||||
"GIT_COMMITTER_EMAIL="+committerSig.Email,
|
|
||||||
// important env vars for hooks
|
|
||||||
EnvPusherName+"="+committer.Name,
|
|
||||||
// EnvPusherID+"="+fmt.Sprintf("%d", committer.ID),
|
|
||||||
EnvRepoID+"="+repoUID,
|
|
||||||
EnvAppURL+"=", // app url
|
|
||||||
)
|
|
||||||
|
|
||||||
return environ
|
return environ
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,18 @@ package service
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s RepositoryService) GetSubmodule(ctx context.Context,
|
func (s RepositoryService) GetSubmodule(ctx context.Context,
|
||||||
request *rpc.GetSubmoduleRequest) (*rpc.GetSubmoduleResponse, error) {
|
request *rpc.GetSubmoduleRequest) (*rpc.GetSubmoduleResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
// TODO: do we need to validate request for nil?
|
// TODO: do we need to validate request for nil?
|
||||||
gitSubmodule, err := s.adapter.GetSubmodule(ctx, repoPath, request.GetGitRef(), request.GetPath())
|
gitSubmodule, err := s.adapter.GetSubmodule(ctx, repoPath, request.GetGitRef(), request.GetPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -20,7 +20,12 @@ import (
|
|||||||
func (s ReferenceService) ListCommitTags(request *rpc.ListCommitTagsRequest,
|
func (s ReferenceService) ListCommitTags(request *rpc.ListCommitTagsRequest,
|
||||||
stream rpc.ReferenceService_ListCommitTagsServer) error {
|
stream rpc.ReferenceService_ListCommitTagsServer) error {
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
// get all required information from git references
|
// get all required information from git references
|
||||||
tags, err := s.listCommitTagsLoadReferenceData(ctx, repoPath, request)
|
tags, err := s.listCommitTagsLoadReferenceData(ctx, repoPath, request)
|
||||||
|
@ -7,6 +7,7 @@ package service
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/gitrpc/internal/types"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@ -17,7 +18,12 @@ import (
|
|||||||
func (s RepositoryService) ListTreeNodes(request *rpc.ListTreeNodesRequest,
|
func (s RepositoryService) ListTreeNodes(request *rpc.ListTreeNodesRequest,
|
||||||
stream rpc.RepositoryService_ListTreeNodesServer) error {
|
stream rpc.RepositoryService_ListTreeNodesServer) error {
|
||||||
ctx := stream.Context()
|
ctx := stream.Context()
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
|
|
||||||
gitNodes, err := s.adapter.ListTreeNodes(ctx, repoPath,
|
gitNodes, err := s.adapter.ListTreeNodes(ctx, repoPath,
|
||||||
request.GetGitRef(), request.GetPath(), request.GetRecursive(), request.GetIncludeLatestCommit())
|
request.GetGitRef(), request.GetPath(), request.GetRecursive(), request.GetIncludeLatestCommit())
|
||||||
@ -56,7 +62,12 @@ func (s RepositoryService) ListTreeNodes(request *rpc.ListTreeNodesRequest,
|
|||||||
|
|
||||||
func (s RepositoryService) GetTreeNode(ctx context.Context,
|
func (s RepositoryService) GetTreeNode(ctx context.Context,
|
||||||
request *rpc.GetTreeNodeRequest) (*rpc.GetTreeNodeResponse, error) {
|
request *rpc.GetTreeNodeRequest) (*rpc.GetTreeNodeResponse, error) {
|
||||||
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
|
base := request.GetBase()
|
||||||
|
if base == nil {
|
||||||
|
return nil, types.ErrBaseCannotBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid())
|
||||||
// TODO: do we need to validate request for nil?
|
// TODO: do we need to validate request for nil?
|
||||||
gitNode, err := s.adapter.GetTreeNode(ctx, repoPath, request.GetGitRef(), request.GetPath())
|
gitNode, err := s.adapter.GetTreeNode(ctx, repoPath, request.GetGitRef(), request.GetPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -15,6 +15,7 @@ var (
|
|||||||
ErrContentSentBeforeAction = errors.New("content sent before action")
|
ErrContentSentBeforeAction = errors.New("content sent before action")
|
||||||
ErrActionListEmpty = errors.New("no commit actions to perform on repository")
|
ErrActionListEmpty = errors.New("no commit actions to perform on repository")
|
||||||
ErrHeaderCannotBeEmpty = errors.New("header field cannot be empty")
|
ErrHeaderCannotBeEmpty = errors.New("header field cannot be empty")
|
||||||
|
ErrBaseCannotBeEmpty = errors.New("base field cannot be empty")
|
||||||
ErrSHADoesNotMatch = errors.New("sha does not match")
|
ErrSHADoesNotMatch = errors.New("sha does not match")
|
||||||
ErrEmptyLeftCommitID = errors.New("empty LeftCommitId")
|
ErrEmptyLeftCommitID = errors.New("empty LeftCommitId")
|
||||||
ErrEmptyRightCommitID = errors.New("empty RightCommitId")
|
ErrEmptyRightCommitID = errors.New("empty RightCommitId")
|
||||||
|
@ -9,11 +9,12 @@ import (
|
|||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
|
|
||||||
"github.com/rs/zerolog/hlog"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type requestIDKey struct{}
|
||||||
|
|
||||||
// ClientLogInterceptor injects the zerlog request ID into the metadata.
|
// ClientLogInterceptor injects the zerlog request ID into the metadata.
|
||||||
// That allows the gitrpc server to log with the same request ID as the client.
|
// That allows the gitrpc server to log with the same request ID as the client.
|
||||||
type ClientLogInterceptor struct {
|
type ClientLogInterceptor struct {
|
||||||
@ -39,10 +40,23 @@ func (i ClientLogInterceptor) StreamClientInterceptor() grpc.StreamClientInterce
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithRequestID returns a copy of parent in which the request id value is set.
|
||||||
|
// This can be used by external entities to pass request IDs to gitrpc.
|
||||||
|
func WithRequestID(parent context.Context, v string) context.Context {
|
||||||
|
return context.WithValue(parent, requestIDKey{}, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RequestIDFrom returns the value of the request ID key on the
|
||||||
|
// context - ok is true iff a non-empty value existed.
|
||||||
|
func RequestIDFrom(ctx context.Context) (string, bool) {
|
||||||
|
v, ok := ctx.Value(requestIDKey{}).(string)
|
||||||
|
return v, ok && v != ""
|
||||||
|
}
|
||||||
|
|
||||||
// appendLoggingRequestIDToOutgoingMetadata appends the zerolog request ID to the outgoing grpc metadata, if available.
|
// appendLoggingRequestIDToOutgoingMetadata appends the zerolog request ID to the outgoing grpc metadata, if available.
|
||||||
func appendLoggingRequestIDToOutgoingMetadata(ctx context.Context) context.Context {
|
func appendLoggingRequestIDToOutgoingMetadata(ctx context.Context) context.Context {
|
||||||
if id, ok := hlog.IDFromCtx(ctx); ok {
|
if id, ok := RequestIDFrom(ctx); ok {
|
||||||
ctx = metadata.AppendToOutgoingContext(ctx, rpc.MetadataKeyRequestID, id.String())
|
ctx = metadata.AppendToOutgoingContext(ctx, rpc.MetadataKeyRequestID, id)
|
||||||
}
|
}
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ListCommitsParams struct {
|
type ListCommitsParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
// GitREF is a git reference (branch / tag / commit SHA)
|
// GitREF is a git reference (branch / tag / commit SHA)
|
||||||
GitREF string
|
GitREF string
|
||||||
// After is a git reference (branch / tag / commit SHA)
|
// After is a git reference (branch / tag / commit SHA)
|
||||||
@ -57,7 +56,7 @@ func (c *Client) ListCommits(ctx context.Context, params *ListCommitsParams) (*L
|
|||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
stream, err := c.repoService.ListCommits(ctx, &rpc.ListCommitsRequest{
|
stream, err := c.repoService.ListCommits(ctx, &rpc.ListCommitsRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
GitRef: params.GitREF,
|
GitRef: params.GitREF,
|
||||||
After: params.After,
|
After: params.After,
|
||||||
Page: params.Page,
|
Page: params.Page,
|
||||||
@ -98,8 +97,7 @@ func (c *Client) ListCommits(ctx context.Context, params *ListCommitsParams) (*L
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GetCommitDivergencesParams struct {
|
type GetCommitDivergencesParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
MaxCount int32
|
MaxCount int32
|
||||||
Requests []CommitDivergenceRequest
|
Requests []CommitDivergenceRequest
|
||||||
}
|
}
|
||||||
@ -132,7 +130,7 @@ func (c *Client) GetCommitDivergences(ctx context.Context,
|
|||||||
|
|
||||||
// build rpc request
|
// build rpc request
|
||||||
req := &rpc.GetCommitDivergencesRequest{
|
req := &rpc.GetCommitDivergencesRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
MaxCount: params.MaxCount,
|
MaxCount: params.MaxCount,
|
||||||
Requests: make([]*rpc.CommitDivergenceRequest, len(params.Requests)),
|
Requests: make([]*rpc.CommitDivergenceRequest, len(params.Requests)),
|
||||||
}
|
}
|
||||||
@ -192,9 +190,9 @@ type CommitFileAction struct {
|
|||||||
SHA string
|
SHA string
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitFilesOptions holds the data for file operations.
|
// CommitFilesParams holds the data for file operations.
|
||||||
type CommitFilesOptions struct {
|
type CommitFilesParams struct {
|
||||||
RepoID string
|
WriteParams
|
||||||
Title string
|
Title string
|
||||||
Message string
|
Message string
|
||||||
Branch string
|
Branch string
|
||||||
@ -208,7 +206,7 @@ type CommitFilesResponse struct {
|
|||||||
CommitID string
|
CommitID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) CommitFiles(ctx context.Context, params *CommitFilesOptions) (CommitFilesResponse, error) {
|
func (c *Client) CommitFiles(ctx context.Context, params *CommitFilesParams) (CommitFilesResponse, error) {
|
||||||
stream, err := c.commitFilesService.CommitFiles(ctx)
|
stream, err := c.commitFilesService.CommitFiles(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return CommitFilesResponse{}, err
|
return CommitFilesResponse{}, err
|
||||||
@ -217,7 +215,7 @@ func (c *Client) CommitFiles(ctx context.Context, params *CommitFilesOptions) (C
|
|||||||
if err = stream.Send(&rpc.CommitFilesRequest{
|
if err = stream.Send(&rpc.CommitFilesRequest{
|
||||||
Payload: &rpc.CommitFilesRequest_Header{
|
Payload: &rpc.CommitFilesRequest_Header{
|
||||||
Header: &rpc.CommitFilesRequestHeader{
|
Header: &rpc.CommitFilesRequestHeader{
|
||||||
RepoUid: params.RepoID,
|
Base: mapToRPCWriteRequest(params.WriteParams),
|
||||||
BranchName: params.Branch,
|
BranchName: params.Branch,
|
||||||
NewBranchName: params.NewBranch,
|
NewBranchName: params.NewBranch,
|
||||||
Title: params.Title,
|
Title: params.Title,
|
||||||
|
@ -3,6 +3,8 @@ package rpc;
|
|||||||
|
|
||||||
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
||||||
|
|
||||||
|
import "shared.proto";
|
||||||
|
|
||||||
// DiffService is a service which provides RPCs to inspect differences
|
// DiffService is a service which provides RPCs to inspect differences
|
||||||
// introduced between a set of commits.
|
// introduced between a set of commits.
|
||||||
service DiffService {
|
service DiffService {
|
||||||
@ -10,7 +12,7 @@ service DiffService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message RawDiffRequest {
|
message RawDiffRequest {
|
||||||
string repo_id = 1;
|
ReadRequest base = 1;
|
||||||
string left_commit_id = 2;
|
string left_commit_id = 2;
|
||||||
string right_commit_id = 3;
|
string right_commit_id = 3;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package rpc;
|
|||||||
|
|
||||||
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
||||||
|
|
||||||
|
import "shared.proto";
|
||||||
|
|
||||||
// SmartHTTPService is a service that provides RPCs required for HTTP-based Git
|
// SmartHTTPService is a service that provides RPCs required for HTTP-based Git
|
||||||
// clones via the smart HTTP protocol.
|
// clones via the smart HTTP protocol.
|
||||||
service SmartHTTPService {
|
service SmartHTTPService {
|
||||||
@ -16,7 +18,8 @@ service SmartHTTPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message InfoRefsRequest {
|
message InfoRefsRequest {
|
||||||
string repo_uid = 1;
|
// Base specifies the base read parameters
|
||||||
|
ReadRequest base = 1;
|
||||||
// Service can be: upload-pack or receive-pack
|
// Service can be: upload-pack or receive-pack
|
||||||
string service = 2;
|
string service = 2;
|
||||||
// Parameters to use with git -c (key=value pairs)
|
// Parameters to use with git -c (key=value pairs)
|
||||||
@ -31,21 +34,21 @@ message InfoRefsResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ServicePackRequest {
|
message ServicePackRequest {
|
||||||
// repository should only be present only in the first message of the stream
|
// Base specifies the base parameters.
|
||||||
string repo_uid = 1;
|
// Depending on the service the matching base type has to be passed
|
||||||
|
oneof base {
|
||||||
|
ReadRequest read_base = 1;
|
||||||
|
WriteRequest write_base = 2;
|
||||||
|
};
|
||||||
|
|
||||||
// Service can be: upload-pack or receive-pack
|
// Service can be: upload-pack or receive-pack
|
||||||
string service = 2;
|
string service = 3;
|
||||||
// Raw data to be copied to stdin of 'git upload-pack'
|
// Raw data to be copied to stdin of 'git upload-pack'
|
||||||
bytes data = 3;
|
bytes data = 4;
|
||||||
// Parameters to use with git -c (key=value pairs)
|
// Parameters to use with git -c (key=value pairs)
|
||||||
repeated string git_config_options = 4;
|
repeated string git_config_options = 5;
|
||||||
|
|
||||||
// Git protocol version
|
// Git protocol version
|
||||||
string git_protocol = 5;
|
string git_protocol = 6;
|
||||||
|
|
||||||
// user_id become env variable, used by the Git {pre,post}-receive
|
|
||||||
// hooks. They should only be present in the first message of the stream.
|
|
||||||
string principal_id = 6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message ServicePackResponse {
|
message ServicePackResponse {
|
||||||
|
@ -14,14 +14,12 @@ service CommitFilesService {
|
|||||||
// CommitFilesRequestHeader is the header of the UserCommitFiles that defines the commit details,
|
// CommitFilesRequestHeader is the header of the UserCommitFiles that defines the commit details,
|
||||||
// parent and other information related to the call.
|
// parent and other information related to the call.
|
||||||
message CommitFilesRequestHeader {
|
message CommitFilesRequestHeader {
|
||||||
// repository is the target repository where to apply the commit.
|
WriteRequest base = 1;
|
||||||
string repo_uid = 1;
|
|
||||||
string branch_name = 2;
|
string branch_name = 2;
|
||||||
string new_branch_name = 3;
|
string new_branch_name = 3;
|
||||||
string title = 4;
|
string title = 4;
|
||||||
string message = 5;
|
string message = 5;
|
||||||
Identity author = 6;
|
Identity author = 6;
|
||||||
Identity committer = 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitFilesActionHeader contains the details of the action to be performed.
|
// CommitFilesActionHeader contains the details of the action to be performed.
|
||||||
|
@ -14,7 +14,7 @@ service ReferenceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CreateBranchRequest {
|
message CreateBranchRequest {
|
||||||
string repo_uid = 1;
|
WriteRequest base = 1;
|
||||||
string branch_name = 2;
|
string branch_name = 2;
|
||||||
string target = 3;
|
string target = 3;
|
||||||
}
|
}
|
||||||
@ -24,12 +24,13 @@ message CreateBranchResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeleteBranchRequest {
|
message DeleteBranchRequest {
|
||||||
string repo_uid = 1;
|
WriteRequest base = 1;
|
||||||
string branch_name = 2;
|
string branch_name = 2;
|
||||||
bool force = 3;
|
bool force = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteBranchResponse {
|
message DeleteBranchResponse {
|
||||||
|
string sha = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListBranchesRequest {
|
message ListBranchesRequest {
|
||||||
@ -39,7 +40,7 @@ message ListBranchesRequest {
|
|||||||
Date = 2;
|
Date = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
bool include_commit = 2;
|
bool include_commit = 2;
|
||||||
string query = 3;
|
string query = 3;
|
||||||
SortOption sort = 4;
|
SortOption sort = 4;
|
||||||
@ -65,7 +66,7 @@ message ListCommitTagsRequest {
|
|||||||
Date = 2;
|
Date = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
bool include_commit = 2;
|
bool include_commit = 2;
|
||||||
string query = 3;
|
string query = 3;
|
||||||
SortOption sort = 4;
|
SortOption sort = 4;
|
||||||
@ -93,7 +94,8 @@ message GetRefRequest {
|
|||||||
Branch = 0;
|
Branch = 0;
|
||||||
Tag = 1;
|
Tag = 1;
|
||||||
}
|
}
|
||||||
string repo_uid = 1;
|
|
||||||
|
ReadRequest base = 1;
|
||||||
string ref_name = 2;
|
string ref_name = 2;
|
||||||
RefType ref_type = 3;
|
RefType ref_type = 3;
|
||||||
}
|
}
|
||||||
|
@ -24,14 +24,14 @@ message CreateRepositoryRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CreateRepositoryRequestHeader {
|
message CreateRepositoryRequestHeader {
|
||||||
string uid = 1;
|
WriteRequest base = 1;
|
||||||
string default_branch = 2;
|
string default_branch = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateRepositoryResponse { }
|
message CreateRepositoryResponse { }
|
||||||
|
|
||||||
message GetTreeNodeRequest {
|
message GetTreeNodeRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
string git_ref = 2;
|
string git_ref = 2;
|
||||||
string path = 3;
|
string path = 3;
|
||||||
bool include_latest_commit = 4;
|
bool include_latest_commit = 4;
|
||||||
@ -43,7 +43,7 @@ message GetTreeNodeResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ListTreeNodesRequest {
|
message ListTreeNodesRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
string git_ref = 2;
|
string git_ref = 2;
|
||||||
string path = 3;
|
string path = 3;
|
||||||
bool include_latest_commit = 4;
|
bool include_latest_commit = 4;
|
||||||
@ -78,7 +78,7 @@ enum TreeNodeMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ListCommitsRequest {
|
message ListCommitsRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
string git_ref = 2;
|
string git_ref = 2;
|
||||||
string after = 3;
|
string after = 3;
|
||||||
int32 page = 4;
|
int32 page = 4;
|
||||||
@ -91,7 +91,7 @@ message ListCommitsResponse {
|
|||||||
|
|
||||||
|
|
||||||
message GetBlobRequest {
|
message GetBlobRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
string sha = 2;
|
string sha = 2;
|
||||||
int64 sizeLimit = 3;
|
int64 sizeLimit = 3;
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ message Blob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetSubmoduleRequest {
|
message GetSubmoduleRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
string git_ref = 2;
|
string git_ref = 2;
|
||||||
string path = 3;
|
string path = 3;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ message Submodule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetCommitDivergencesRequest {
|
message GetCommitDivergencesRequest {
|
||||||
string repo_uid = 1;
|
ReadRequest base = 1;
|
||||||
int32 max_count = 2;
|
int32 max_count = 2;
|
||||||
repeated CommitDivergenceRequest requests = 3;
|
repeated CommitDivergenceRequest requests = 3;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,22 @@ package rpc;
|
|||||||
|
|
||||||
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
||||||
|
|
||||||
message FileUpload{
|
message ReadRequest {
|
||||||
|
string repo_uid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message WriteRequest {
|
||||||
|
string repo_uid = 1;
|
||||||
|
repeated EnvVar env_vars = 2;
|
||||||
|
Identity actor = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message EnvVar {
|
||||||
|
string name = 1;
|
||||||
|
string value = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FileUpload {
|
||||||
oneof data {
|
oneof data {
|
||||||
FileUploadHeader header = 1;
|
FileUploadHeader header = 1;
|
||||||
Chunk chunk = 2;
|
Chunk chunk = 2;
|
||||||
|
@ -21,7 +21,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GetRefParams struct {
|
type GetRefParams struct {
|
||||||
RepoUID string
|
ReadParams
|
||||||
Name string
|
Name string
|
||||||
Type RefType
|
Type RefType
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ func (c *Client) GetRef(ctx context.Context, params *GetRefParams) (*GetRefRespo
|
|||||||
}
|
}
|
||||||
|
|
||||||
result, err := c.refService.GetRef(ctx, &rpc.GetRefRequest{
|
result, err := c.refService.GetRef(ctx, &rpc.GetRefRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
RefName: params.Name,
|
RefName: params.Name,
|
||||||
RefType: refType,
|
RefType: refType,
|
||||||
})
|
})
|
||||||
|
@ -25,6 +25,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateRepositoryParams struct {
|
type CreateRepositoryParams struct {
|
||||||
|
// Create operation is different from all (from user side), as UID doesn't exist yet.
|
||||||
|
// Only take actor as input and create WriteParams manually
|
||||||
|
Actor Identity
|
||||||
DefaultBranch string
|
DefaultBranch string
|
||||||
Files []File
|
Files []File
|
||||||
}
|
}
|
||||||
@ -57,10 +60,16 @@ func (c *Client) CreateRepository(ctx context.Context,
|
|||||||
|
|
||||||
log.Info().Msgf("Send header")
|
log.Info().Msgf("Send header")
|
||||||
|
|
||||||
|
writeParams := WriteParams{
|
||||||
|
RepoUID: uid,
|
||||||
|
Actor: params.Actor,
|
||||||
|
EnvVars: map[string]string{}, // (no githook triggered for repo creation)
|
||||||
|
}
|
||||||
|
|
||||||
req := &rpc.CreateRepositoryRequest{
|
req := &rpc.CreateRepositoryRequest{
|
||||||
Data: &rpc.CreateRepositoryRequest_Header{
|
Data: &rpc.CreateRepositoryRequest_Header{
|
||||||
Header: &rpc.CreateRepositoryRequestHeader{
|
Header: &rpc.CreateRepositoryRequestHeader{
|
||||||
Uid: uid,
|
Base: mapToRPCWriteRequest(writeParams),
|
||||||
DefaultBranch: params.DefaultBranch,
|
DefaultBranch: params.DefaultBranch,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
16
gitrpc/rpc/constants.go
Normal file
16
gitrpc/rpc/constants.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2022 Harness Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by the Polyform Free Trial License
|
||||||
|
// that can be found in the LICENSE.md file for this repository.
|
||||||
|
|
||||||
|
package rpc
|
||||||
|
|
||||||
|
const (
|
||||||
|
// MetadataKeyRequestID is the key used to store the request ID in the metadata.
|
||||||
|
MetadataKeyRequestID = "request-id"
|
||||||
|
|
||||||
|
// ServiceUploadPack is the service constant used for triggering the upload pack operation.
|
||||||
|
ServiceUploadPack = "upload-pack"
|
||||||
|
|
||||||
|
// ServiceReceivePack is the service constant used for triggering the receive pack operation.
|
||||||
|
ServiceReceivePack = "receive-pack"
|
||||||
|
)
|
@ -25,7 +25,7 @@ type RawDiffRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoId string `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
LeftCommitId string `protobuf:"bytes,2,opt,name=left_commit_id,json=leftCommitId,proto3" json:"left_commit_id,omitempty"`
|
LeftCommitId string `protobuf:"bytes,2,opt,name=left_commit_id,json=leftCommitId,proto3" json:"left_commit_id,omitempty"`
|
||||||
RightCommitId string `protobuf:"bytes,3,opt,name=right_commit_id,json=rightCommitId,proto3" json:"right_commit_id,omitempty"`
|
RightCommitId string `protobuf:"bytes,3,opt,name=right_commit_id,json=rightCommitId,proto3" json:"right_commit_id,omitempty"`
|
||||||
}
|
}
|
||||||
@ -62,11 +62,11 @@ func (*RawDiffRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_diff_proto_rawDescGZIP(), []int{0}
|
return file_diff_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RawDiffRequest) GetRepoId() string {
|
func (x *RawDiffRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoId
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RawDiffRequest) GetLeftCommitId() string {
|
func (x *RawDiffRequest) GetLeftCommitId() string {
|
||||||
@ -134,24 +134,26 @@ var File_diff_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_diff_proto_rawDesc = []byte{
|
var file_diff_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70,
|
0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70,
|
||||||
0x63, 0x22, 0x77, 0x0a, 0x0e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75,
|
0x63, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||||
0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
0x84, 0x01, 0x0a, 0x0e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e,
|
0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x6c, 0x65, 0x66, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02,
|
0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x66, 0x74,
|
||||||
0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
|
0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x69, 0x67,
|
0x52, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x26,
|
||||||
0x68, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x61,
|
0x0a, 0x0f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69,
|
||||||
0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a,
|
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6f,
|
||||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74,
|
0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66,
|
||||||
0x61, 0x32, 0x47, 0x0a, 0x0b, 0x44, 0x69, 0x66, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
||||||
0x12, 0x38, 0x0a, 0x07, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x12, 0x13, 0x2e, 0x72, 0x70,
|
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x47, 0x0a,
|
||||||
0x63, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x0b, 0x44, 0x69, 0x66, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x07,
|
||||||
0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65,
|
0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69,
|
0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72,
|
||||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73,
|
0x70, 0x63, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f,
|
0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||||
0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74,
|
||||||
|
0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -170,15 +172,17 @@ var file_diff_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|||||||
var file_diff_proto_goTypes = []interface{}{
|
var file_diff_proto_goTypes = []interface{}{
|
||||||
(*RawDiffRequest)(nil), // 0: rpc.RawDiffRequest
|
(*RawDiffRequest)(nil), // 0: rpc.RawDiffRequest
|
||||||
(*RawDiffResponse)(nil), // 1: rpc.RawDiffResponse
|
(*RawDiffResponse)(nil), // 1: rpc.RawDiffResponse
|
||||||
|
(*ReadRequest)(nil), // 2: rpc.ReadRequest
|
||||||
}
|
}
|
||||||
var file_diff_proto_depIdxs = []int32{
|
var file_diff_proto_depIdxs = []int32{
|
||||||
0, // 0: rpc.DiffService.RawDiff:input_type -> rpc.RawDiffRequest
|
2, // 0: rpc.RawDiffRequest.base:type_name -> rpc.ReadRequest
|
||||||
1, // 1: rpc.DiffService.RawDiff:output_type -> rpc.RawDiffResponse
|
0, // 1: rpc.DiffService.RawDiff:input_type -> rpc.RawDiffRequest
|
||||||
1, // [1:2] is the sub-list for method output_type
|
1, // 2: rpc.DiffService.RawDiff:output_type -> rpc.RawDiffResponse
|
||||||
0, // [0:1] is the sub-list for method input_type
|
2, // [2:3] is the sub-list for method output_type
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
1, // [1:2] is the sub-list for method input_type
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
0, // [0:0] is the sub-list for field type_name
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_diff_proto_init() }
|
func init() { file_diff_proto_init() }
|
||||||
@ -186,6 +190,7 @@ func file_diff_proto_init() {
|
|||||||
if File_diff_proto != nil {
|
if File_diff_proto != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
file_shared_proto_init()
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_diff_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_diff_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*RawDiffRequest); i {
|
switch v := v.(*RawDiffRequest); i {
|
||||||
|
@ -25,7 +25,8 @@ type InfoRefsRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
// Base specifies the base read parameters
|
||||||
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
// Service can be: upload-pack or receive-pack
|
// Service can be: upload-pack or receive-pack
|
||||||
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
||||||
// Parameters to use with git -c (key=value pairs)
|
// Parameters to use with git -c (key=value pairs)
|
||||||
@ -66,11 +67,11 @@ func (*InfoRefsRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_http_proto_rawDescGZIP(), []int{0}
|
return file_http_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *InfoRefsRequest) GetRepoUid() string {
|
func (x *InfoRefsRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *InfoRefsRequest) GetService() string {
|
func (x *InfoRefsRequest) GetService() string {
|
||||||
@ -146,19 +147,21 @@ type ServicePackRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// repository should only be present only in the first message of the stream
|
// Base specifies the base parameters.
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
// Depending on the service the matching base type has to be passed
|
||||||
|
//
|
||||||
|
// Types that are assignable to Base:
|
||||||
|
// *ServicePackRequest_ReadBase
|
||||||
|
// *ServicePackRequest_WriteBase
|
||||||
|
Base isServicePackRequest_Base `protobuf_oneof:"base"`
|
||||||
// Service can be: upload-pack or receive-pack
|
// Service can be: upload-pack or receive-pack
|
||||||
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service,omitempty"`
|
||||||
// Raw data to be copied to stdin of 'git upload-pack'
|
// Raw data to be copied to stdin of 'git upload-pack'
|
||||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
|
||||||
// Parameters to use with git -c (key=value pairs)
|
// Parameters to use with git -c (key=value pairs)
|
||||||
GitConfigOptions []string `protobuf:"bytes,4,rep,name=git_config_options,json=gitConfigOptions,proto3" json:"git_config_options,omitempty"`
|
GitConfigOptions []string `protobuf:"bytes,5,rep,name=git_config_options,json=gitConfigOptions,proto3" json:"git_config_options,omitempty"`
|
||||||
// Git protocol version
|
// Git protocol version
|
||||||
GitProtocol string `protobuf:"bytes,5,opt,name=git_protocol,json=gitProtocol,proto3" json:"git_protocol,omitempty"`
|
GitProtocol string `protobuf:"bytes,6,opt,name=git_protocol,json=gitProtocol,proto3" json:"git_protocol,omitempty"`
|
||||||
// user_id become env variable, used by the Git {pre,post}-receive
|
|
||||||
// hooks. They should only be present in the first message of the stream.
|
|
||||||
PrincipalId string `protobuf:"bytes,6,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ServicePackRequest) Reset() {
|
func (x *ServicePackRequest) Reset() {
|
||||||
@ -193,11 +196,25 @@ func (*ServicePackRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_http_proto_rawDescGZIP(), []int{2}
|
return file_http_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ServicePackRequest) GetRepoUid() string {
|
func (m *ServicePackRequest) GetBase() isServicePackRequest_Base {
|
||||||
if x != nil {
|
if m != nil {
|
||||||
return x.RepoUid
|
return m.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ServicePackRequest) GetReadBase() *ReadRequest {
|
||||||
|
if x, ok := x.GetBase().(*ServicePackRequest_ReadBase); ok {
|
||||||
|
return x.ReadBase
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ServicePackRequest) GetWriteBase() *WriteRequest {
|
||||||
|
if x, ok := x.GetBase().(*ServicePackRequest_WriteBase); ok {
|
||||||
|
return x.WriteBase
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ServicePackRequest) GetService() string {
|
func (x *ServicePackRequest) GetService() string {
|
||||||
@ -228,13 +245,22 @@ func (x *ServicePackRequest) GetGitProtocol() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ServicePackRequest) GetPrincipalId() string {
|
type isServicePackRequest_Base interface {
|
||||||
if x != nil {
|
isServicePackRequest_Base()
|
||||||
return x.PrincipalId
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ServicePackRequest_ReadBase struct {
|
||||||
|
ReadBase *ReadRequest `protobuf:"bytes,1,opt,name=read_base,json=readBase,proto3,oneof"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ServicePackRequest_WriteBase struct {
|
||||||
|
WriteBase *WriteRequest `protobuf:"bytes,2,opt,name=write_base,json=writeBase,proto3,oneof"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ServicePackRequest_ReadBase) isServicePackRequest_Base() {}
|
||||||
|
|
||||||
|
func (*ServicePackRequest_WriteBase) isServicePackRequest_Base() {}
|
||||||
|
|
||||||
type ServicePackResponse struct {
|
type ServicePackResponse struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -287,47 +313,52 @@ var File_http_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_http_proto_rawDesc = []byte{
|
var file_http_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70,
|
0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70,
|
||||||
0x63, 0x22, 0x97, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65,
|
0x63, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69,
|
0xa2, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64,
|
0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x69,
|
0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72,
|
||||||
0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76,
|
||||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x5f,
|
0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
|
|
||||||
0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x26, 0x0a, 0x10, 0x49,
|
|
||||||
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
|
||||||
0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64,
|
|
||||||
0x61, 0x74, 0x61, 0x22, 0xd1, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50,
|
|
||||||
0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65,
|
|
||||||
0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65,
|
|
||||||
0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
|
||||||
0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64,
|
|
||||||
0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
|
||||||
0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52,
|
|
||||||
0x10, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
0x10, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
0x73, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
0x73, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||||
0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74,
|
0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61,
|
0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x26, 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73,
|
||||||
0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6e,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||||
0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x69,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x80, 0x02, 0x0a,
|
||||||
0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12,
|
0x12, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61,
|
0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x73, 0x65,
|
||||||
0x74, 0x61, 0x32, 0x97, 0x01, 0x0a, 0x10, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x48, 0x54, 0x54, 0x50,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61,
|
||||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x52,
|
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64,
|
||||||
0x65, 0x66, 0x73, 0x12, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
|
0x42, 0x61, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x62, 0x61,
|
||||||
0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57,
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x77,
|
||||||
0x22, 0x00, 0x30, 0x01, 0x12, 0x46, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50,
|
0x72, 0x69, 0x74, 0x65, 0x42, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76,
|
||||||
0x61, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72,
|
0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c,
|
||||||
0x70, 0x63, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65,
|
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x27, 0x5a, 0x25,
|
0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03,
|
||||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65,
|
0x28, 0x09, 0x52, 0x10, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74,
|
||||||
0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70,
|
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x22,
|
||||||
|
0x29, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x97, 0x01, 0x0a, 0x10, 0x53,
|
||||||
|
0x6d, 0x61, 0x72, 0x74, 0x48, 0x54, 0x54, 0x50, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||||
|
0x3b, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x12, 0x14, 0x2e, 0x72, 0x70,
|
||||||
|
0x63, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x1a, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x46, 0x0a, 0x0b,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x72, 0x70,
|
||||||
|
0x63, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71,
|
||||||
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||||
|
0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
|
0x28, 0x01, 0x30, 0x01, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
|
0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65,
|
||||||
|
0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -348,17 +379,22 @@ var file_http_proto_goTypes = []interface{}{
|
|||||||
(*InfoRefsResponse)(nil), // 1: rpc.InfoRefsResponse
|
(*InfoRefsResponse)(nil), // 1: rpc.InfoRefsResponse
|
||||||
(*ServicePackRequest)(nil), // 2: rpc.ServicePackRequest
|
(*ServicePackRequest)(nil), // 2: rpc.ServicePackRequest
|
||||||
(*ServicePackResponse)(nil), // 3: rpc.ServicePackResponse
|
(*ServicePackResponse)(nil), // 3: rpc.ServicePackResponse
|
||||||
|
(*ReadRequest)(nil), // 4: rpc.ReadRequest
|
||||||
|
(*WriteRequest)(nil), // 5: rpc.WriteRequest
|
||||||
}
|
}
|
||||||
var file_http_proto_depIdxs = []int32{
|
var file_http_proto_depIdxs = []int32{
|
||||||
0, // 0: rpc.SmartHTTPService.InfoRefs:input_type -> rpc.InfoRefsRequest
|
4, // 0: rpc.InfoRefsRequest.base:type_name -> rpc.ReadRequest
|
||||||
2, // 1: rpc.SmartHTTPService.ServicePack:input_type -> rpc.ServicePackRequest
|
4, // 1: rpc.ServicePackRequest.read_base:type_name -> rpc.ReadRequest
|
||||||
1, // 2: rpc.SmartHTTPService.InfoRefs:output_type -> rpc.InfoRefsResponse
|
5, // 2: rpc.ServicePackRequest.write_base:type_name -> rpc.WriteRequest
|
||||||
3, // 3: rpc.SmartHTTPService.ServicePack:output_type -> rpc.ServicePackResponse
|
0, // 3: rpc.SmartHTTPService.InfoRefs:input_type -> rpc.InfoRefsRequest
|
||||||
2, // [2:4] is the sub-list for method output_type
|
2, // 4: rpc.SmartHTTPService.ServicePack:input_type -> rpc.ServicePackRequest
|
||||||
0, // [0:2] is the sub-list for method input_type
|
1, // 5: rpc.SmartHTTPService.InfoRefs:output_type -> rpc.InfoRefsResponse
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
3, // 6: rpc.SmartHTTPService.ServicePack:output_type -> rpc.ServicePackResponse
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
5, // [5:7] is the sub-list for method output_type
|
||||||
0, // [0:0] is the sub-list for field type_name
|
3, // [3:5] is the sub-list for method input_type
|
||||||
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
|
0, // [0:3] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_http_proto_init() }
|
func init() { file_http_proto_init() }
|
||||||
@ -366,6 +402,7 @@ func file_http_proto_init() {
|
|||||||
if File_http_proto != nil {
|
if File_http_proto != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
file_shared_proto_init()
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*InfoRefsRequest); i {
|
switch v := v.(*InfoRefsRequest); i {
|
||||||
@ -416,6 +453,10 @@ func file_http_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_http_proto_msgTypes[2].OneofWrappers = []interface{}{
|
||||||
|
(*ServicePackRequest_ReadBase)(nil),
|
||||||
|
(*ServicePackRequest_WriteBase)(nil),
|
||||||
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
|
@ -83,14 +83,12 @@ type CommitFilesRequestHeader struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// repository is the target repository where to apply the commit.
|
Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
|
||||||
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
||||||
NewBranchName string `protobuf:"bytes,3,opt,name=new_branch_name,json=newBranchName,proto3" json:"new_branch_name,omitempty"`
|
NewBranchName string `protobuf:"bytes,3,opt,name=new_branch_name,json=newBranchName,proto3" json:"new_branch_name,omitempty"`
|
||||||
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
|
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
|
||||||
Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
|
Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
|
||||||
Author *Identity `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"`
|
Author *Identity `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"`
|
||||||
Committer *Identity `protobuf:"bytes,7,opt,name=committer,proto3" json:"committer,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CommitFilesRequestHeader) Reset() {
|
func (x *CommitFilesRequestHeader) Reset() {
|
||||||
@ -125,11 +123,11 @@ func (*CommitFilesRequestHeader) Descriptor() ([]byte, []int) {
|
|||||||
return file_operations_proto_rawDescGZIP(), []int{0}
|
return file_operations_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CommitFilesRequestHeader) GetRepoUid() string {
|
func (x *CommitFilesRequestHeader) GetBase() *WriteRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CommitFilesRequestHeader) GetBranchName() string {
|
func (x *CommitFilesRequestHeader) GetBranchName() string {
|
||||||
@ -167,13 +165,6 @@ func (x *CommitFilesRequestHeader) GetAuthor() *Identity {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CommitFilesRequestHeader) GetCommitter() *Identity {
|
|
||||||
if x != nil {
|
|
||||||
return x.Committer
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// CommitFilesActionHeader contains the details of the action to be performed.
|
// CommitFilesActionHeader contains the details of the action to be performed.
|
||||||
type CommitFilesActionHeader struct {
|
type CommitFilesActionHeader struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -468,65 +459,62 @@ var File_operations_proto protoreflect.FileDescriptor
|
|||||||
var file_operations_proto_rawDesc = []byte{
|
var file_operations_proto_rawDesc = []byte{
|
||||||
0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e,
|
0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x02, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x01, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64,
|
0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64,
|
||||||
0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01,
|
0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x1f, 0x0a,
|
0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61,
|
||||||
0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26,
|
0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
|
||||||
0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d,
|
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65,
|
||||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x42, 0x72, 0x61, 0x6e,
|
0x77, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
|
||||||
0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
|
0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61,
|
||||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07,
|
0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d,
|
0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
|
0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65,
|
0x67, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01,
|
||||||
0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x2b, 0x0a,
|
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||||
0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b,
|
0x79, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x22, 0xbc, 0x01, 0x0a, 0x17, 0x43, 0x6f,
|
||||||
0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52,
|
0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48,
|
||||||
0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x22, 0xbc, 0x01, 0x0a, 0x17, 0x43,
|
0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
|
||||||
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d,
|
0x64, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06,
|
||||||
0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65,
|
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02,
|
||||||
0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68,
|
||||||
0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18,
|
0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0x3a, 0x0a, 0x0a,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x73,
|
0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52,
|
||||||
0x68, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0x3a, 0x0a,
|
0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45,
|
||||||
0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43,
|
0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x08,
|
||||||
0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54,
|
0x0a, 0x04, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x03, 0x22, 0x72, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d,
|
||||||
0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12,
|
0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a,
|
||||||
0x08, 0x0a, 0x04, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x03, 0x22, 0x72, 0x0a, 0x11, 0x43, 0x6f, 0x6d,
|
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
|
||||||
0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36,
|
|
||||||
0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
|
|
||||||
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73,
|
|
||||||
0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06,
|
|
||||||
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
|
|
||||||
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
|
|
||||||
0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8a, 0x01,
|
|
||||||
0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71,
|
|
||||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01,
|
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
|
||||||
0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61,
|
|
||||||
0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a,
|
|
||||||
0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
|
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41,
|
0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41,
|
||||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42,
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68,
|
||||||
0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4a, 0x0a, 0x13, 0x43, 0x6f,
|
0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
|
||||||
0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
|
||||||
0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8a, 0x01, 0x0a,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x16,
|
0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
|
0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20,
|
||||||
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x32, 0x58, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x46, 0x69, 0x6c, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0b,
|
0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64,
|
||||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70,
|
0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06,
|
||||||
0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71,
|
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x63,
|
||||||
0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01,
|
0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09,
|
||||||
0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
|
0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4a, 0x0a, 0x13, 0x43, 0x6f, 0x6d,
|
||||||
0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67,
|
0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||||
0x33,
|
0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a,
|
||||||
|
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62,
|
||||||
|
0x72, 0x61, 0x6e, 0x63, 0x68, 0x32, 0x58, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46,
|
||||||
|
0x69, 0x6c, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x43,
|
||||||
|
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||||
|
0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
|
0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x42,
|
||||||
|
0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61,
|
||||||
|
0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69,
|
||||||
|
0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -550,11 +538,12 @@ var file_operations_proto_goTypes = []interface{}{
|
|||||||
(*CommitFilesAction)(nil), // 3: rpc.CommitFilesAction
|
(*CommitFilesAction)(nil), // 3: rpc.CommitFilesAction
|
||||||
(*CommitFilesRequest)(nil), // 4: rpc.CommitFilesRequest
|
(*CommitFilesRequest)(nil), // 4: rpc.CommitFilesRequest
|
||||||
(*CommitFilesResponse)(nil), // 5: rpc.CommitFilesResponse
|
(*CommitFilesResponse)(nil), // 5: rpc.CommitFilesResponse
|
||||||
(*Identity)(nil), // 6: rpc.Identity
|
(*WriteRequest)(nil), // 6: rpc.WriteRequest
|
||||||
|
(*Identity)(nil), // 7: rpc.Identity
|
||||||
}
|
}
|
||||||
var file_operations_proto_depIdxs = []int32{
|
var file_operations_proto_depIdxs = []int32{
|
||||||
6, // 0: rpc.CommitFilesRequestHeader.author:type_name -> rpc.Identity
|
6, // 0: rpc.CommitFilesRequestHeader.base:type_name -> rpc.WriteRequest
|
||||||
6, // 1: rpc.CommitFilesRequestHeader.committer:type_name -> rpc.Identity
|
7, // 1: rpc.CommitFilesRequestHeader.author:type_name -> rpc.Identity
|
||||||
0, // 2: rpc.CommitFilesActionHeader.action:type_name -> rpc.CommitFilesActionHeader.ActionType
|
0, // 2: rpc.CommitFilesActionHeader.action:type_name -> rpc.CommitFilesActionHeader.ActionType
|
||||||
2, // 3: rpc.CommitFilesAction.header:type_name -> rpc.CommitFilesActionHeader
|
2, // 3: rpc.CommitFilesAction.header:type_name -> rpc.CommitFilesActionHeader
|
||||||
1, // 4: rpc.CommitFilesRequest.header:type_name -> rpc.CommitFilesRequestHeader
|
1, // 4: rpc.CommitFilesRequest.header:type_name -> rpc.CommitFilesRequestHeader
|
||||||
|
@ -169,7 +169,7 @@ type CreateBranchRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
||||||
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
||||||
}
|
}
|
||||||
@ -206,11 +206,11 @@ func (*CreateBranchRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{0}
|
return file_ref_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateBranchRequest) GetRepoUid() string {
|
func (x *CreateBranchRequest) GetBase() *WriteRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateBranchRequest) GetBranchName() string {
|
func (x *CreateBranchRequest) GetBranchName() string {
|
||||||
@ -279,7 +279,7 @@ type DeleteBranchRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"`
|
||||||
Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"`
|
Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"`
|
||||||
}
|
}
|
||||||
@ -316,11 +316,11 @@ func (*DeleteBranchRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{2}
|
return file_ref_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteBranchRequest) GetRepoUid() string {
|
func (x *DeleteBranchRequest) GetBase() *WriteRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteBranchRequest) GetBranchName() string {
|
func (x *DeleteBranchRequest) GetBranchName() string {
|
||||||
@ -341,6 +341,8 @@ type DeleteBranchResponse struct {
|
|||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Sha string `protobuf:"bytes,1,opt,name=sha,proto3" json:"sha,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteBranchResponse) Reset() {
|
func (x *DeleteBranchResponse) Reset() {
|
||||||
@ -375,12 +377,19 @@ func (*DeleteBranchResponse) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{3}
|
return file_ref_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DeleteBranchResponse) GetSha() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Sha
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type ListBranchesRequest struct {
|
type ListBranchesRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
IncludeCommit bool `protobuf:"varint,2,opt,name=include_commit,json=includeCommit,proto3" json:"include_commit,omitempty"`
|
IncludeCommit bool `protobuf:"varint,2,opt,name=include_commit,json=includeCommit,proto3" json:"include_commit,omitempty"`
|
||||||
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
||||||
Sort ListBranchesRequest_SortOption `protobuf:"varint,4,opt,name=sort,proto3,enum=rpc.ListBranchesRequest_SortOption" json:"sort,omitempty"`
|
Sort ListBranchesRequest_SortOption `protobuf:"varint,4,opt,name=sort,proto3,enum=rpc.ListBranchesRequest_SortOption" json:"sort,omitempty"`
|
||||||
@ -421,11 +430,11 @@ func (*ListBranchesRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{4}
|
return file_ref_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListBranchesRequest) GetRepoUid() string {
|
func (x *ListBranchesRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListBranchesRequest) GetIncludeCommit() bool {
|
func (x *ListBranchesRequest) GetIncludeCommit() bool {
|
||||||
@ -585,7 +594,7 @@ type ListCommitTagsRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
IncludeCommit bool `protobuf:"varint,2,opt,name=include_commit,json=includeCommit,proto3" json:"include_commit,omitempty"`
|
IncludeCommit bool `protobuf:"varint,2,opt,name=include_commit,json=includeCommit,proto3" json:"include_commit,omitempty"`
|
||||||
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
||||||
Sort ListCommitTagsRequest_SortOption `protobuf:"varint,4,opt,name=sort,proto3,enum=rpc.ListCommitTagsRequest_SortOption" json:"sort,omitempty"`
|
Sort ListCommitTagsRequest_SortOption `protobuf:"varint,4,opt,name=sort,proto3,enum=rpc.ListCommitTagsRequest_SortOption" json:"sort,omitempty"`
|
||||||
@ -626,11 +635,11 @@ func (*ListCommitTagsRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{7}
|
return file_ref_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListCommitTagsRequest) GetRepoUid() string {
|
func (x *ListCommitTagsRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListCommitTagsRequest) GetIncludeCommit() bool {
|
func (x *ListCommitTagsRequest) GetIncludeCommit() bool {
|
||||||
@ -822,7 +831,7 @@ type GetRefRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
RefName string `protobuf:"bytes,2,opt,name=ref_name,json=refName,proto3" json:"ref_name,omitempty"`
|
RefName string `protobuf:"bytes,2,opt,name=ref_name,json=refName,proto3" json:"ref_name,omitempty"`
|
||||||
RefType GetRefRequest_RefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=rpc.GetRefRequest_RefType" json:"ref_type,omitempty"`
|
RefType GetRefRequest_RefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=rpc.GetRefRequest_RefType" json:"ref_type,omitempty"`
|
||||||
}
|
}
|
||||||
@ -859,11 +868,11 @@ func (*GetRefRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_ref_proto_rawDescGZIP(), []int{10}
|
return file_ref_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetRefRequest) GetRepoUid() string {
|
func (x *GetRefRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetRefRequest) GetRefName() string {
|
func (x *GetRefRequest) GetRefName() string {
|
||||||
@ -931,57 +940,61 @@ var File_ref_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_ref_proto_rawDesc = []byte{
|
var file_ref_proto_rawDesc = []byte{
|
||||||
0x0a, 0x09, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63,
|
0x0a, 0x09, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63,
|
||||||
0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x69,
|
0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x75,
|
||||||
0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
|
0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64,
|
0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
|
||||||
0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d,
|
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a,
|
||||||
0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x3b, 0x0a, 0x14, 0x43, 0x72, 0x65,
|
0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74,
|
||||||
0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x3b, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42,
|
||||||
0x65, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a,
|
||||||
0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06,
|
|
||||||
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x67, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a,
|
|
||||||
0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
||||||
0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e,
|
|
||||||
0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62,
|
|
||||||
0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72,
|
|
||||||
0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22,
|
|
||||||
0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52,
|
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xab, 0x02, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74,
|
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
|
||||||
0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
||||||
0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e,
|
|
||||||
0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
|
|
||||||
0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
|
||||||
0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18,
|
|
||||||
0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74,
|
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e,
|
|
||||||
0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74,
|
|
||||||
0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
|
||||||
0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52,
|
|
||||||
0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06,
|
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61,
|
|
||||||
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61,
|
|
||||||
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x2d, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x10,
|
|
||||||
0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44,
|
|
||||||
0x61, 0x74, 0x65, 0x10, 0x02, 0x22, 0x3b, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61,
|
|
||||||
0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a,
|
|
||||||
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
|
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e,
|
0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e,
|
||||||
0x63, 0x68, 0x22, 0x53, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04,
|
0x63, 0x68, 0x22, 0x73, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73,
|
||||||
0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72,
|
||||||
0x68, 0x61, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01,
|
0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65,
|
||||||
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52,
|
0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||||
0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xaf, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74,
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d,
|
||||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
|
||||||
0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20,
|
0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x28, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e,
|
0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
|
0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68,
|
||||||
|
0x61, 0x22, 0xb6, 0x02, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
|
||||||
|
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73,
|
||||||
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||||
|
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12,
|
||||||
|
0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||||
|
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65,
|
||||||
|
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18,
|
||||||
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x04,
|
||||||
|
0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71,
|
||||||
|
0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52,
|
||||||
|
0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05,
|
||||||
|
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f,
|
||||||
|
0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70,
|
||||||
|
0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12,
|
||||||
|
0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
|
||||||
|
0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x2d, 0x0a, 0x0a, 0x53,
|
||||||
|
0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x66,
|
||||||
|
0x61, 0x75, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01,
|
||||||
|
0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x10, 0x02, 0x22, 0x3b, 0x0a, 0x14, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
|
0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52,
|
||||||
|
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x53, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63,
|
||||||
|
0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||||
|
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f,
|
||||||
|
0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xba, 0x02, 0x0a,
|
||||||
|
0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e,
|
||||||
0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02,
|
0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02,
|
||||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6d,
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6d,
|
||||||
0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01,
|
0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01,
|
||||||
@ -1014,45 +1027,45 @@ var file_ref_proto_rawDesc = []byte{
|
|||||||
0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x06, 0x74, 0x61,
|
0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x06, 0x74, 0x61,
|
||||||
0x67, 0x67, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x07,
|
0x67, 0x67, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x07,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
||||||
0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x9c, 0x01, 0x0a, 0x0d, 0x47, 0x65,
|
0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xa7, 0x01, 0x0a, 0x0d, 0x47, 0x65,
|
||||||
0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72,
|
0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62,
|
||||||
0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72,
|
0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61,
|
0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73,
|
||||||
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d,
|
0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
|
||||||
0x65, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20,
|
0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08,
|
||||||
0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66,
|
0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52,
|
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1e, 0x0a, 0x07, 0x52, 0x65, 0x66, 0x54,
|
0x73, 0x74, 0x2e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54,
|
||||||
0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x10, 0x00, 0x12,
|
0x79, 0x70, 0x65, 0x22, 0x1e, 0x0a, 0x07, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a,
|
||||||
0x07, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x10, 0x01, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52,
|
0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x61,
|
||||||
0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68,
|
0x67, 0x10, 0x01, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73,
|
||||||
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x32, 0xe3, 0x02, 0x0a,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x10, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x32, 0xe3, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x65,
|
||||||
0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63,
|
0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0c,
|
||||||
0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72,
|
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x72,
|
||||||
|
0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65,
|
||||||
|
0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x12, 0x43, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63,
|
||||||
|
0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72,
|
||||||
0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70,
|
0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70,
|
||||||
0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
|
0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72,
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c,
|
0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73,
|
||||||
0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61,
|
0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63,
|
||||||
0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x4c,
|
0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4b, 0x0a,
|
||||||
0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x70,
|
0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12,
|
||||||
0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65,
|
0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74,
|
0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x72, 0x70,
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73,
|
||||||
0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x06, 0x47, 0x65,
|
||||||
0x54, 0x61, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43,
|
0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
|
||||||
0x1a, 0x1b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a,
|
||||||
0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12,
|
0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e,
|
||||||
0x31, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72,
|
||||||
0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,
|
0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
|
||||||
0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
|
||||||
0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73,
|
|
||||||
0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -1085,37 +1098,44 @@ var file_ref_proto_goTypes = []interface{}{
|
|||||||
(*CommitTag)(nil), // 12: rpc.CommitTag
|
(*CommitTag)(nil), // 12: rpc.CommitTag
|
||||||
(*GetRefRequest)(nil), // 13: rpc.GetRefRequest
|
(*GetRefRequest)(nil), // 13: rpc.GetRefRequest
|
||||||
(*GetRefResponse)(nil), // 14: rpc.GetRefResponse
|
(*GetRefResponse)(nil), // 14: rpc.GetRefResponse
|
||||||
(SortOrder)(0), // 15: rpc.SortOrder
|
(*WriteRequest)(nil), // 15: rpc.WriteRequest
|
||||||
(*Commit)(nil), // 16: rpc.Commit
|
(*ReadRequest)(nil), // 16: rpc.ReadRequest
|
||||||
(*Signature)(nil), // 17: rpc.Signature
|
(SortOrder)(0), // 17: rpc.SortOrder
|
||||||
|
(*Commit)(nil), // 18: rpc.Commit
|
||||||
|
(*Signature)(nil), // 19: rpc.Signature
|
||||||
}
|
}
|
||||||
var file_ref_proto_depIdxs = []int32{
|
var file_ref_proto_depIdxs = []int32{
|
||||||
9, // 0: rpc.CreateBranchResponse.branch:type_name -> rpc.Branch
|
15, // 0: rpc.CreateBranchRequest.base:type_name -> rpc.WriteRequest
|
||||||
0, // 1: rpc.ListBranchesRequest.sort:type_name -> rpc.ListBranchesRequest.SortOption
|
9, // 1: rpc.CreateBranchResponse.branch:type_name -> rpc.Branch
|
||||||
15, // 2: rpc.ListBranchesRequest.order:type_name -> rpc.SortOrder
|
15, // 2: rpc.DeleteBranchRequest.base:type_name -> rpc.WriteRequest
|
||||||
9, // 3: rpc.ListBranchesResponse.branch:type_name -> rpc.Branch
|
16, // 3: rpc.ListBranchesRequest.base:type_name -> rpc.ReadRequest
|
||||||
16, // 4: rpc.Branch.commit:type_name -> rpc.Commit
|
0, // 4: rpc.ListBranchesRequest.sort:type_name -> rpc.ListBranchesRequest.SortOption
|
||||||
1, // 5: rpc.ListCommitTagsRequest.sort:type_name -> rpc.ListCommitTagsRequest.SortOption
|
17, // 5: rpc.ListBranchesRequest.order:type_name -> rpc.SortOrder
|
||||||
15, // 6: rpc.ListCommitTagsRequest.order:type_name -> rpc.SortOrder
|
9, // 6: rpc.ListBranchesResponse.branch:type_name -> rpc.Branch
|
||||||
12, // 7: rpc.ListCommitTagsResponse.tag:type_name -> rpc.CommitTag
|
18, // 7: rpc.Branch.commit:type_name -> rpc.Commit
|
||||||
17, // 8: rpc.CommitTag.tagger:type_name -> rpc.Signature
|
16, // 8: rpc.ListCommitTagsRequest.base:type_name -> rpc.ReadRequest
|
||||||
16, // 9: rpc.CommitTag.commit:type_name -> rpc.Commit
|
1, // 9: rpc.ListCommitTagsRequest.sort:type_name -> rpc.ListCommitTagsRequest.SortOption
|
||||||
2, // 10: rpc.GetRefRequest.ref_type:type_name -> rpc.GetRefRequest.RefType
|
17, // 10: rpc.ListCommitTagsRequest.order:type_name -> rpc.SortOrder
|
||||||
3, // 11: rpc.ReferenceService.CreateBranch:input_type -> rpc.CreateBranchRequest
|
12, // 11: rpc.ListCommitTagsResponse.tag:type_name -> rpc.CommitTag
|
||||||
5, // 12: rpc.ReferenceService.DeleteBranch:input_type -> rpc.DeleteBranchRequest
|
19, // 12: rpc.CommitTag.tagger:type_name -> rpc.Signature
|
||||||
7, // 13: rpc.ReferenceService.ListBranches:input_type -> rpc.ListBranchesRequest
|
18, // 13: rpc.CommitTag.commit:type_name -> rpc.Commit
|
||||||
10, // 14: rpc.ReferenceService.ListCommitTags:input_type -> rpc.ListCommitTagsRequest
|
16, // 14: rpc.GetRefRequest.base:type_name -> rpc.ReadRequest
|
||||||
13, // 15: rpc.ReferenceService.GetRef:input_type -> rpc.GetRefRequest
|
2, // 15: rpc.GetRefRequest.ref_type:type_name -> rpc.GetRefRequest.RefType
|
||||||
4, // 16: rpc.ReferenceService.CreateBranch:output_type -> rpc.CreateBranchResponse
|
3, // 16: rpc.ReferenceService.CreateBranch:input_type -> rpc.CreateBranchRequest
|
||||||
6, // 17: rpc.ReferenceService.DeleteBranch:output_type -> rpc.DeleteBranchResponse
|
5, // 17: rpc.ReferenceService.DeleteBranch:input_type -> rpc.DeleteBranchRequest
|
||||||
8, // 18: rpc.ReferenceService.ListBranches:output_type -> rpc.ListBranchesResponse
|
7, // 18: rpc.ReferenceService.ListBranches:input_type -> rpc.ListBranchesRequest
|
||||||
11, // 19: rpc.ReferenceService.ListCommitTags:output_type -> rpc.ListCommitTagsResponse
|
10, // 19: rpc.ReferenceService.ListCommitTags:input_type -> rpc.ListCommitTagsRequest
|
||||||
14, // 20: rpc.ReferenceService.GetRef:output_type -> rpc.GetRefResponse
|
13, // 20: rpc.ReferenceService.GetRef:input_type -> rpc.GetRefRequest
|
||||||
16, // [16:21] is the sub-list for method output_type
|
4, // 21: rpc.ReferenceService.CreateBranch:output_type -> rpc.CreateBranchResponse
|
||||||
11, // [11:16] is the sub-list for method input_type
|
6, // 22: rpc.ReferenceService.DeleteBranch:output_type -> rpc.DeleteBranchResponse
|
||||||
11, // [11:11] is the sub-list for extension type_name
|
8, // 23: rpc.ReferenceService.ListBranches:output_type -> rpc.ListBranchesResponse
|
||||||
11, // [11:11] is the sub-list for extension extendee
|
11, // 24: rpc.ReferenceService.ListCommitTags:output_type -> rpc.ListCommitTagsResponse
|
||||||
0, // [0:11] is the sub-list for field type_name
|
14, // 25: rpc.ReferenceService.GetRef:output_type -> rpc.GetRefResponse
|
||||||
|
21, // [21:26] is the sub-list for method output_type
|
||||||
|
16, // [16:21] is the sub-list for method input_type
|
||||||
|
16, // [16:16] is the sub-list for extension type_name
|
||||||
|
16, // [16:16] is the sub-list for extension extendee
|
||||||
|
0, // [0:16] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_ref_proto_init() }
|
func init() { file_ref_proto_init() }
|
||||||
|
@ -209,7 +209,7 @@ type CreateRepositoryRequestHeader struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
|
Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
DefaultBranch string `protobuf:"bytes,2,opt,name=default_branch,json=defaultBranch,proto3" json:"default_branch,omitempty"`
|
DefaultBranch string `protobuf:"bytes,2,opt,name=default_branch,json=defaultBranch,proto3" json:"default_branch,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,11 +245,11 @@ func (*CreateRepositoryRequestHeader) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{1}
|
return file_repo_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateRepositoryRequestHeader) GetUid() string {
|
func (x *CreateRepositoryRequestHeader) GetBase() *WriteRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Uid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateRepositoryRequestHeader) GetDefaultBranch() string {
|
func (x *CreateRepositoryRequestHeader) GetDefaultBranch() string {
|
||||||
@ -302,7 +302,7 @@ type GetTreeNodeRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
||||||
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
||||||
IncludeLatestCommit bool `protobuf:"varint,4,opt,name=include_latest_commit,json=includeLatestCommit,proto3" json:"include_latest_commit,omitempty"`
|
IncludeLatestCommit bool `protobuf:"varint,4,opt,name=include_latest_commit,json=includeLatestCommit,proto3" json:"include_latest_commit,omitempty"`
|
||||||
@ -340,11 +340,11 @@ func (*GetTreeNodeRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{3}
|
return file_repo_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetTreeNodeRequest) GetRepoUid() string {
|
func (x *GetTreeNodeRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetTreeNodeRequest) GetGitRef() string {
|
func (x *GetTreeNodeRequest) GetGitRef() string {
|
||||||
@ -428,7 +428,7 @@ type ListTreeNodesRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
||||||
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
||||||
IncludeLatestCommit bool `protobuf:"varint,4,opt,name=include_latest_commit,json=includeLatestCommit,proto3" json:"include_latest_commit,omitempty"`
|
IncludeLatestCommit bool `protobuf:"varint,4,opt,name=include_latest_commit,json=includeLatestCommit,proto3" json:"include_latest_commit,omitempty"`
|
||||||
@ -467,11 +467,11 @@ func (*ListTreeNodesRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{5}
|
return file_repo_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListTreeNodesRequest) GetRepoUid() string {
|
func (x *ListTreeNodesRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListTreeNodesRequest) GetGitRef() string {
|
func (x *ListTreeNodesRequest) GetGitRef() string {
|
||||||
@ -641,7 +641,7 @@ type ListCommitsRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
||||||
After string `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"`
|
After string `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"`
|
||||||
Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
|
Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
|
||||||
@ -680,11 +680,11 @@ func (*ListCommitsRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{8}
|
return file_repo_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListCommitsRequest) GetRepoUid() string {
|
func (x *ListCommitsRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListCommitsRequest) GetGitRef() string {
|
func (x *ListCommitsRequest) GetGitRef() string {
|
||||||
@ -767,7 +767,7 @@ type GetBlobRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
Sha string `protobuf:"bytes,2,opt,name=sha,proto3" json:"sha,omitempty"`
|
Sha string `protobuf:"bytes,2,opt,name=sha,proto3" json:"sha,omitempty"`
|
||||||
SizeLimit int64 `protobuf:"varint,3,opt,name=sizeLimit,proto3" json:"sizeLimit,omitempty"`
|
SizeLimit int64 `protobuf:"varint,3,opt,name=sizeLimit,proto3" json:"sizeLimit,omitempty"`
|
||||||
}
|
}
|
||||||
@ -804,11 +804,11 @@ func (*GetBlobRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{10}
|
return file_repo_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetBlobRequest) GetRepoUid() string {
|
func (x *GetBlobRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetBlobRequest) GetSha() string {
|
func (x *GetBlobRequest) GetSha() string {
|
||||||
@ -940,7 +940,7 @@ type GetSubmoduleRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
|
||||||
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
||||||
}
|
}
|
||||||
@ -977,11 +977,11 @@ func (*GetSubmoduleRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{13}
|
return file_repo_proto_rawDescGZIP(), []int{13}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetSubmoduleRequest) GetRepoUid() string {
|
func (x *GetSubmoduleRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetSubmoduleRequest) GetGitRef() string {
|
func (x *GetSubmoduleRequest) GetGitRef() string {
|
||||||
@ -1105,7 +1105,7 @@ type GetCommitDivergencesRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
MaxCount int32 `protobuf:"varint,2,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
|
MaxCount int32 `protobuf:"varint,2,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
|
||||||
Requests []*CommitDivergenceRequest `protobuf:"bytes,3,rep,name=requests,proto3" json:"requests,omitempty"`
|
Requests []*CommitDivergenceRequest `protobuf:"bytes,3,rep,name=requests,proto3" json:"requests,omitempty"`
|
||||||
}
|
}
|
||||||
@ -1142,11 +1142,11 @@ func (*GetCommitDivergencesRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_repo_proto_rawDescGZIP(), []int{16}
|
return file_repo_proto_rawDescGZIP(), []int{16}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetCommitDivergencesRequest) GetRepoUid() string {
|
func (x *GetCommitDivergencesRequest) GetBase() *ReadRequest {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RepoUid
|
return x.Base
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetCommitDivergencesRequest) GetMaxCount() int32 {
|
func (x *GetCommitDivergencesRequest) GetMaxCount() int32 {
|
||||||
@ -1333,17 +1333,19 @@ var file_repo_proto_rawDesc = []byte{
|
|||||||
0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x69, 0x6c,
|
0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x69, 0x6c,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69,
|
||||||
0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65,
|
0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65,
|
||||||
0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x58, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61,
|
0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6d, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61,
|
||||||
0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75,
|
0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
|
0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x64,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72,
|
||||||
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20,
|
0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x72, 0x61, 0x6e,
|
0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x72, 0x61, 0x6e,
|
||||||
0x63, 0x68, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f,
|
0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||||
0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90,
|
0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74,
|
||||||
0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65,
|
0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69,
|
0x6e, 0x73, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64,
|
0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61,
|
||||||
|
0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
||||||
|
0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65,
|
||||||
0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
|
0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
|
||||||
0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x32, 0x0a,
|
0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x32, 0x0a,
|
||||||
@ -1356,145 +1358,148 @@ var file_repo_proto_rawDesc = []byte{
|
|||||||
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63,
|
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70,
|
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70,
|
||||||
0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x22, 0xb0, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64,
|
0x22, 0xbb, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64,
|
||||||
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70,
|
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73,
|
||||||
0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||||
0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18,
|
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a,
|
0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74,
|
0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
|
||||||
0x68, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6c, 0x61, 0x74,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x32, 0x0a, 0x15,
|
||||||
0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
|
0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63,
|
||||||
0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43,
|
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69,
|
0x6c, 0x75, 0x64, 0x65, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73,
|
0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20,
|
||||||
0x69, 0x76, 0x65, 0x22, 0x5f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e,
|
0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x22, 0x5f,
|
||||||
0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04,
|
0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52,
|
||||||
0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18,
|
||||||
0x2e, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12,
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x65, 0x65,
|
||||||
0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f,
|
||||||
0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f,
|
0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63,
|
||||||
0x6d, 0x6d, 0x69, 0x74, 0x22, 0x92, 0x01, 0x0a, 0x08, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64,
|
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22,
|
||||||
0x65, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
0x92, 0x01, 0x0a, 0x08, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x04,
|
||||||
0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79,
|
0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63,
|
||||||
0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65,
|
0x2e, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x65,
|
0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12,
|
0x0e, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||||
0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68,
|
0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68,
|
||||||
0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x12, 0x0a, 0x04,
|
||||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20,
|
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x88, 0x01, 0x0a, 0x12, 0x4c, 0x69,
|
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||||
0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x70, 0x61, 0x74, 0x68, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d,
|
||||||
0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62,
|
||||||
0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67,
|
0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69,
|
0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73,
|
||||||
0x74, 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20,
|
0x65, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
|
0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x66,
|
||||||
0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14,
|
0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72,
|
||||||
0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c,
|
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
|
||||||
0x69, 0x6d, 0x69, 0x74, 0x22, 0x3a, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
|
0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20,
|
||||||
0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63,
|
0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x3a, 0x0a, 0x13, 0x4c, 0x69,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70,
|
0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x65, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x22, 0x5b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06,
|
||||||
0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01,
|
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x66, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x10, 0x0a,
|
0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65,
|
||||||
0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61,
|
||||||
0x1c, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01,
|
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10,
|
||||||
0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x30, 0x0a,
|
0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61,
|
||||||
0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20,
|
||||||
0x12, 0x1d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09,
|
0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x30,
|
||||||
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22,
|
0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x46, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01,
|
0x65, 0x12, 0x1d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,
|
0x09, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a,
|
0x22, 0x46, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18,
|
||||||
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69,
|
||||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75,
|
0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18,
|
||||||
0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19,
|
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||||
0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x68, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53,
|
||||||
0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74,
|
0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52,
|
0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e,
|
||||||
0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52,
|
||||||
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x44, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62,
|
0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66,
|
||||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12,
|
||||||
0x0a, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61,
|
||||||
0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
0x74, 0x68, 0x22, 0x44, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
0x65, 0x52, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x09,
|
0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x73, 0x75,
|
||||||
0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
|
0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
|
||||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a,
|
0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73,
|
||||||
0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22,
|
0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x6d,
|
||||||
0x8f, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76,
|
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c,
|
||||||
0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x9a, 0x01, 0x0a, 0x1b,
|
||||||
0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61,
|
0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65,
|
||||||
0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d,
|
0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62,
|
||||||
0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65,
|
0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73,
|
||||||
|
0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38,
|
||||||
|
0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
|
||||||
|
0x32, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76,
|
||||||
|
0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08,
|
||||||
|
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x3d, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d,
|
||||||
|
0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
|
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f,
|
||||||
|
0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x76, 0x65, 0x72,
|
||||||
|
0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72,
|
||||||
|
0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65,
|
||||||
|
0x6e, 0x63, 0x65, 0x52, 0x0b, 0x64, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73,
|
||||||
|
0x22, 0x40, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67,
|
||||||
|
0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x05, 0x52, 0x05, 0x61, 0x68, 0x65, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65,
|
||||||
|
0x68, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x68, 0x69,
|
||||||
|
0x6e, 0x64, 0x2a, 0x52, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79,
|
||||||
|
0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79,
|
||||||
|
0x70, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65,
|
||||||
|
0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x10, 0x01, 0x12, 0x16,
|
||||||
|
0x0a, 0x12, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f,
|
||||||
|
0x6d, 0x6d, 0x69, 0x74, 0x10, 0x02, 0x2a, 0x81, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x65, 0x4e,
|
||||||
|
0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e,
|
||||||
|
0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x17, 0x0a,
|
||||||
|
0x13, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x79, 0x6d,
|
||||||
|
0x6c, 0x69, 0x6e, 0x6b, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
|
||||||
|
0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x45, 0x78, 0x65, 0x63, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10,
|
||||||
|
0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x54, 0x72, 0x65, 0x65,
|
||||||
|
0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f,
|
||||||
|
0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x10, 0x04, 0x32, 0x8e, 0x04, 0x0a, 0x11, 0x52,
|
||||||
|
0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
|
0x12, 0x51, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
|
||||||
|
0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
|
||||||
|
0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52,
|
||||||
|
0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x28, 0x01, 0x12, 0x40, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
|
||||||
|
0x64, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65,
|
||||||
|
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70,
|
||||||
|
0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65,
|
||||||
|
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73,
|
||||||
|
0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65,
|
||||||
|
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12,
|
||||||
|
0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12,
|
||||||
|
0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
|
0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
|
0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12,
|
||||||
|
0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71,
|
||||||
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c,
|
||||||
|
0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
|
0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d,
|
||||||
|
0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5b,
|
||||||
|
0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72,
|
||||||
|
0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74,
|
||||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65,
|
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
|
||||||
0x73, 0x22, 0x3d, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72,
|
0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e,
|
||||||
0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67,
|
||||||
0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,
|
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73,
|
||||||
0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f,
|
0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63,
|
||||||
0x22, 0x57, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76,
|
0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
|
||||||
0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18,
|
|
||||||
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
|
|
||||||
0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x64, 0x69,
|
|
||||||
0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x43, 0x6f, 0x6d,
|
|
||||||
0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a,
|
|
||||||
0x05, 0x61, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x61, 0x68,
|
|
||||||
0x65, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20,
|
|
||||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x2a, 0x52, 0x0a, 0x0c, 0x54,
|
|
||||||
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54,
|
|
||||||
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10,
|
|
||||||
0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
|
|
||||||
0x65, 0x42, 0x6c, 0x6f, 0x62, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x72, 0x65, 0x65, 0x4e,
|
|
||||||
0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x10, 0x02, 0x2a,
|
|
||||||
0x81, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65,
|
|
||||||
0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65,
|
|
||||||
0x46, 0x69, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
|
|
||||||
0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x10, 0x01, 0x12,
|
|
||||||
0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x45,
|
|
||||||
0x78, 0x65, 0x63, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64,
|
|
||||||
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x54,
|
|
||||||
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
|
||||||
0x74, 0x10, 0x04, 0x32, 0x8e, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
|
|
||||||
0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x43, 0x72, 0x65,
|
|
||||||
0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e,
|
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
|
|
||||||
0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x70,
|
|
||||||
0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
|
|
||||||
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x40, 0x0a, 0x0b,
|
|
||||||
0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x70,
|
|
||||||
0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71,
|
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72,
|
|
||||||
0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48,
|
|
||||||
0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12,
|
|
||||||
0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
|
|
||||||
0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70, 0x63,
|
|
||||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65,
|
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53,
|
|
||||||
0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
|
|
||||||
0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
|
||||||
0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d,
|
|
||||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a,
|
|
||||||
0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
|
|
||||||
0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
||||||
0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
|
||||||
0x74, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d,
|
|
||||||
0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70,
|
|
||||||
0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73,
|
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f,
|
|
||||||
0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12,
|
|
||||||
0x20, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44,
|
|
||||||
0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
|
||||||
0x74, 0x1a, 0x21, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
|
||||||
0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
|
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
|
||||||
0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65,
|
|
||||||
0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
|
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -1535,41 +1540,50 @@ var file_repo_proto_goTypes = []interface{}{
|
|||||||
(*GetCommitDivergencesResponse)(nil), // 20: rpc.GetCommitDivergencesResponse
|
(*GetCommitDivergencesResponse)(nil), // 20: rpc.GetCommitDivergencesResponse
|
||||||
(*CommitDivergence)(nil), // 21: rpc.CommitDivergence
|
(*CommitDivergence)(nil), // 21: rpc.CommitDivergence
|
||||||
(*FileUpload)(nil), // 22: rpc.FileUpload
|
(*FileUpload)(nil), // 22: rpc.FileUpload
|
||||||
(*Commit)(nil), // 23: rpc.Commit
|
(*WriteRequest)(nil), // 23: rpc.WriteRequest
|
||||||
|
(*ReadRequest)(nil), // 24: rpc.ReadRequest
|
||||||
|
(*Commit)(nil), // 25: rpc.Commit
|
||||||
}
|
}
|
||||||
var file_repo_proto_depIdxs = []int32{
|
var file_repo_proto_depIdxs = []int32{
|
||||||
3, // 0: rpc.CreateRepositoryRequest.header:type_name -> rpc.CreateRepositoryRequestHeader
|
3, // 0: rpc.CreateRepositoryRequest.header:type_name -> rpc.CreateRepositoryRequestHeader
|
||||||
22, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload
|
22, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload
|
||||||
9, // 2: rpc.GetTreeNodeResponse.node:type_name -> rpc.TreeNode
|
23, // 2: rpc.CreateRepositoryRequestHeader.base:type_name -> rpc.WriteRequest
|
||||||
23, // 3: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit
|
24, // 3: rpc.GetTreeNodeRequest.base:type_name -> rpc.ReadRequest
|
||||||
9, // 4: rpc.ListTreeNodesResponse.node:type_name -> rpc.TreeNode
|
9, // 4: rpc.GetTreeNodeResponse.node:type_name -> rpc.TreeNode
|
||||||
23, // 5: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit
|
25, // 5: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit
|
||||||
0, // 6: rpc.TreeNode.type:type_name -> rpc.TreeNodeType
|
24, // 6: rpc.ListTreeNodesRequest.base:type_name -> rpc.ReadRequest
|
||||||
1, // 7: rpc.TreeNode.mode:type_name -> rpc.TreeNodeMode
|
9, // 7: rpc.ListTreeNodesResponse.node:type_name -> rpc.TreeNode
|
||||||
23, // 8: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit
|
25, // 8: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit
|
||||||
14, // 9: rpc.GetBlobResponse.blob:type_name -> rpc.Blob
|
0, // 9: rpc.TreeNode.type:type_name -> rpc.TreeNodeType
|
||||||
17, // 10: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule
|
1, // 10: rpc.TreeNode.mode:type_name -> rpc.TreeNodeMode
|
||||||
19, // 11: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest
|
24, // 11: rpc.ListCommitsRequest.base:type_name -> rpc.ReadRequest
|
||||||
21, // 12: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence
|
25, // 12: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit
|
||||||
2, // 13: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest
|
24, // 13: rpc.GetBlobRequest.base:type_name -> rpc.ReadRequest
|
||||||
5, // 14: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest
|
14, // 14: rpc.GetBlobResponse.blob:type_name -> rpc.Blob
|
||||||
7, // 15: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest
|
24, // 15: rpc.GetSubmoduleRequest.base:type_name -> rpc.ReadRequest
|
||||||
15, // 16: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest
|
17, // 16: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule
|
||||||
12, // 17: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest
|
24, // 17: rpc.GetCommitDivergencesRequest.base:type_name -> rpc.ReadRequest
|
||||||
10, // 18: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest
|
19, // 18: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest
|
||||||
18, // 19: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest
|
21, // 19: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence
|
||||||
4, // 20: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse
|
2, // 20: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest
|
||||||
6, // 21: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse
|
5, // 21: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest
|
||||||
8, // 22: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse
|
7, // 22: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest
|
||||||
16, // 23: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse
|
15, // 23: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest
|
||||||
13, // 24: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse
|
12, // 24: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest
|
||||||
11, // 25: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse
|
10, // 25: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest
|
||||||
20, // 26: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse
|
18, // 26: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest
|
||||||
20, // [20:27] is the sub-list for method output_type
|
4, // 27: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse
|
||||||
13, // [13:20] is the sub-list for method input_type
|
6, // 28: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse
|
||||||
13, // [13:13] is the sub-list for extension type_name
|
8, // 29: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse
|
||||||
13, // [13:13] is the sub-list for extension extendee
|
16, // 30: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse
|
||||||
0, // [0:13] is the sub-list for field type_name
|
13, // 31: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse
|
||||||
|
11, // 32: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse
|
||||||
|
20, // 33: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse
|
||||||
|
27, // [27:34] is the sub-list for method output_type
|
||||||
|
20, // [20:27] is the sub-list for method input_type
|
||||||
|
20, // [20:20] is the sub-list for extension type_name
|
||||||
|
20, // [20:20] is the sub-list for extension extendee
|
||||||
|
0, // [0:20] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_repo_proto_init() }
|
func init() { file_repo_proto_init() }
|
||||||
|
@ -69,6 +69,171 @@ func (SortOrder) EnumDescriptor() ([]byte, []int) {
|
|||||||
return file_shared_proto_rawDescGZIP(), []int{0}
|
return file_shared_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ReadRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ReadRequest) Reset() {
|
||||||
|
*x = ReadRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_shared_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ReadRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ReadRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ReadRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_shared_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ReadRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_shared_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ReadRequest) GetRepoUid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.RepoUid
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type WriteRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
|
||||||
|
EnvVars []*EnvVar `protobuf:"bytes,2,rep,name=env_vars,json=envVars,proto3" json:"env_vars,omitempty"`
|
||||||
|
Actor *Identity `protobuf:"bytes,3,opt,name=actor,proto3" json:"actor,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WriteRequest) Reset() {
|
||||||
|
*x = WriteRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_shared_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WriteRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WriteRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *WriteRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_shared_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*WriteRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_shared_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WriteRequest) GetRepoUid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.RepoUid
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WriteRequest) GetEnvVars() []*EnvVar {
|
||||||
|
if x != nil {
|
||||||
|
return x.EnvVars
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WriteRequest) GetActor() *Identity {
|
||||||
|
if x != nil {
|
||||||
|
return x.Actor
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type EnvVar struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EnvVar) Reset() {
|
||||||
|
*x = EnvVar{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_shared_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EnvVar) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*EnvVar) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *EnvVar) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_shared_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use EnvVar.ProtoReflect.Descriptor instead.
|
||||||
|
func (*EnvVar) Descriptor() ([]byte, []int) {
|
||||||
|
return file_shared_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EnvVar) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EnvVar) GetValue() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Value
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type FileUpload struct {
|
type FileUpload struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -83,7 +248,7 @@ type FileUpload struct {
|
|||||||
func (x *FileUpload) Reset() {
|
func (x *FileUpload) Reset() {
|
||||||
*x = FileUpload{}
|
*x = FileUpload{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[0]
|
mi := &file_shared_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -96,7 +261,7 @@ func (x *FileUpload) String() string {
|
|||||||
func (*FileUpload) ProtoMessage() {}
|
func (*FileUpload) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *FileUpload) ProtoReflect() protoreflect.Message {
|
func (x *FileUpload) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[0]
|
mi := &file_shared_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -109,7 +274,7 @@ func (x *FileUpload) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use FileUpload.ProtoReflect.Descriptor instead.
|
// Deprecated: Use FileUpload.ProtoReflect.Descriptor instead.
|
||||||
func (*FileUpload) Descriptor() ([]byte, []int) {
|
func (*FileUpload) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{0}
|
return file_shared_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *FileUpload) GetData() isFileUpload_Data {
|
func (m *FileUpload) GetData() isFileUpload_Data {
|
||||||
@ -160,7 +325,7 @@ type FileUploadHeader struct {
|
|||||||
func (x *FileUploadHeader) Reset() {
|
func (x *FileUploadHeader) Reset() {
|
||||||
*x = FileUploadHeader{}
|
*x = FileUploadHeader{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[1]
|
mi := &file_shared_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -173,7 +338,7 @@ func (x *FileUploadHeader) String() string {
|
|||||||
func (*FileUploadHeader) ProtoMessage() {}
|
func (*FileUploadHeader) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *FileUploadHeader) ProtoReflect() protoreflect.Message {
|
func (x *FileUploadHeader) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[1]
|
mi := &file_shared_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -186,7 +351,7 @@ func (x *FileUploadHeader) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use FileUploadHeader.ProtoReflect.Descriptor instead.
|
// Deprecated: Use FileUploadHeader.ProtoReflect.Descriptor instead.
|
||||||
func (*FileUploadHeader) Descriptor() ([]byte, []int) {
|
func (*FileUploadHeader) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{1}
|
return file_shared_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *FileUploadHeader) GetPath() string {
|
func (x *FileUploadHeader) GetPath() string {
|
||||||
@ -208,7 +373,7 @@ type Chunk struct {
|
|||||||
func (x *Chunk) Reset() {
|
func (x *Chunk) Reset() {
|
||||||
*x = Chunk{}
|
*x = Chunk{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[2]
|
mi := &file_shared_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -221,7 +386,7 @@ func (x *Chunk) String() string {
|
|||||||
func (*Chunk) ProtoMessage() {}
|
func (*Chunk) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Chunk) ProtoReflect() protoreflect.Message {
|
func (x *Chunk) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[2]
|
mi := &file_shared_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -234,7 +399,7 @@ func (x *Chunk) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Chunk.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Chunk.ProtoReflect.Descriptor instead.
|
||||||
func (*Chunk) Descriptor() ([]byte, []int) {
|
func (*Chunk) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{2}
|
return file_shared_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Chunk) GetEof() bool {
|
func (x *Chunk) GetEof() bool {
|
||||||
@ -266,7 +431,7 @@ type Commit struct {
|
|||||||
func (x *Commit) Reset() {
|
func (x *Commit) Reset() {
|
||||||
*x = Commit{}
|
*x = Commit{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[3]
|
mi := &file_shared_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -279,7 +444,7 @@ func (x *Commit) String() string {
|
|||||||
func (*Commit) ProtoMessage() {}
|
func (*Commit) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Commit) ProtoReflect() protoreflect.Message {
|
func (x *Commit) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[3]
|
mi := &file_shared_proto_msgTypes[6]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -292,7 +457,7 @@ func (x *Commit) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Commit.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Commit.ProtoReflect.Descriptor instead.
|
||||||
func (*Commit) Descriptor() ([]byte, []int) {
|
func (*Commit) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{3}
|
return file_shared_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Commit) GetSha() string {
|
func (x *Commit) GetSha() string {
|
||||||
@ -342,7 +507,7 @@ type Signature struct {
|
|||||||
func (x *Signature) Reset() {
|
func (x *Signature) Reset() {
|
||||||
*x = Signature{}
|
*x = Signature{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[4]
|
mi := &file_shared_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -355,7 +520,7 @@ func (x *Signature) String() string {
|
|||||||
func (*Signature) ProtoMessage() {}
|
func (*Signature) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Signature) ProtoReflect() protoreflect.Message {
|
func (x *Signature) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[4]
|
mi := &file_shared_proto_msgTypes[7]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -368,7 +533,7 @@ func (x *Signature) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Signature.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Signature.ProtoReflect.Descriptor instead.
|
||||||
func (*Signature) Descriptor() ([]byte, []int) {
|
func (*Signature) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{4}
|
return file_shared_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Signature) GetIdentity() *Identity {
|
func (x *Signature) GetIdentity() *Identity {
|
||||||
@ -397,7 +562,7 @@ type Identity struct {
|
|||||||
func (x *Identity) Reset() {
|
func (x *Identity) Reset() {
|
||||||
*x = Identity{}
|
*x = Identity{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_shared_proto_msgTypes[5]
|
mi := &file_shared_proto_msgTypes[8]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -410,7 +575,7 @@ func (x *Identity) String() string {
|
|||||||
func (*Identity) ProtoMessage() {}
|
func (*Identity) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Identity) ProtoReflect() protoreflect.Message {
|
func (x *Identity) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_shared_proto_msgTypes[5]
|
mi := &file_shared_proto_msgTypes[8]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -423,7 +588,7 @@ func (x *Identity) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Identity.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Identity.ProtoReflect.Descriptor instead.
|
||||||
func (*Identity) Descriptor() ([]byte, []int) {
|
func (*Identity) Descriptor() ([]byte, []int) {
|
||||||
return file_shared_proto_rawDescGZIP(), []int{5}
|
return file_shared_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Identity) GetName() string {
|
func (x *Identity) GetName() string {
|
||||||
@ -444,43 +609,56 @@ var File_shared_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_shared_proto_rawDesc = []byte{
|
var file_shared_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
|
0x0a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
|
||||||
0x72, 0x70, 0x63, 0x22, 0x69, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61,
|
0x72, 0x70, 0x63, 0x22, 0x28, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01,
|
||||||
0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x22, 0x76, 0x0a,
|
||||||
0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64,
|
0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a,
|
||||||
0x65, 0x72, 0x12, 0x22, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x0b, 0x32, 0x0a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52,
|
0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x5f,
|
||||||
0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x26,
|
0x76, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63,
|
||||||
0x0a, 0x10, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64,
|
0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x52, 0x07, 0x65, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x73,
|
||||||
0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x12, 0x23, 0x0a, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x2d, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12,
|
0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05,
|
||||||
0x10, 0x0a, 0x03, 0x65, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x65, 0x6f,
|
0x61, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x32, 0x0a, 0x06, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12,
|
||||||
0x66, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa0, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73,
|
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x69, 0x0a, 0x0a, 0x46, 0x69, 0x6c,
|
||||||
0x68, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65,
|
||||||
0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69,
|
||||||
0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00,
|
||||||
0x67, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01,
|
0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e,
|
||||||
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
|
0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68,
|
||||||
0x72, 0x65, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f,
|
0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x42, 0x06, 0x0a, 0x04,
|
||||||
0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
|
0x64, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a, 0x10, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x63,
|
0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
|
||||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x22, 0x4a, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x2d, 0x0a, 0x05,
|
||||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64,
|
0x28, 0x08, 0x52, 0x03, 0x65, 0x6f, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
|
||||||
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
|
0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa0, 0x01, 0x0a, 0x06,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
|
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20,
|
||||||
0x77, 0x68, 0x65, 0x6e, 0x22, 0x34, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
|
0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20,
|
0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x2a, 0x2b, 0x0a, 0x09, 0x53, 0x6f,
|
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68,
|
||||||
0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75,
|
0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53,
|
||||||
0x6c, 0x74, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x73, 0x63, 0x10, 0x01, 0x12, 0x08, 0x0a,
|
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
|
||||||
0x04, 0x44, 0x65, 0x73, 0x63, 0x10, 0x02, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69,
|
0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74,
|
||||||
0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63,
|
0x75, 0x72, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x22, 0x4a,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x69,
|
||||||
|
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
|
||||||
|
0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64,
|
||||||
|
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x22, 0x34, 0x0a, 0x08, 0x49, 0x64,
|
||||||
|
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d,
|
||||||
|
0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
|
||||||
|
0x2a, 0x2b, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0b, 0x0a,
|
||||||
|
0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x73,
|
||||||
|
0x63, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x65, 0x73, 0x63, 0x10, 0x02, 0x42, 0x27, 0x5a,
|
||||||
|
0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e,
|
||||||
|
0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72,
|
||||||
|
0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -496,27 +674,32 @@ func file_shared_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_shared_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_shared_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_shared_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_shared_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||||
var file_shared_proto_goTypes = []interface{}{
|
var file_shared_proto_goTypes = []interface{}{
|
||||||
(SortOrder)(0), // 0: rpc.SortOrder
|
(SortOrder)(0), // 0: rpc.SortOrder
|
||||||
(*FileUpload)(nil), // 1: rpc.FileUpload
|
(*ReadRequest)(nil), // 1: rpc.ReadRequest
|
||||||
(*FileUploadHeader)(nil), // 2: rpc.FileUploadHeader
|
(*WriteRequest)(nil), // 2: rpc.WriteRequest
|
||||||
(*Chunk)(nil), // 3: rpc.Chunk
|
(*EnvVar)(nil), // 3: rpc.EnvVar
|
||||||
(*Commit)(nil), // 4: rpc.Commit
|
(*FileUpload)(nil), // 4: rpc.FileUpload
|
||||||
(*Signature)(nil), // 5: rpc.Signature
|
(*FileUploadHeader)(nil), // 5: rpc.FileUploadHeader
|
||||||
(*Identity)(nil), // 6: rpc.Identity
|
(*Chunk)(nil), // 6: rpc.Chunk
|
||||||
|
(*Commit)(nil), // 7: rpc.Commit
|
||||||
|
(*Signature)(nil), // 8: rpc.Signature
|
||||||
|
(*Identity)(nil), // 9: rpc.Identity
|
||||||
}
|
}
|
||||||
var file_shared_proto_depIdxs = []int32{
|
var file_shared_proto_depIdxs = []int32{
|
||||||
2, // 0: rpc.FileUpload.header:type_name -> rpc.FileUploadHeader
|
3, // 0: rpc.WriteRequest.env_vars:type_name -> rpc.EnvVar
|
||||||
3, // 1: rpc.FileUpload.chunk:type_name -> rpc.Chunk
|
9, // 1: rpc.WriteRequest.actor:type_name -> rpc.Identity
|
||||||
5, // 2: rpc.Commit.author:type_name -> rpc.Signature
|
5, // 2: rpc.FileUpload.header:type_name -> rpc.FileUploadHeader
|
||||||
5, // 3: rpc.Commit.committer:type_name -> rpc.Signature
|
6, // 3: rpc.FileUpload.chunk:type_name -> rpc.Chunk
|
||||||
6, // 4: rpc.Signature.identity:type_name -> rpc.Identity
|
8, // 4: rpc.Commit.author:type_name -> rpc.Signature
|
||||||
5, // [5:5] is the sub-list for method output_type
|
8, // 5: rpc.Commit.committer:type_name -> rpc.Signature
|
||||||
5, // [5:5] is the sub-list for method input_type
|
9, // 6: rpc.Signature.identity:type_name -> rpc.Identity
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
7, // [7:7] is the sub-list for method output_type
|
||||||
5, // [5:5] is the sub-list for extension extendee
|
7, // [7:7] is the sub-list for method input_type
|
||||||
0, // [0:5] is the sub-list for field type_name
|
7, // [7:7] is the sub-list for extension type_name
|
||||||
|
7, // [7:7] is the sub-list for extension extendee
|
||||||
|
0, // [0:7] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_shared_proto_init() }
|
func init() { file_shared_proto_init() }
|
||||||
@ -526,7 +709,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_shared_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*FileUpload); i {
|
switch v := v.(*ReadRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -538,7 +721,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*FileUploadHeader); i {
|
switch v := v.(*WriteRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -550,7 +733,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Chunk); i {
|
switch v := v.(*EnvVar); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -562,7 +745,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Commit); i {
|
switch v := v.(*FileUpload); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -574,7 +757,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Signature); i {
|
switch v := v.(*FileUploadHeader); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -586,6 +769,42 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_shared_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Chunk); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_shared_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Commit); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_shared_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Signature); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_shared_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Identity); i {
|
switch v := v.(*Identity); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -598,7 +817,7 @@ func file_shared_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_shared_proto_msgTypes[0].OneofWrappers = []interface{}{
|
file_shared_proto_msgTypes[3].OneofWrappers = []interface{}{
|
||||||
(*FileUpload_Header)(nil),
|
(*FileUpload_Header)(nil),
|
||||||
(*FileUpload_Chunk)(nil),
|
(*FileUpload_Chunk)(nil),
|
||||||
}
|
}
|
||||||
@ -608,7 +827,7 @@ func file_shared_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_shared_proto_rawDesc,
|
RawDescriptor: file_shared_proto_rawDesc,
|
||||||
NumEnums: 1,
|
NumEnums: 1,
|
||||||
NumMessages: 6,
|
NumMessages: 9,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -7,6 +7,7 @@ package server
|
|||||||
// Config represents the configuration for the gitrpc server.
|
// Config represents the configuration for the gitrpc server.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
GitRoot string
|
GitRoot string
|
||||||
ReposTempPath string
|
TmpDir string
|
||||||
Bind string
|
Bind string
|
||||||
|
ServerHookPath string
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,10 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/harness/gitness/events"
|
|
||||||
git_events "github.com/harness/gitness/gitrpc/events"
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/gitea"
|
"github.com/harness/gitness/gitrpc/internal/gitea"
|
||||||
"github.com/harness/gitness/gitrpc/internal/middleware"
|
"github.com/harness/gitness/gitrpc/internal/middleware"
|
||||||
"github.com/harness/gitness/gitrpc/internal/service"
|
"github.com/harness/gitness/gitrpc/internal/service"
|
||||||
@ -34,7 +31,7 @@ type Server struct {
|
|||||||
Bind string
|
Bind string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServer(config Config, eventsSystem *events.System) (*Server, error) {
|
func NewServer(config Config) (*Server, error) {
|
||||||
// Create repos folder
|
// Create repos folder
|
||||||
reposRoot := filepath.Join(config.GitRoot, repoSubdirName)
|
reposRoot := filepath.Join(config.GitRoot, repoSubdirName)
|
||||||
if _, err := os.Stat(reposRoot); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(reposRoot); errors.Is(err, os.ErrNotExist) {
|
||||||
@ -67,17 +64,13 @@ func NewServer(config Config, eventsSystem *events.System) (*Server, error) {
|
|||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
store := storage.NewLocalStore()
|
store := storage.NewLocalStore()
|
||||||
eventReporter, err := git_events.NewReporter(eventsSystem)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("faield to create new event reporter: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize services
|
// initialize services
|
||||||
repoService, err := service.NewRepositoryService(adapter, store, reposRoot)
|
repoService, err := service.NewRepositoryService(adapter, store, reposRoot, config.ServerHookPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
refService, err := service.NewReferenceService(adapter, eventReporter, reposRoot)
|
refService, err := service.NewReferenceService(adapter, reposRoot, config.TmpDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -85,7 +78,7 @@ func NewServer(config Config, eventsSystem *events.System) (*Server, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
commitFilesService, err := service.NewCommitFilesService(adapter, reposRoot, config.ReposTempPath)
|
commitFilesService, err := service.NewCommitFilesService(adapter, reposRoot, config.TmpDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/harness/gitness/events"
|
|
||||||
|
|
||||||
"github.com/google/wire"
|
"github.com/google/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,6 +13,6 @@ var WireSet = wire.NewSet(
|
|||||||
ProvideServer,
|
ProvideServer,
|
||||||
)
|
)
|
||||||
|
|
||||||
func ProvideServer(config Config, eventsSystem *events.System) (*Server, error) {
|
func ProvideServer(config Config) (*Server, error) {
|
||||||
return NewServer(config, eventsSystem)
|
return NewServer(config)
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/harness/gitness/gitrpc/internal/streamio"
|
"github.com/harness/gitness/gitrpc/internal/streamio"
|
||||||
"github.com/harness/gitness/gitrpc/rpc"
|
"github.com/harness/gitness/gitrpc/rpc"
|
||||||
@ -18,8 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type InfoRefsParams struct {
|
type InfoRefsParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
Service string
|
Service string
|
||||||
Options []string // (key, value) pair
|
Options []string // (key, value) pair
|
||||||
GitProtocol string
|
GitProtocol string
|
||||||
@ -33,7 +31,7 @@ func (c *Client) GetInfoRefs(ctx context.Context, w io.Writer, params *InfoRefsP
|
|||||||
return ErrNoParamsProvided
|
return ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
stream, err := c.httpService.InfoRefs(ctx, &rpc.InfoRefsRequest{
|
stream, err := c.httpService.InfoRefs(ctx, &rpc.InfoRefsRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
Service: params.Service,
|
Service: params.Service,
|
||||||
GitConfigOptions: params.Options,
|
GitConfigOptions: params.Options,
|
||||||
GitProtocol: params.GitProtocol,
|
GitProtocol: params.GitProtocol,
|
||||||
@ -63,12 +61,10 @@ func (c *Client) GetInfoRefs(ctx context.Context, w io.Writer, params *InfoRefsP
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ServicePackParams struct {
|
type ServicePackParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
*ReadParams
|
||||||
RepoUID string
|
*WriteParams
|
||||||
Service string
|
Service string
|
||||||
GitProtocol string
|
GitProtocol string
|
||||||
// PrincipalID used for git hooks in receive-pack service
|
|
||||||
PrincipalID int64
|
|
||||||
Data io.ReadCloser
|
Data io.ReadCloser
|
||||||
Options []string // (key, value) pair
|
Options []string // (key, value) pair
|
||||||
}
|
}
|
||||||
@ -83,6 +79,32 @@ func (c *Client) ServicePack(ctx context.Context, w io.Writer, params *ServicePa
|
|||||||
|
|
||||||
log := log.Ctx(ctx)
|
log := log.Ctx(ctx)
|
||||||
|
|
||||||
|
// create request (depends on service whether we need readparams or writeparams)
|
||||||
|
// TODO: can we solve this nicer? expose two methods instead?
|
||||||
|
request := &rpc.ServicePackRequest{
|
||||||
|
Service: params.Service,
|
||||||
|
GitConfigOptions: params.Options,
|
||||||
|
GitProtocol: params.GitProtocol,
|
||||||
|
}
|
||||||
|
switch params.Service {
|
||||||
|
case rpc.ServiceUploadPack:
|
||||||
|
if params.ReadParams == nil {
|
||||||
|
return errors.New("upload-pack requires ReadParams")
|
||||||
|
}
|
||||||
|
request.Base = &rpc.ServicePackRequest_ReadBase{
|
||||||
|
ReadBase: mapToRPCReadRequest(*params.ReadParams),
|
||||||
|
}
|
||||||
|
case rpc.ServiceReceivePack:
|
||||||
|
if params.WriteParams == nil {
|
||||||
|
return errors.New("receive-pack requires WriteParams")
|
||||||
|
}
|
||||||
|
request.Base = &rpc.ServicePackRequest_WriteBase{
|
||||||
|
WriteBase: mapToRPCWriteRequest(*params.WriteParams),
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("unsupported service provided: %s", params.Service)
|
||||||
|
}
|
||||||
|
|
||||||
stream, err := c.httpService.ServicePack(ctx)
|
stream, err := c.httpService.ServicePack(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -92,13 +114,7 @@ func (c *Client) ServicePack(ctx context.Context, w io.Writer, params *ServicePa
|
|||||||
params.Service, params.Options)
|
params.Service, params.Options)
|
||||||
|
|
||||||
// send basic information
|
// send basic information
|
||||||
if err = stream.Send(&rpc.ServicePackRequest{
|
if err = stream.Send(request); err != nil {
|
||||||
RepoUid: params.RepoUID,
|
|
||||||
Service: params.Service,
|
|
||||||
GitConfigOptions: params.Options,
|
|
||||||
GitProtocol: params.GitProtocol,
|
|
||||||
PrincipalId: strconv.FormatInt(params.PrincipalID, 10),
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GetSubmoduleParams struct {
|
type GetSubmoduleParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
// GitREF is a git reference (branch / tag / commit SHA)
|
// GitREF is a git reference (branch / tag / commit SHA)
|
||||||
GitREF string
|
GitREF string
|
||||||
Path string
|
Path string
|
||||||
@ -32,7 +31,7 @@ func (c *Client) GetSubmodule(ctx context.Context, params *GetSubmoduleParams) (
|
|||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
resp, err := c.repoService.GetSubmodule(ctx, &rpc.GetSubmoduleRequest{
|
resp, err := c.repoService.GetSubmodule(ctx, &rpc.GetSubmoduleRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
GitRef: params.GitREF,
|
GitRef: params.GitREF,
|
||||||
Path: params.Path,
|
Path: params.Path,
|
||||||
})
|
})
|
||||||
|
@ -24,8 +24,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ListCommitTagsParams struct {
|
type ListCommitTagsParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
IncludeCommit bool
|
IncludeCommit bool
|
||||||
Query string
|
Query string
|
||||||
Sort TagSortOption
|
Sort TagSortOption
|
||||||
@ -54,7 +53,7 @@ func (c *Client) ListCommitTags(ctx context.Context, params *ListCommitTagsParam
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream, err := c.refService.ListCommitTags(ctx, &rpc.ListCommitTagsRequest{
|
stream, err := c.refService.ListCommitTags(ctx, &rpc.ListCommitTagsRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
IncludeCommit: params.IncludeCommit,
|
IncludeCommit: params.IncludeCommit,
|
||||||
Query: params.Query,
|
Query: params.Query,
|
||||||
Sort: mapToRPCListCommitTagsSortOption(params.Sort),
|
Sort: mapToRPCListCommitTagsSortOption(params.Sort),
|
||||||
|
@ -46,8 +46,7 @@ type TreeNode struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ListTreeNodeParams struct {
|
type ListTreeNodeParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
// GitREF is a git reference (branch / tag / commit SHA)
|
// GitREF is a git reference (branch / tag / commit SHA)
|
||||||
GitREF string
|
GitREF string
|
||||||
Path string
|
Path string
|
||||||
@ -65,8 +64,7 @@ type TreeNodeWithCommit struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GetTreeNodeParams struct {
|
type GetTreeNodeParams struct {
|
||||||
// RepoUID is the uid of the git repository
|
ReadParams
|
||||||
RepoUID string
|
|
||||||
// GitREF is a git reference (branch / tag / commit SHA)
|
// GitREF is a git reference (branch / tag / commit SHA)
|
||||||
GitREF string
|
GitREF string
|
||||||
Path string
|
Path string
|
||||||
@ -83,7 +81,7 @@ func (c *Client) GetTreeNode(ctx context.Context, params *GetTreeNodeParams) (*G
|
|||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
resp, err := c.repoService.GetTreeNode(ctx, &rpc.GetTreeNodeRequest{
|
resp, err := c.repoService.GetTreeNode(ctx, &rpc.GetTreeNodeRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
GitRef: params.GitREF,
|
GitRef: params.GitREF,
|
||||||
Path: params.Path,
|
Path: params.Path,
|
||||||
IncludeLatestCommit: params.IncludeLatestCommit,
|
IncludeLatestCommit: params.IncludeLatestCommit,
|
||||||
@ -115,7 +113,7 @@ func (c *Client) ListTreeNodes(ctx context.Context, params *ListTreeNodeParams)
|
|||||||
return nil, ErrNoParamsProvided
|
return nil, ErrNoParamsProvided
|
||||||
}
|
}
|
||||||
stream, err := c.repoService.ListTreeNodes(ctx, &rpc.ListTreeNodesRequest{
|
stream, err := c.repoService.ListTreeNodes(ctx, &rpc.ListTreeNodesRequest{
|
||||||
RepoUid: params.RepoUID,
|
Base: mapToRPCReadRequest(params.ReadParams),
|
||||||
GitRef: params.GitREF,
|
GitRef: params.GitREF,
|
||||||
Path: params.Path,
|
Path: params.Path,
|
||||||
IncludeLatestCommit: params.IncludeLatestCommit,
|
IncludeLatestCommit: params.IncludeLatestCommit,
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/harness/gitness/gitrpc"
|
"github.com/harness/gitness/gitrpc"
|
||||||
apiauth "github.com/harness/gitness/internal/api/auth"
|
apiauth "github.com/harness/gitness/internal/api/auth"
|
||||||
|
repoctrl "github.com/harness/gitness/internal/api/controller/repo"
|
||||||
"github.com/harness/gitness/internal/api/usererror"
|
"github.com/harness/gitness/internal/api/usererror"
|
||||||
"github.com/harness/gitness/internal/auth"
|
"github.com/harness/gitness/internal/auth"
|
||||||
"github.com/harness/gitness/internal/auth/authz"
|
"github.com/harness/gitness/internal/auth/authz"
|
||||||
@ -51,13 +52,17 @@ func NewController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) verifyBranchExistence(ctx context.Context, repo *types.Repository, branch string) error {
|
func (c *Controller) verifyBranchExistence(ctx context.Context,
|
||||||
|
repo *types.Repository, branch string) error {
|
||||||
if branch == "" {
|
if branch == "" {
|
||||||
return usererror.BadRequest("branch name can't be empty")
|
return usererror.BadRequest("branch name can't be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := c.gitRPCClient.GetRef(ctx,
|
_, err := c.gitRPCClient.GetRef(ctx,
|
||||||
&gitrpc.GetRefParams{RepoUID: repo.GitUID, Name: branch, Type: gitrpc.RefTypeBranch})
|
&gitrpc.GetRefParams{
|
||||||
|
ReadParams: repoctrl.CreateRPCReadParams(repo),
|
||||||
|
Name: branch,
|
||||||
|
Type: gitrpc.RefTypeBranch})
|
||||||
if errors.Is(err, gitrpc.ErrNotFound) {
|
if errors.Is(err, gitrpc.ErrNotFound) {
|
||||||
return usererror.BadRequest(
|
return usererror.BadRequest(
|
||||||
fmt.Sprintf("branch %s does not exist in the repository %s", branch, repo.UID))
|
fmt.Sprintf("branch %s does not exist in the repository %s", branch, repo.UID))
|
||||||
|
@ -58,8 +58,8 @@ func (c *Controller) CommitFiles(ctx context.Context, session *auth.Session,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
commit, err := c.gitRPCClient.CommitFiles(ctx, &gitrpc.CommitFilesOptions{
|
commit, err := c.gitRPCClient.CommitFiles(ctx, &gitrpc.CommitFilesParams{
|
||||||
RepoID: repo.GitUID,
|
WriteParams: CreateRPCWriteParams(session, repo),
|
||||||
Title: in.Title,
|
Title: in.Title,
|
||||||
Message: in.Message,
|
Message: in.Message,
|
||||||
Branch: in.Branch,
|
Branch: in.Branch,
|
||||||
|
@ -6,8 +6,10 @@ package repo
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/harness/gitness/gitrpc"
|
"github.com/harness/gitness/gitrpc"
|
||||||
|
"github.com/harness/gitness/internal/auth"
|
||||||
"github.com/harness/gitness/internal/auth/authz"
|
"github.com/harness/gitness/internal/auth/authz"
|
||||||
"github.com/harness/gitness/internal/store"
|
"github.com/harness/gitness/internal/store"
|
||||||
|
"github.com/harness/gitness/types"
|
||||||
"github.com/harness/gitness/types/check"
|
"github.com/harness/gitness/types/check"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -43,3 +45,28 @@ func NewController(
|
|||||||
gitRPCClient: gitRPCClient,
|
gitRPCClient: gitRPCClient,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateRPCWriteParams creates base write parameters for gitrpc write operations.
|
||||||
|
// IMPORTANT: session & repo are assumed to be not nil!
|
||||||
|
func CreateRPCWriteParams(session *auth.Session, repo *types.Repository) gitrpc.WriteParams {
|
||||||
|
// generate envars (add everything githook CLI needs for execution)
|
||||||
|
// TODO: envVars := githook.GenerateGitHookEnvironmentVariables(repo, session.Principal)
|
||||||
|
envVars := map[string]string{}
|
||||||
|
|
||||||
|
return gitrpc.WriteParams{
|
||||||
|
Actor: gitrpc.Identity{
|
||||||
|
Name: session.Principal.DisplayName,
|
||||||
|
Email: session.Principal.Email,
|
||||||
|
},
|
||||||
|
RepoUID: repo.GitUID,
|
||||||
|
EnvVars: envVars,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateRPCReadParams creates base read parameters for gitrpc read operations.
|
||||||
|
// IMPORTANT: repo is assumed to be not nil!
|
||||||
|
func CreateRPCReadParams(repo *types.Repository) gitrpc.ReadParams {
|
||||||
|
return gitrpc.ReadParams{
|
||||||
|
RepoUID: repo.GitUID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -48,7 +48,7 @@ func (c *Controller) CreateBranch(ctx context.Context, session *auth.Session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rpcOut, err := c.gitRPCClient.CreateBranch(ctx, &gitrpc.CreateBranchParams{
|
rpcOut, err := c.gitRPCClient.CreateBranch(ctx, &gitrpc.CreateBranchParams{
|
||||||
RepoUID: repo.GitUID,
|
WriteParams: CreateRPCWriteParams(session, repo),
|
||||||
BranchName: in.Name,
|
BranchName: in.Name,
|
||||||
Target: *in.Target,
|
Target: *in.Target,
|
||||||
})
|
})
|
||||||
|
@ -34,7 +34,7 @@ func (c *Controller) DeleteBranch(ctx context.Context, session *auth.Session, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = c.gitRPCClient.DeleteBranch(ctx, &gitrpc.DeleteBranchParams{
|
err = c.gitRPCClient.DeleteBranch(ctx, &gitrpc.DeleteBranchParams{
|
||||||
RepoUID: repo.GitUID,
|
WriteParams: CreateRPCWriteParams(session, repo),
|
||||||
BranchName: branchName,
|
BranchName: branchName,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -33,8 +33,8 @@ func (c *Controller) RawDiff(
|
|||||||
|
|
||||||
info := parseDiffPath(path)
|
info := parseDiffPath(path)
|
||||||
|
|
||||||
return c.gitRPCClient.RawDiff(ctx, &gitrpc.RawDiffRequest{
|
return c.gitRPCClient.RawDiff(ctx, &gitrpc.RawDiffParams{
|
||||||
RepoID: repo.GitUID,
|
ReadParams: CreateRPCReadParams(repo),
|
||||||
LeftCommitID: info.Left,
|
LeftCommitID: info.Left,
|
||||||
RightCommitID: info.Right,
|
RightCommitID: info.Right,
|
||||||
}, w)
|
}, w)
|
||||||
|
@ -65,7 +65,7 @@ func (c *Controller) GetCommitDivergences(ctx context.Context, session *auth.Ses
|
|||||||
|
|
||||||
// map to rpc params
|
// map to rpc params
|
||||||
options := &gitrpc.GetCommitDivergencesParams{
|
options := &gitrpc.GetCommitDivergencesParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: CreateRPCReadParams(repo),
|
||||||
MaxCount: in.MaxCount,
|
MaxCount: in.MaxCount,
|
||||||
Requests: make([]gitrpc.CommitDivergenceRequest, len(in.Requests)),
|
Requests: make([]gitrpc.CommitDivergenceRequest, len(in.Requests)),
|
||||||
}
|
}
|
||||||
|
@ -122,8 +122,11 @@ func (c *Controller) GetContent(ctx context.Context, session *auth.Session, repo
|
|||||||
gitRef = repo.DefaultBranch
|
gitRef = repo.DefaultBranch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create read params once
|
||||||
|
readParams := CreateRPCReadParams(repo)
|
||||||
|
|
||||||
treeNodeOutput, err := c.gitRPCClient.GetTreeNode(ctx, &gitrpc.GetTreeNodeParams{
|
treeNodeOutput, err := c.gitRPCClient.GetTreeNode(ctx, &gitrpc.GetTreeNodeParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: readParams,
|
||||||
GitREF: gitRef,
|
GitREF: gitRef,
|
||||||
Path: repoPath,
|
Path: repoPath,
|
||||||
IncludeLatestCommit: includeLatestCommit,
|
IncludeLatestCommit: includeLatestCommit,
|
||||||
@ -141,13 +144,13 @@ func (c *Controller) GetContent(ctx context.Context, session *auth.Session, repo
|
|||||||
switch info.Type {
|
switch info.Type {
|
||||||
case ContentTypeDir:
|
case ContentTypeDir:
|
||||||
// for getContent we don't want any recursiveness for dir content.
|
// for getContent we don't want any recursiveness for dir content.
|
||||||
content, err = c.getDirContent(ctx, repo.GitUID, gitRef, repoPath, includeLatestCommit, false)
|
content, err = c.getDirContent(ctx, readParams, gitRef, repoPath, includeLatestCommit, false)
|
||||||
case ContentTypeFile:
|
case ContentTypeFile:
|
||||||
content, err = c.getFileContent(ctx, repo.GitUID, info.SHA)
|
content, err = c.getFileContent(ctx, readParams, info.SHA)
|
||||||
case ContentTypeSymlink:
|
case ContentTypeSymlink:
|
||||||
content, err = c.getSymlinkContent(ctx, repo.GitUID, info.SHA)
|
content, err = c.getSymlinkContent(ctx, readParams, info.SHA)
|
||||||
case ContentTypeSubmodule:
|
case ContentTypeSubmodule:
|
||||||
content, err = c.getSubmoduleContent(ctx, repo.GitUID, gitRef, repoPath, info.SHA)
|
content, err = c.getSubmoduleContent(ctx, readParams, gitRef, repoPath, info.SHA)
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("unknown tree node type '%s'", treeNodeOutput.Node.Type)
|
err = fmt.Errorf("unknown tree node type '%s'", treeNodeOutput.Node.Type)
|
||||||
}
|
}
|
||||||
@ -162,10 +165,10 @@ func (c *Controller) GetContent(ctx context.Context, session *auth.Session, repo
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) getSubmoduleContent(ctx context.Context, gitRepoUID string, gitRef string,
|
func (c *Controller) getSubmoduleContent(ctx context.Context, readParams gitrpc.ReadParams, gitRef string,
|
||||||
repoPath string, commitSHA string) (*SubmoduleContent, error) {
|
repoPath string, commitSHA string) (*SubmoduleContent, error) {
|
||||||
output, err := c.gitRPCClient.GetSubmodule(ctx, &gitrpc.GetSubmoduleParams{
|
output, err := c.gitRPCClient.GetSubmodule(ctx, &gitrpc.GetSubmoduleParams{
|
||||||
RepoUID: gitRepoUID,
|
ReadParams: readParams,
|
||||||
GitREF: gitRef,
|
GitREF: gitRef,
|
||||||
Path: repoPath,
|
Path: repoPath,
|
||||||
})
|
})
|
||||||
@ -181,9 +184,10 @@ func (c *Controller) getSubmoduleContent(ctx context.Context, gitRepoUID string,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) getFileContent(ctx context.Context, gitRepoUID string, blobSHA string) (*FileContent, error) {
|
func (c *Controller) getFileContent(ctx context.Context, readParams gitrpc.ReadParams,
|
||||||
|
blobSHA string) (*FileContent, error) {
|
||||||
output, err := c.gitRPCClient.GetBlob(ctx, &gitrpc.GetBlobParams{
|
output, err := c.gitRPCClient.GetBlob(ctx, &gitrpc.GetBlobParams{
|
||||||
RepoUID: gitRepoUID,
|
ReadParams: readParams,
|
||||||
SHA: blobSHA,
|
SHA: blobSHA,
|
||||||
SizeLimit: maxGetContentFileSize,
|
SizeLimit: maxGetContentFileSize,
|
||||||
})
|
})
|
||||||
@ -200,10 +204,10 @@ func (c *Controller) getFileContent(ctx context.Context, gitRepoUID string, blob
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) getSymlinkContent(ctx context.Context, gitRepoUID string,
|
func (c *Controller) getSymlinkContent(ctx context.Context, readParams gitrpc.ReadParams,
|
||||||
blobSHA string) (*SymlinkContent, error) {
|
blobSHA string) (*SymlinkContent, error) {
|
||||||
output, err := c.gitRPCClient.GetBlob(ctx, &gitrpc.GetBlobParams{
|
output, err := c.gitRPCClient.GetBlob(ctx, &gitrpc.GetBlobParams{
|
||||||
RepoUID: gitRepoUID,
|
ReadParams: readParams,
|
||||||
SHA: blobSHA,
|
SHA: blobSHA,
|
||||||
SizeLimit: maxGetContentFileSize,
|
SizeLimit: maxGetContentFileSize,
|
||||||
})
|
})
|
||||||
@ -219,10 +223,10 @@ func (c *Controller) getSymlinkContent(ctx context.Context, gitRepoUID string,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) getDirContent(ctx context.Context, gitRepoUID string, gitRef string,
|
func (c *Controller) getDirContent(ctx context.Context, readParams gitrpc.ReadParams, gitRef string,
|
||||||
repoPath string, includeLatestCommit bool, recursive bool) (*DirContent, error) {
|
repoPath string, includeLatestCommit bool, recursive bool) (*DirContent, error) {
|
||||||
output, err := c.gitRPCClient.ListTreeNodes(ctx, &gitrpc.ListTreeNodeParams{
|
output, err := c.gitRPCClient.ListTreeNodes(ctx, &gitrpc.ListTreeNodeParams{
|
||||||
RepoUID: gitRepoUID,
|
ReadParams: readParams,
|
||||||
GitREF: gitRef,
|
GitREF: gitRef,
|
||||||
Path: repoPath,
|
Path: repoPath,
|
||||||
IncludeLatestCommit: includeLatestCommit,
|
IncludeLatestCommit: includeLatestCommit,
|
||||||
|
@ -36,7 +36,7 @@ func (c *Controller) ListBranches(ctx context.Context, session *auth.Session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rpcOut, err := c.gitRPCClient.ListBranches(ctx, &gitrpc.ListBranchesParams{
|
rpcOut, err := c.gitRPCClient.ListBranches(ctx, &gitrpc.ListBranchesParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: CreateRPCReadParams(repo),
|
||||||
IncludeCommit: includeCommit,
|
IncludeCommit: includeCommit,
|
||||||
Query: filter.Query,
|
Query: filter.Query,
|
||||||
Sort: mapToRPCBranchSortOption(filter.Sort),
|
Sort: mapToRPCBranchSortOption(filter.Sort),
|
||||||
|
@ -40,7 +40,7 @@ func (c *Controller) ListCommitTags(ctx context.Context, session *auth.Session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rpcOut, err := c.gitRPCClient.ListCommitTags(ctx, &gitrpc.ListCommitTagsParams{
|
rpcOut, err := c.gitRPCClient.ListCommitTags(ctx, &gitrpc.ListCommitTagsParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: CreateRPCReadParams(repo),
|
||||||
IncludeCommit: includeCommit,
|
IncludeCommit: includeCommit,
|
||||||
Query: filter.Query,
|
Query: filter.Query,
|
||||||
Sort: mapToRPCTagSortOption(filter.Sort),
|
Sort: mapToRPCTagSortOption(filter.Sort),
|
||||||
|
@ -35,7 +35,7 @@ func (c *Controller) ListCommits(ctx context.Context, session *auth.Session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rpcOut, err := c.gitRPCClient.ListCommits(ctx, &gitrpc.ListCommitsParams{
|
rpcOut, err := c.gitRPCClient.ListCommits(ctx, &gitrpc.ListCommitsParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: CreateRPCReadParams(repo),
|
||||||
GitREF: gitRef,
|
GitREF: gitRef,
|
||||||
After: filter.After,
|
After: filter.After,
|
||||||
Page: int32(filter.Page),
|
Page: int32(filter.Page),
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/harness/gitness/gitrpc"
|
"github.com/harness/gitness/gitrpc"
|
||||||
apiauth "github.com/harness/gitness/internal/api/auth"
|
apiauth "github.com/harness/gitness/internal/api/auth"
|
||||||
|
repoctrl "github.com/harness/gitness/internal/api/controller/repo"
|
||||||
"github.com/harness/gitness/internal/api/request"
|
"github.com/harness/gitness/internal/api/request"
|
||||||
"github.com/harness/gitness/internal/api/usererror"
|
"github.com/harness/gitness/internal/api/usererror"
|
||||||
"github.com/harness/gitness/internal/auth/authz"
|
"github.com/harness/gitness/internal/auth/authz"
|
||||||
@ -74,7 +75,7 @@ func GetInfoRefs(client gitrpc.Interface, repoStore store.RepoStore, authorizer
|
|||||||
w.Header().Set("Content-Type", fmt.Sprintf("application/x-git-%s-advertisement", service))
|
w.Header().Set("Content-Type", fmt.Sprintf("application/x-git-%s-advertisement", service))
|
||||||
|
|
||||||
if err = client.GetInfoRefs(ctx, w, &gitrpc.InfoRefsParams{
|
if err = client.GetInfoRefs(ctx, w, &gitrpc.InfoRefsParams{
|
||||||
RepoUID: repo.GitUID,
|
ReadParams: repoctrl.CreateRPCReadParams(repo),
|
||||||
Service: service,
|
Service: service,
|
||||||
Options: nil,
|
Options: nil,
|
||||||
GitProtocol: r.Header.Get("Git-Protocol"),
|
GitProtocol: r.Header.Get("Git-Protocol"),
|
||||||
@ -91,7 +92,8 @@ func GetUploadPack(client gitrpc.Interface, repoStore store.RepoStore, authorize
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
const service = "upload-pack"
|
const service = "upload-pack"
|
||||||
|
|
||||||
if err := serviceRPC(w, r, client, repoStore, authorizer, service, enum.PermissionRepoView, true); err != nil {
|
if err := serviceRPC(w, r, client, repoStore, authorizer, service, false,
|
||||||
|
enum.PermissionRepoView, true); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -101,7 +103,8 @@ func GetUploadPack(client gitrpc.Interface, repoStore store.RepoStore, authorize
|
|||||||
func PostReceivePack(client gitrpc.Interface, repoStore store.RepoStore, authorizer authz.Authorizer) http.HandlerFunc {
|
func PostReceivePack(client gitrpc.Interface, repoStore store.RepoStore, authorizer authz.Authorizer) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
const service = "receive-pack"
|
const service = "receive-pack"
|
||||||
if err := serviceRPC(w, r, client, repoStore, authorizer, service, enum.PermissionRepoEdit, false); err != nil {
|
if err := serviceRPC(w, r, client, repoStore, authorizer, service, true,
|
||||||
|
enum.PermissionRepoEdit, false); err != nil {
|
||||||
var authError *GitAuthError
|
var authError *GitAuthError
|
||||||
if errors.As(err, &authError) {
|
if errors.As(err, &authError) {
|
||||||
basicAuth(w, authError.AccountID)
|
basicAuth(w, authError.AccountID)
|
||||||
@ -120,6 +123,7 @@ func serviceRPC(
|
|||||||
repoStore store.RepoStore,
|
repoStore store.RepoStore,
|
||||||
authorizer authz.Authorizer,
|
authorizer authz.Authorizer,
|
||||||
service string,
|
service string,
|
||||||
|
isWriteOperation bool,
|
||||||
permission enum.Permission,
|
permission enum.Permission,
|
||||||
orPublic bool,
|
orPublic bool,
|
||||||
) error {
|
) error {
|
||||||
@ -168,15 +172,21 @@ func serviceRPC(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
params := &gitrpc.ServicePackParams{
|
params := &gitrpc.ServicePackParams{
|
||||||
RepoUID: repo.GitUID,
|
|
||||||
Service: service,
|
Service: service,
|
||||||
Data: reqBody,
|
Data: reqBody,
|
||||||
Options: nil,
|
Options: nil,
|
||||||
GitProtocol: r.Header.Get("Git-Protocol"),
|
GitProtocol: r.Header.Get("Git-Protocol"),
|
||||||
}
|
}
|
||||||
if session != nil {
|
|
||||||
params.PrincipalID = session.Principal.ID
|
// setup read/writeparams depending on whether it's a write operation
|
||||||
|
if isWriteOperation {
|
||||||
|
writeParams := repoctrl.CreateRPCWriteParams(session, repo)
|
||||||
|
params.WriteParams = &writeParams
|
||||||
|
} else {
|
||||||
|
readParams := repoctrl.CreateRPCReadParams(repo)
|
||||||
|
params.ReadParams = &readParams
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.ServicePack(ctx, w, params)
|
return client.ServicePack(ctx, w, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
// Copyright 2022 Harness Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by the Polyform Free Trial License
|
|
||||||
// that can be found in the LICENSE.md file for this repository.
|
|
||||||
|
|
||||||
package accesslog
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/hlog"
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A simple middleware that logs completed requests using the default hlog access handler.
|
|
||||||
*/
|
|
||||||
func HlogHandler() func(http.Handler) http.Handler {
|
|
||||||
return hlog.AccessHandler(
|
|
||||||
func(r *http.Request, status, size int, duration time.Duration) {
|
|
||||||
hlog.FromRequest(r).Info().
|
|
||||||
Int("http.status_code", status).
|
|
||||||
Int("http.response_size_bytes", size).
|
|
||||||
Dur("http.elapsed_ms", duration).
|
|
||||||
Msg("request completed.")
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
69
internal/api/middleware/logging/logging.go
Normal file
69
internal/api/middleware/logging/logging.go
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
// Copyright 2022 Harness Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by the Polyform Free Trial License
|
||||||
|
// that can be found in the LICENSE.md file for this repository.
|
||||||
|
|
||||||
|
package logging
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/gitrpc"
|
||||||
|
"github.com/harness/gitness/internal/api/request"
|
||||||
|
|
||||||
|
"github.com/rs/xid"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/rs/zerolog/hlog"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
requestIDHeader = "X-Request-Id"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HLogRequestIDHandler provides a middleware that injects request_id into the logging and execution context.
|
||||||
|
// It prefers the X-Request-Id header, if that doesn't exist it creates a new request id similar to zerolog.
|
||||||
|
func HLogRequestIDHandler() func(http.Handler) http.Handler {
|
||||||
|
return func(h http.Handler) http.Handler {
|
||||||
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
ctx := r.Context()
|
||||||
|
|
||||||
|
// read requestID from header (or create new one if none exists)
|
||||||
|
var reqID string
|
||||||
|
if reqIDs, ok := r.Header[requestIDHeader]; ok && len(reqIDs) > 0 && len(reqIDs[0]) > 0 {
|
||||||
|
reqID = reqIDs[0]
|
||||||
|
} else {
|
||||||
|
// similar to zerolog requestID generation
|
||||||
|
reqID = xid.New().String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// add requestID to context for internal usage + gitrpc client!
|
||||||
|
ctx = request.WithRequestID(ctx, reqID)
|
||||||
|
ctx = gitrpc.WithRequestID(ctx, reqID)
|
||||||
|
|
||||||
|
// update logging context with request ID
|
||||||
|
log := zerolog.Ctx(ctx)
|
||||||
|
log.UpdateContext(func(c zerolog.Context) zerolog.Context {
|
||||||
|
return c.Str("http.request_id", reqID)
|
||||||
|
})
|
||||||
|
|
||||||
|
// write request ID to response headers
|
||||||
|
w.Header().Set(requestIDHeader, reqID)
|
||||||
|
|
||||||
|
// continue serving request
|
||||||
|
h.ServeHTTP(w, r.WithContext(ctx))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// HLogAccessLogHandler provides an hlog based middleware that logs access logs.
|
||||||
|
func HLogAccessLogHandler() func(http.Handler) http.Handler {
|
||||||
|
return hlog.AccessHandler(
|
||||||
|
func(r *http.Request, status, size int, duration time.Duration) {
|
||||||
|
hlog.FromRequest(r).Info().
|
||||||
|
Int("http.status_code", status).
|
||||||
|
Int("http.response_size_bytes", size).
|
||||||
|
Dur("http.elapsed_ms", duration).
|
||||||
|
Msg("http request completed.")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
@ -22,6 +22,7 @@ const (
|
|||||||
userKey
|
userKey
|
||||||
spaceKey
|
spaceKey
|
||||||
repoKey
|
repoKey
|
||||||
|
requestIDKey
|
||||||
)
|
)
|
||||||
|
|
||||||
// WithAuthSession returns a copy of parent in which the principal
|
// WithAuthSession returns a copy of parent in which the principal
|
||||||
@ -94,3 +95,17 @@ func RepoFrom(ctx context.Context) (*types.Repository, bool) {
|
|||||||
v, ok := ctx.Value(repoKey).(*types.Repository)
|
v, ok := ctx.Value(repoKey).(*types.Repository)
|
||||||
return v, ok && v != nil
|
return v, ok && v != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithRequestID returns a copy of parent in which the request id value is set.
|
||||||
|
func WithRequestID(parent context.Context, v string) context.Context {
|
||||||
|
return context.WithValue(parent, requestIDKey, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RequestIDFrom returns the value of the request ID key on the
|
||||||
|
// context - ok is true iff a non-empty value existed.
|
||||||
|
//
|
||||||
|
//nolint:revive // need to emphasize that it's the request id we are retrieving.
|
||||||
|
func RequestIDFrom(ctx context.Context) (string, bool) {
|
||||||
|
v, ok := ctx.Value(requestIDKey).(string)
|
||||||
|
return v, ok && v != ""
|
||||||
|
}
|
||||||
|
@ -27,7 +27,7 @@ func NewUnsafeAuthorizer() *UnsafeAuthorizer {
|
|||||||
|
|
||||||
func (a *UnsafeAuthorizer) Check(ctx context.Context, session *auth.Session,
|
func (a *UnsafeAuthorizer) Check(ctx context.Context, session *auth.Session,
|
||||||
scope *types.Scope, resource *types.Resource, permission enum.Permission) (bool, error) {
|
scope *types.Scope, resource *types.Resource, permission enum.Permission) (bool, error) {
|
||||||
log.Info().Msgf(
|
log.Ctx(ctx).Info().Msgf(
|
||||||
"[Authz] %s with id '%d' requests %s for %s '%s' in scope %#v with metadata %#v",
|
"[Authz] %s with id '%d' requests %s for %s '%s' in scope %#v with metadata %#v",
|
||||||
session.Principal.Type,
|
session.Principal.Type,
|
||||||
session.Principal.ID,
|
session.Principal.ID,
|
||||||
|
@ -23,9 +23,9 @@ import (
|
|||||||
"github.com/harness/gitness/internal/api/handler/system"
|
"github.com/harness/gitness/internal/api/handler/system"
|
||||||
handleruser "github.com/harness/gitness/internal/api/handler/user"
|
handleruser "github.com/harness/gitness/internal/api/handler/user"
|
||||||
handlerwebhook "github.com/harness/gitness/internal/api/handler/webhook"
|
handlerwebhook "github.com/harness/gitness/internal/api/handler/webhook"
|
||||||
"github.com/harness/gitness/internal/api/middleware/accesslog"
|
|
||||||
middlewareauthn "github.com/harness/gitness/internal/api/middleware/authn"
|
middlewareauthn "github.com/harness/gitness/internal/api/middleware/authn"
|
||||||
"github.com/harness/gitness/internal/api/middleware/encode"
|
"github.com/harness/gitness/internal/api/middleware/encode"
|
||||||
|
"github.com/harness/gitness/internal/api/middleware/logging"
|
||||||
"github.com/harness/gitness/internal/api/middleware/principal"
|
"github.com/harness/gitness/internal/api/middleware/principal"
|
||||||
"github.com/harness/gitness/internal/api/request"
|
"github.com/harness/gitness/internal/api/request"
|
||||||
"github.com/harness/gitness/internal/auth/authn"
|
"github.com/harness/gitness/internal/auth/authn"
|
||||||
@ -68,8 +68,8 @@ func NewAPIHandler(
|
|||||||
// configure logging middleware.
|
// configure logging middleware.
|
||||||
r.Use(hlog.URLHandler("http.url"))
|
r.Use(hlog.URLHandler("http.url"))
|
||||||
r.Use(hlog.MethodHandler("http.method"))
|
r.Use(hlog.MethodHandler("http.method"))
|
||||||
r.Use(hlog.RequestIDHandler("http.request", config.Server.HTTP.RequestIDResponseHeader))
|
r.Use(logging.HLogRequestIDHandler())
|
||||||
r.Use(accesslog.HlogHandler())
|
r.Use(logging.HLogAccessLogHandler())
|
||||||
|
|
||||||
// configure cors middleware
|
// configure cors middleware
|
||||||
r.Use(corsHandler(config))
|
r.Use(corsHandler(config))
|
||||||
|
@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/harness/gitness/gitrpc"
|
"github.com/harness/gitness/gitrpc"
|
||||||
handlerrepo "github.com/harness/gitness/internal/api/handler/repo"
|
handlerrepo "github.com/harness/gitness/internal/api/handler/repo"
|
||||||
"github.com/harness/gitness/internal/api/middleware/accesslog"
|
|
||||||
middlewareauthn "github.com/harness/gitness/internal/api/middleware/authn"
|
middlewareauthn "github.com/harness/gitness/internal/api/middleware/authn"
|
||||||
"github.com/harness/gitness/internal/api/middleware/encode"
|
"github.com/harness/gitness/internal/api/middleware/encode"
|
||||||
|
"github.com/harness/gitness/internal/api/middleware/logging"
|
||||||
"github.com/harness/gitness/internal/api/request"
|
"github.com/harness/gitness/internal/api/request"
|
||||||
"github.com/harness/gitness/internal/auth/authn"
|
"github.com/harness/gitness/internal/auth/authn"
|
||||||
"github.com/harness/gitness/internal/auth/authz"
|
"github.com/harness/gitness/internal/auth/authz"
|
||||||
@ -47,8 +47,8 @@ func NewGitHandler(
|
|||||||
// configure logging middleware.
|
// configure logging middleware.
|
||||||
r.Use(hlog.URLHandler("http.url"))
|
r.Use(hlog.URLHandler("http.url"))
|
||||||
r.Use(hlog.MethodHandler("http.method"))
|
r.Use(hlog.MethodHandler("http.method"))
|
||||||
r.Use(hlog.RequestIDHandler("http.request", config.Server.HTTP.RequestIDResponseHeader))
|
r.Use(logging.HLogRequestIDHandler())
|
||||||
r.Use(accesslog.HlogHandler())
|
r.Use(logging.HLogAccessLogHandler())
|
||||||
|
|
||||||
r.Route(fmt.Sprintf("/{%s}", request.PathParamRepoRef), func(r chi.Router) {
|
r.Route(fmt.Sprintf("/{%s}", request.PathParamRepoRef), func(r chi.Router) {
|
||||||
r.Use(middlewareauthn.Attempt(authenticator))
|
r.Use(middlewareauthn.Attempt(authenticator))
|
||||||
|
@ -14,8 +14,6 @@ import (
|
|||||||
"github.com/harness/gitness/types/enum"
|
"github.com/harness/gitness/types/enum"
|
||||||
)
|
)
|
||||||
|
|
||||||
const NilSHA = "0000000000000000000000000000000000000000"
|
|
||||||
|
|
||||||
// BranchBody describes the body of Branch related webhook triggers.
|
// BranchBody describes the body of Branch related webhook triggers.
|
||||||
// TODO: move in separate package for small import?
|
// TODO: move in separate package for small import?
|
||||||
type BranchBody struct {
|
type BranchBody struct {
|
||||||
@ -40,7 +38,7 @@ func getEventHandlerForBranchCreated(server *Server,
|
|||||||
GitURL: "", // TODO: GitURL has to be generated
|
GitURL: "", // TODO: GitURL has to be generated
|
||||||
},
|
},
|
||||||
Ref: event.Payload.FullRef,
|
Ref: event.Payload.FullRef,
|
||||||
Before: NilSHA,
|
Before: types.NilSHA,
|
||||||
After: event.Payload.SHA,
|
After: event.Payload.SHA,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -84,7 +82,7 @@ func getEventHandlerForBranchDeleted(server *Server,
|
|||||||
},
|
},
|
||||||
Ref: event.Payload.FullRef,
|
Ref: event.Payload.FullRef,
|
||||||
Before: event.Payload.SHA,
|
Before: event.Payload.SHA,
|
||||||
After: NilSHA,
|
After: types.NilSHA,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,8 @@ type Config struct {
|
|||||||
Git struct {
|
Git struct {
|
||||||
BaseURL string `envconfig:"GITNESS_GIT_BASE_URL" default:"http://localhost:3000"` // clone url
|
BaseURL string `envconfig:"GITNESS_GIT_BASE_URL" default:"http://localhost:3000"` // clone url
|
||||||
Root string `envconfig:"GITNESS_GIT_ROOT"`
|
Root string `envconfig:"GITNESS_GIT_ROOT"`
|
||||||
ReposTempPath string `envconfig:"GITNESS_GIT_REPOS_TEMP_PATH"` // temp path where all repos will be cloned
|
TmpDir string `envconfig:"GITNESS_GIT_TMP_DIR"` // directory for temporary data (repo clone)
|
||||||
|
ServerHookPath string `envconfig:"GITNESS_GIT_SERVER_HOOK_PATH"` // path to binary used as git server hook
|
||||||
DefaultBranch string `envconfig:"GITNESS_GIT_DEFAULTBRANCH" default:"main"`
|
DefaultBranch string `envconfig:"GITNESS_GIT_DEFAULTBRANCH" default:"main"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +32,6 @@ type Config struct {
|
|||||||
Bind string `envconfig:"GITNESS_HTTP_BIND" default:":3000"`
|
Bind string `envconfig:"GITNESS_HTTP_BIND" default:":3000"`
|
||||||
Proto string `envconfig:"GITNESS_HTTP_PROTO"`
|
Proto string `envconfig:"GITNESS_HTTP_PROTO"`
|
||||||
Host string `envconfig:"GITNESS_HTTP_HOST"`
|
Host string `envconfig:"GITNESS_HTTP_HOST"`
|
||||||
RequestIDResponseHeader string `envconfig:"GITNESS_HTTP_REQUEST_ID_RESPONSE_HEADER" default:"request-id"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GRPC defines the grpc configuration parameters
|
// GRPC defines the grpc configuration parameters
|
||||||
|
@ -6,6 +6,8 @@ package types
|
|||||||
|
|
||||||
import "github.com/harness/gitness/types/enum"
|
import "github.com/harness/gitness/types/enum"
|
||||||
|
|
||||||
|
const NilSHA = "0000000000000000000000000000000000000000"
|
||||||
|
|
||||||
// CommitFilter stores commit query parameters.
|
// CommitFilter stores commit query parameters.
|
||||||
type CommitFilter struct {
|
type CommitFilter struct {
|
||||||
After string `json:"after"`
|
After string `json:"after"`
|
||||||
|
Loading…
Reference in New Issue
Block a user