//
// Copyright 2023 The Project Oak Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package oak.example.encrypted;

import "proto/session/service_streaming.proto";

option java_multiple_files = true;
option java_package = "com.google.oak.example.encrypted";

// Secure service offers the ability to establish either an encrypted or an
// unencrypted connection.
service SecureService {
  // EncryptedConnect wraps the `Connect` method in an encrypted connection
  // between a client and a server.
  rpc EncryptedConnect(stream oak.session.v1.RequestWrapper)
      returns (stream oak.session.v1.ResponseWrapper) {}

  // Connects a client to a server for bidirectional streaming between them.
  rpc Connect(stream Request) returns (stream Response);
}

// Example service that echos messages that it receives without encryption.
service UnencryptedService {
  // Connect connects a client to a server. The client and server can then
  // stream messages to each other.
  rpc Connect(stream Request) returns (stream Response);
}

message Request {
  bytes data = 1;
}

message Response {
  bytes data = 1;
}
