Skip to content

Commit

Permalink
Merge pull request #57 from aalyria/A22FDDD72E60FFA059864CEEB524C75E
Browse files Browse the repository at this point in the history
* Project import generated by Copybara.

GitOrigin-RevId: d90a252876b89d8bae5d8bb12af90e42691f14f3

---------

Co-authored-by: Aalyria Technologies, Inc <[email protected]>
  • Loading branch information
dgnemo and Aalyria Technologies, Inc committed Sep 23, 2023
2 parents f9a0e37 + 02ea8d4 commit 1fdc706
Show file tree
Hide file tree
Showing 26 changed files with 1,849 additions and 575 deletions.
22 changes: 22 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ gazelle_dependencies()
#
# Downloads are not cached in version control mode.

go_repository(
name = "com_github_bufbuild_protocompile",
importpath = "github.com/bufbuild/protocompile",
sum = "h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY=",
version = "v0.6.0",
)

go_repository(
name = "com_github_urfave_cli_v2",
importpath = "github.com/urfave/cli/v2",
Expand Down Expand Up @@ -188,6 +195,13 @@ go_repository(
version = "v1.0.3",
)

go_repository(
name = "com_github_fullstorydev_grpcurl",
importpath = "github.com/fullstorydev/grpcurl",
sum = "h1:xJWosq3BQovQ4QrdPO72OrPiWuGgEsxY8ldYsJbPrqI=",
version = "v1.8.7",
)

go_repository(
name = "com_github_go_logr_logr",
importpath = "github.com/go-logr/logr",
Expand Down Expand Up @@ -223,6 +237,14 @@ go_repository(
version = "v2.15.2",
)

go_repository(
name = "com_github_jhump_protoreflect",
build_file_proto_mode = "legacy",
importpath = "github.com/jhump/protoreflect",
sum = "h1:7YppbATX94jEt9KLAc5hICx4h6Yt3SaavhQRsIUEHP0=",
version = "v1.15.2",
)

go_repository(
name = "com_github_jonboulle_clockwork",
importpath = "github.com/jonboulle/clockwork",
Expand Down
14 changes: 14 additions & 0 deletions api/common/wireless_transceiver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ message TransceiverModel {

// Supported MAC-layer parameters.
repeated WirelessMac macs = 6;

message Impairment {
// Unique identifier, within the list of impairments for this transceiver.
optional string id = 1;
// Time this impairment was added to the interface model.
optional int64 timestamp_usec = 3;
// The reason for this impairment.
optional string reason = 4;
}

// Multiple operational impairements can be recorded by different actors
// (e.g. network operators, monitoring sub-systems inside the agent).
// Spacetime will avoid the use of any transceiver that contains impairments.
repeated Impairment operational_impairments = 7;
}

// Uniquely identifies a temporospatial transceiver model.
Expand Down
4 changes: 3 additions & 1 deletion api/common/wireless_transmitter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ message TxChannels {

// Models a wireless transmitter.
message TransmitterDefinition {
reserved 1, 3 to 12, 16, 17 to max;
reserved 1, 3 to 12, 16, 18 to max;

// An optional friendly, human-readable string.
optional string name = 2;
Expand All @@ -58,6 +58,8 @@ message TransmitterDefinition {
// wireless transmission is created or modified prior to the input of
// the platform antenna that propagates the signal.
repeated TransmitSignalProcessor signal_processing_step = 15;

optional string coverage_heatmap_id = 17;
}

// Defines how a wireless signal is created, modified, or propagated.
Expand Down
4 changes: 0 additions & 4 deletions api/nbi/v1alpha/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ proto_library(
"//api/nbi/v1alpha/resources:nbi_resources_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:timestamp_proto",
"@go_googleapis//google/api:annotations_proto",
"@go_googleapis//google/type:interval_proto",
],
)
Expand All @@ -43,7 +42,6 @@ cpp_grpc_library(
deps = [
"//api/common:common_cpp_proto",
"//api/nbi/v1alpha/resources:nbi_resources_cpp_grpc",
"@com_google_googleapis//google/api:annotations_cc_proto",
"@com_google_googleapis//google/rpc:code_cc_proto",
"@com_google_googleapis//google/type:interval_cc_proto",
],
Expand All @@ -57,7 +55,6 @@ go_proto_library(
deps = [
"//api/common:common_go_proto",
"//api/nbi/v1alpha/resources:nbi_resources_go_grpc",
"@go_googleapis//google/api:annotations_go_proto",
"@go_googleapis//google/rpc:code_go_proto",
"@go_googleapis//google/type:interval_go_proto",
],
Expand All @@ -81,6 +78,5 @@ python_grpc_library(
deps = [
"//api/common:common_python_proto",
"//api/nbi/v1alpha/resources:nbi_resources_python_grpc",
"@com_google_googleapis//google/api:annotations_py_proto",
],
)
52 changes: 12 additions & 40 deletions api/nbi/v1alpha/nbi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import "api/nbi/v1alpha/resources/network_link.proto";
import "api/nbi/v1alpha/resources/scenario_settings.proto";
import "api/nbi/v1alpha/resources/service_request.proto";
import "api/nbi/v1alpha/resources/wireless_interference.proto";
import "google/api/annotations.proto";
import "google/type/interval.proto";

option java_package = "com.aalyria.spacetime.api.nbi.v1alpha";
Expand Down Expand Up @@ -123,60 +122,33 @@ message Entity {
}

service NetOps {
// Creates a Spacetime Entity using the app: 'Spacetime Netops'.
rpc CreateEntity(CreateEntityRequest) returns (Entity) {
option (google.api.http) = {
post: "/v1/entities/type/{type=*}"
body: "entity"
};
}
rpc GetEntity(GetEntityRequest) returns (Entity) {}

// Updates a Spacetime Entity using the app: 'Spacetime Netops'.
rpc UpdateEntity(UpdateEntityRequest) returns (Entity) {
option (google.api.http) = {
put: "/v1/entities/type/{type=*}/id/{id=*}"
body: "entity"
};
}
rpc CreateEntity(CreateEntityRequest) returns (Entity) {}

// Lists all specified entities of the selected type.
// TODO: implement pagination
rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) {
option (google.api.http) = {
get: "/v1/entities"
};
}
rpc UpdateEntity(UpdateEntityRequest) returns (Entity) {}

rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) {}

// Lists all specified entities of the selected type over the provided time
// interval.
// TODO: implement pagination
rpc ListEntitiesOverTime(ListEntitiesOverTimeRequest)
returns (ListEntitiesOverTimeResponse) {
option (google.api.http) = {
get: "/v1/entities/over_time"
};
}
returns (ListEntitiesOverTimeResponse) {}

// Deletes an Entity.
rpc DeleteEntity(DeleteEntityRequest) returns (DeleteEntityResponse) {
option (google.api.http) = {
delete: "/v1/entities/type/{type=*}/id/{id=*}/commit_timestamp/{commit_timestamp=*}"
};
}
rpc DeleteEntity(DeleteEntityRequest) returns (DeleteEntityResponse) {}

// Loads a scenario specified as a
// com.aalyria.resources.ScenarioSettings proto.
// Deprecated. This endpoint is in the process of being replaced by a
// more general purpose interface.
rpc LoadScenario(LoadScenarioRequest) returns (LoadScenarioResponse) {
option deprecated = true;
option (google.api.http) = {
post: "/v1/load_scenario"
body: "scenario_settings"
};
}
}

message GetEntityRequest {
optional EntityType type = 1;
optional string id = 2;
}

// The id can be omitted, in which case a unique ID will be generated
// by the backend.
message CreateEntityRequest {
Expand Down
6 changes: 5 additions & 1 deletion api/nbi/v1alpha/resources/network_link.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ enum Accessibility {

// A modeled, physical-layer wireless link budget.
message WirelessLinkBudget {
reserved 10 to 14, 16 to max;
reserved 10 to 14, 17 to max;

// The transmitter antenna's gain in the link direction, in dB.
optional double transmitter_antenna_gain_in_link_direction_db = 1;
Expand Down Expand Up @@ -138,6 +138,10 @@ message WirelessLinkBudget {

// The carrier to noise ratio.
optional double carrier_to_noise_db = 8;

// The carrier to noise-plus-interference ratio (C / (N + I)),
// in dB.
optional double carrier_to_noise_plus_interference_db = 16;

// The carrier to noise density, in dB/Hz.
optional double carrier_to_noise_density_db_per_hz = 9;
Expand Down
43 changes: 43 additions & 0 deletions auth/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2023 Aalyria Technologies, Inc., and its affiliates.
#
# 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.

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "auth",
srcs = [
"auth.go",
"doc.go",
],
importpath = "aalyria.com/spacetime/auth",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_jwt_jwt_v5//:jwt",
"@com_github_jonboulle_clockwork//:clockwork",
"@org_golang_google_grpc//credentials",
"@org_golang_x_oauth2//:oauth2",
"@org_golang_x_oauth2//jwt",
],
)

go_test(
name = "auth_test",
srcs = ["auth_test.go"],
embed = [":auth"],
tags = ["block-network"],
deps = [
"//auth/authtest",
"@com_github_jonboulle_clockwork//:clockwork",
],
)
Loading

0 comments on commit 1fdc706

Please sign in to comment.