From a205ce5f65ea43ea77d07bb5bec275fe32532583 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Fri, 13 Feb 2015 11:11:33 -0800 Subject: [PATCH] cpp updates interop proto for auth interop testing. Update the proto correspondingly. --- interop/grpc_testing/test.pb.go | 43 +++++++++++++++++++++++++++------ interop/grpc_testing/test.proto | 12 ++++++++- test/grpc_testing/test.pb.go | 43 +++++++++++++++++++++++++++------ test/grpc_testing/test.proto | 12 ++++++++- 4 files changed, 92 insertions(+), 18 deletions(-) diff --git a/interop/grpc_testing/test.pb.go b/interop/grpc_testing/test.pb.go index d81abe99..6d425344 100755 --- a/interop/grpc_testing/test.pb.go +++ b/interop/grpc_testing/test.pb.go @@ -161,8 +161,12 @@ type SimpleRequest struct { // If response_type is COMPRESSABLE, this denotes the size before compression. ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size" json:"response_size,omitempty"` // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername *bool `protobuf:"varint,4,opt,name=fill_username" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope" json:"fill_oauth_scope,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } @@ -191,14 +195,30 @@ func (m *SimpleRequest) GetPayload() *Payload { return nil } +func (m *SimpleRequest) GetFillUsername() bool { + if m != nil && m.FillUsername != nil { + return *m.FillUsername + } + return false +} + +func (m *SimpleRequest) GetFillOauthScope() bool { + if m != nil && m.FillOauthScope != nil { + return *m.FillOauthScope + } + return false +} + // Unary response, as configured by the request. type SimpleResponse struct { // Payload to increase message size. Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` // The user the request came from, for verifying authentication was // successful when the client expected it. - EffectiveGaiaUserId *int64 `protobuf:"varint,2,opt,name=effective_gaia_user_id" json:"effective_gaia_user_id,omitempty"` - XXX_unrecognized []byte `json:"-"` + Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // OAuth scope. + OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope" json:"oauth_scope,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } @@ -213,11 +233,18 @@ func (m *SimpleResponse) GetPayload() *Payload { return nil } -func (m *SimpleResponse) GetEffectiveGaiaUserId() int64 { - if m != nil && m.EffectiveGaiaUserId != nil { - return *m.EffectiveGaiaUserId +func (m *SimpleResponse) GetUsername() string { + if m != nil && m.Username != nil { + return *m.Username } - return 0 + return "" +} + +func (m *SimpleResponse) GetOauthScope() string { + if m != nil && m.OauthScope != nil { + return *m.OauthScope + } + return "" } // Client-streaming request. diff --git a/interop/grpc_testing/test.proto b/interop/grpc_testing/test.proto index 75d6e02b..b5bfe053 100644 --- a/interop/grpc_testing/test.proto +++ b/interop/grpc_testing/test.proto @@ -38,15 +38,25 @@ message SimpleRequest { // Optional input payload sent along with the request. optional Payload payload = 3; + + // Whether SimpleResponse should include username. + optional bool fill_username = 4; + + // Whether SimpleResponse should include OAuth scope. + optional bool fill_oauth_scope = 5; } // Unary response, as configured by the request. message SimpleResponse { // Payload to increase message size. optional Payload payload = 1; + // The user the request came from, for verifying authentication was // successful when the client expected it. - optional int64 effective_gaia_user_id = 2; + optional string username = 2; + + // OAuth scope. + optional string oauth_scope = 3; } // Client-streaming request. diff --git a/test/grpc_testing/test.pb.go b/test/grpc_testing/test.pb.go index d81abe99..6d425344 100755 --- a/test/grpc_testing/test.pb.go +++ b/test/grpc_testing/test.pb.go @@ -161,8 +161,12 @@ type SimpleRequest struct { // If response_type is COMPRESSABLE, this denotes the size before compression. ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size" json:"response_size,omitempty"` // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername *bool `protobuf:"varint,4,opt,name=fill_username" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope" json:"fill_oauth_scope,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } @@ -191,14 +195,30 @@ func (m *SimpleRequest) GetPayload() *Payload { return nil } +func (m *SimpleRequest) GetFillUsername() bool { + if m != nil && m.FillUsername != nil { + return *m.FillUsername + } + return false +} + +func (m *SimpleRequest) GetFillOauthScope() bool { + if m != nil && m.FillOauthScope != nil { + return *m.FillOauthScope + } + return false +} + // Unary response, as configured by the request. type SimpleResponse struct { // Payload to increase message size. Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` // The user the request came from, for verifying authentication was // successful when the client expected it. - EffectiveGaiaUserId *int64 `protobuf:"varint,2,opt,name=effective_gaia_user_id" json:"effective_gaia_user_id,omitempty"` - XXX_unrecognized []byte `json:"-"` + Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // OAuth scope. + OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope" json:"oauth_scope,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } @@ -213,11 +233,18 @@ func (m *SimpleResponse) GetPayload() *Payload { return nil } -func (m *SimpleResponse) GetEffectiveGaiaUserId() int64 { - if m != nil && m.EffectiveGaiaUserId != nil { - return *m.EffectiveGaiaUserId +func (m *SimpleResponse) GetUsername() string { + if m != nil && m.Username != nil { + return *m.Username } - return 0 + return "" +} + +func (m *SimpleResponse) GetOauthScope() string { + if m != nil && m.OauthScope != nil { + return *m.OauthScope + } + return "" } // Client-streaming request. diff --git a/test/grpc_testing/test.proto b/test/grpc_testing/test.proto index 75d6e02b..b5bfe053 100644 --- a/test/grpc_testing/test.proto +++ b/test/grpc_testing/test.proto @@ -38,15 +38,25 @@ message SimpleRequest { // Optional input payload sent along with the request. optional Payload payload = 3; + + // Whether SimpleResponse should include username. + optional bool fill_username = 4; + + // Whether SimpleResponse should include OAuth scope. + optional bool fill_oauth_scope = 5; } // Unary response, as configured by the request. message SimpleResponse { // Payload to increase message size. optional Payload payload = 1; + // The user the request came from, for verifying authentication was // successful when the client expected it. - optional int64 effective_gaia_user_id = 2; + optional string username = 2; + + // OAuth scope. + optional string oauth_scope = 3; } // Client-streaming request.