• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14syntax = "proto2";
15
16package mobstore.proto;
17
18option java_package = "com.google.mobiledatadownload";
19option java_outer_classname = "TransformProto";
20option objc_class_prefix = "MOB";
21
22// Description of transforms that are to be applied by MobStore to a stream.
23//
24// Following MobStore convention, they are applied in the order in which they
25// appear on write, and reverse on read. Serialization as a URI fragment
26// preserves order.
27//
28// eg "transform=compress+encrypt(aes_gcm_key=12345)"
29message Transforms {
30  repeated Transform transform = 1;
31}
32
33// Specification for an individual transform.
34message Transform {
35  oneof transform {
36    CompressTransform compress = 1;
37    EncryptTransform encrypt = 2;
38    IntegrityTransform integrity = 3;
39    ZipTransform zip = 4;
40    CustomTransform custom = 5;
41  }
42}
43
44// The compression transform. It has no parameters.
45//
46// eg "compress"
47message CompressTransform {}
48
49// The encryption transform. If no params are given, it uses the keystore
50// to manage keys. Alternatively, the key can be stored in the URI itself.
51//
52// eg "encrypt", "encrypt(aes_gcm_key=12345)"
53message EncryptTransform {
54  oneof key {
55    string aes_gcm_key_base64 = 1;
56  }
57}
58
59// The integrity transform. If the hash is included, it can be verified.
60// Otherwise, it can be retrieved after reading or writing with the
61// ComputedUri API.
62//
63// eg "integrity", "integrity(sha256=12345)"
64message IntegrityTransform {
65  oneof hash {
66    string sha256 = 1;
67  }
68}
69
70// The ZIP decompress transform. It requires a target file param.
71message ZipTransform {
72  // required
73  optional string target = 1;
74}
75
76// A custom transform. The transform with the specified name must be registered
77// with MobStore FileStorage.
78message CustomTransform {
79  // required
80  optional string name = 1;
81
82  message SubParam {
83    // required
84    optional string key = 1;
85    optional string value = 2;
86  }
87  repeated SubParam subparam = 2;
88}
89