Skip to content

Commit

Permalink
Certain modifications
Browse files Browse the repository at this point in the history
1. Move the keyManagement API to its own folder
2. Refactor the TcManagedParameters (and Srs3ManagedParameters) class to propagate the instance name down to the keyManagement service
  • Loading branch information
swarup-n committed Nov 24, 2024
1 parent c1840ee commit d6c1559
Show file tree
Hide file tree
Showing 39 changed files with 383 additions and 226 deletions.
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>distribution</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cascading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>cascading</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/ccsds-frames/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>ccsds-frames</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp-udp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>cfdp-udp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>cfdp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>perftest1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>perftest2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<groupId>org.yamcs.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>pus</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>replication1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>replication2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>replication3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>simulation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>snippets</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>templates</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion packet-viewer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>packet-viewer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>

<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion simulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>simulator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>yamcs-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,6 @@ service InstancesApi {
post: "/api/instances/{instance}:restart"
};
}

// Update any type of key of the instance
rpc UpdateKey(UpdateKeyRequest) returns (UpdateKeyResponse) {
option (yamcs.api.route) = {
post: "/api/instances/{instance}:updateKey"
};
}

// Get the key of a family of the instance
rpc GetActiveKey(ActiveKeyRequest) returns (ActiveKeyResponse) {
option (yamcs.api.route) = {
get: "/api/instances/activeKey/{instance}"
};
}
}

message ListInstancesRequest {
Expand Down Expand Up @@ -182,38 +168,3 @@ message RestartInstanceRequest {
// Yamcs instance name.
optional string instance = 1;
}

message UpdateKeyRequest{
// Yamcs instance name.
optional string instance = 1;

// Type of the key
required string keyFamily = 2;

// Key ID to be updated to
required string keyId = 3;
}

message UpdateKeyResponse {
optional string keyId = 1;
}

message ActiveKeyRequest {
// Yamcs instance name.
optional string instance = 1;

// Type of the key
optional string family = 2;
}

message ActiveKeyResponse {
// Yamcs instance name.
optional string instance = 1;

// KeyID
optional string keyId = 2;

// Type of the key
optional string family = 3;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
syntax="proto2";

package yamcs.protobuf.instances;

option java_package = "org.yamcs.protobuf";
option java_outer_classname = "KeyManagmentServiceProto";
option java_multiple_files = true;

import "google/protobuf/empty.proto";

import "yamcs/api/annotations.proto";

service KeyManagmentApi {

// Update any type of key of the instance
rpc UpdateKey(UpdateKeyRequest) returns (UpdateKeyResponse) {
option (yamcs.api.route) = {
post: "/api/instances/{instance}:updateKey"
};
}

// Get the key of a family of the instance
rpc GetActiveKey(ActiveKeyRequest) returns (ActiveKeyResponse) {
option (yamcs.api.route) = {
get: "/api/instances/activeKey/{instance}"
};
}
}

message UpdateKeyRequest{
// Yamcs instance name.
optional string instance = 1;

// Type of the key
required string keyFamily = 2;

// Key ID to be updated to
required string keyId = 3;
}

message UpdateKeyResponse {
optional string keyId = 1;

// Type of the key
optional string keyFamily = 2;

// Error message
optional string error = 3;
}

message ActiveKeyRequest {
// Yamcs instance name.
optional string instance = 1;

// Type of the key
optional string family = 2;
}

message ActiveKeyResponse {
// Yamcs instance name.
optional string instance = 1;

// KeyID
optional string keyId = 2;

// Type of the key
optional string family = 3;

}
2 changes: 1 addition & 1 deletion yamcs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>yamcs-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.0-keym3</version>
<version>5.10.8-Pixxel-5.7.0-keySwarup4</version>
</parent>

<artifactId>yamcs-core</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions yamcs-core/src/main/java/org/yamcs/http/HttpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.yamcs.http.api.IamApi;
import org.yamcs.http.api.IndexesApi;
import org.yamcs.http.api.InstancesApi;
import org.yamcs.http.api.KeyManagementApi;
import org.yamcs.http.api.LinksApi;
import org.yamcs.http.api.MdbApi;
import org.yamcs.http.api.MdbOverrideApi;
Expand Down Expand Up @@ -290,6 +291,7 @@ public void init(String yamcsInstance, String serviceName, YConfiguration config
addApi(new IamApi(auditLog, tokenStore));
addApi(new IndexesApi());
addApi(new InstancesApi());
addApi(new KeyManagementApi());
addApi(new LinksApi(auditLog));
addApi(new MdbApi());
addApi(new MdbOverrideApi());
Expand Down
Loading

0 comments on commit d6c1559

Please sign in to comment.