Skip to content

Commit

Permalink
feat(pool/encryption): add api messages
Browse files Browse the repository at this point in the history
Signed-off-by: Diwakar Sharma <[email protected]>
  • Loading branch information
dsharma-dc committed Feb 6, 2025
1 parent 852512a commit 278d95e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
28 changes: 28 additions & 0 deletions apis/io-engine/protobuf/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,31 @@ message MayastorBugFixes {
// Nexus rebuilds both the clusters allocated to the replica and its ancestors clusters
bool nexusRebuildReplicaAncestry = 1;
}

// Cipher to use for encryption.
enum Cipher {
AES_CBC = 0;
AES_XTS = 1;
}

// Represents an encryption key that can be used to encrypt an
// entity like pool or lvol/replica.
message EncryptionKey {
// Name of the key.
string key_name = 1;
// The AES encryption key.
bytes key = 2;
// AES Key length.
uint32 key_length = 3;
// key2 (required for AES_XTS).
optional bytes key2 = 4;
// The length of key2. Must be same as key_length.
optional uint32 key2_length = 5;
}

message EncryptionInfo {
// Cipher to be used.
Cipher cipher = 1;
// The encryption key.
EncryptionKey key = 2;
}
5 changes: 5 additions & 0 deletions apis/io-engine/protobuf/v1/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";

import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "common.proto";

package mayastor.v1;

Expand Down Expand Up @@ -48,6 +49,8 @@ message CreatePoolRequest {
optional uint32 cluster_size = 5;
// Optional pool metadata arguments.
optional PoolMetadataArgs md_args = 6;
// Encryption key for this pool.
optional EncryptionInfo enc_info = 7;
}

// Pool metadata arguments.
Expand Down Expand Up @@ -77,6 +80,8 @@ message ImportPoolRequest {
google.protobuf.StringValue uuid = 2; // optional uuid for the pool to be imported
repeated string disks = 3; // disk device paths or URIs to be claimed by the pool
PoolType pooltype = 4; // type of the pool
// Encryption key for this pool.
optional EncryptionInfo enc_info = 5;
}

// State of the storage pool (terminology comes from ZFS).
Expand Down
2 changes: 1 addition & 1 deletion apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod pb {
}

pub mod common {
pub use super::pb::ShareProtocol;
pub use super::pb::{Cipher, EncryptionInfo, EncryptionKey, ShareProtocol};
}

/// v1 version of bdev grpc API
Expand Down

0 comments on commit 278d95e

Please sign in to comment.