Skip to content

Commit b6cd163

Browse files
committed
Remove GrpcService, define REST api based objects
1 parent 2e3fec2 commit b6cd163

File tree

5 files changed

+34
-38
lines changed

5 files changed

+34
-38
lines changed

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
.protoc-version
22
.idea/*
3-
build/*
3+
*.ipr
4+
*.iws
5+
.settings/*
6+
.project
47
.gradle/*
58
gradle/*
69
gradlew*
7-
*.ipr
8-
*.iws
10+
build/*
11+
app/build/*
12+
app/bin/*
13+
app/.classpath
14+
app/.project
15+
app/.settings
916

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# ess-server
2-
Encrypted Storage Service
1+
# vss-server
2+
Versioned Storage Service

build.gradle renamed to app/build.gradle

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
buildscript {
22
ext.gradleVersion = '7.5.1'
33
ext.protobufPlugInVersion = '0.8.12'
4-
ext.protobufVersion = '3.21.6'
5-
ext.grpcVersion = '1.49.1'
6-
7-
ext.junitVersion = '5.8.1'
4+
ext.protobufVersion = '3.21.7'
5+
ext.jerseyVersion = '3.1.0'
6+
ext.junitVersion = '5.9.0'
87
}
98

109
plugins {
1110
id 'java'
1211
id 'com.google.protobuf' version "${protobufPlugInVersion}"
12+
id 'war'
1313
id 'idea'
1414
}
1515

@@ -23,21 +23,12 @@ idea {
2323
}
2424
}
2525

26-
group 'org.ess'
27-
version '1.0-SNAPSHOT'
26+
group 'org.vss'
27+
version '1.0'
2828

29-
wrapper {
30-
gradleVersion = "$gradleVersion"
31-
}
3229

3330
dependencies {
34-
// grpc and protobuf
3531
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
36-
implementation "io.grpc:grpc-protobuf:$grpcVersion"
37-
implementation "io.grpc:grpc-stub:$grpcVersion"
38-
implementation "io.grpc:grpc-netty-shaded:$grpcVersion"
39-
implementation "org.apache.tomcat:annotations-api:6.0.53" //Required for Java9+
40-
4132

4233
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
4334
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"

src/main/proto/ess.proto renamed to app/src/main/proto/vss.proto

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
syntax = "proto3";
22
option java_multiple_files = true;
3-
package org.ess;
4-
5-
service EncryptedStorageService {
6-
rpc get(GetObjectRequest) returns (GetObjectResponse);
7-
rpc put(PutObjectRequest) returns (PutObjectResponse);
8-
//TODO: Add getKeysSummary (Gives version numbers for all keys in a store) and list by prefix APIs
9-
}
3+
package org.vss;
104

115
message GetObjectRequest {
126
/*
@@ -19,11 +13,7 @@ message GetObjectRequest {
1913
string key = 2;
2014
}
2115
message GetObjectResponse {
22-
bool success = 1;
2316
KeyValue value = 2;
24-
25-
// Optional, only present when success = false
26-
optional ErrorResponse errorResponse = 3;
2717
}
2818

2919
message PutObjectRequest {
@@ -55,24 +45,32 @@ message PutObjectRequest {
5545
}
5646

5747
message PutObjectResponse {
58-
bool success = 1;
59-
optional ErrorResponse errorResponse = 2;
6048
}
6149

50+
/*
51+
When HttpStatusCode is not ok(200), response `content` contains serialized ErrorResponse.
52+
*/
6253
message ErrorResponse{
6354
ErrorCode errorCode = 1;
6455
string message = 2;
6556
}
57+
/*
58+
ErrorCodes along with corresponding HttpStatusCodes used in response
59+
*/
6660
enum ErrorCode{
6761
Unknown = 0;
68-
ConflictException = 2;
69-
InvalidRequestException = 3;
70-
InternalServerException = 4;
62+
ConflictException = 409;
63+
InvalidRequestException = 400;
64+
InternalServerException = 500;
7165
}
7266

7367
message KeyValue {
7468
string key = 1;
7569

70+
/*
71+
For first write of key, version should be '0'. If write succeeds, clients must increment
72+
their corresponding key version(on device) by 1.
73+
*/
7674
int64 version = 2;
7775

7876
bytes value = 3;

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
rootProject.name = 'ess-server'
2-
1+
rootProject.name = 'vss-server'
2+
include 'app'

0 commit comments

Comments
 (0)