Skip to content

Commit

Permalink
deprecate org_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzettler committed Dec 11, 2024
1 parent 702666e commit a9b6070
Showing 1 changed file with 156 additions and 6 deletions.
162 changes: 156 additions & 6 deletions src/service/iot_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import "region.proto";
// are signed by the config service to allow the recipient to validate
// the authenticity of the data returned.
//
// - Every key called `owner`, and `delegate_keys` are solana pubkeys
// - org_v1 Every key called `owner`, `payer` and `delegate_keys` are binary
// encoded public keys, Rust encoding example here:
// https://github.com/helium/helium-crypto-rs/blob/main/src/public_key.rs#L347-L354
//
// - org_v2 Every key called `owner`, and `delegate_keys` are solana pubkeys
// https://docs.rs/solana-sdk/1.18.0/solana_sdk/pubkey/struct.Pubkey.html
//
// == DevAddrs ==
Expand All @@ -39,8 +43,23 @@ enum action_v1 {
remove = 1;
}

// Define an organisation
// Define an organization
// Deprecated: Use org_v2 instead
message org_v1 {
option deprecated = true;

uint64 oui = 1;
// Org admin key
bytes owner = 2;
// Key only used for DC payments
bytes payer = 3;
// List of keys allowed some specific actions, see services.
repeated bytes delegate_keys = 4;
// Is org locked because of no payment
bool locked = 5;
}

message org_v2 {
uint64 oui = 1;
// On chain address
bytes address = 2;
Expand Down Expand Up @@ -139,9 +158,13 @@ message route_v1 {
// Service Message Definitions
// ------------------------------------------------------------------

message org_list_req_v1 {}
message org_list_req_v1 {
option deprecated = true;
}

message org_list_res_v1 {
option deprecated = true;

repeated org_v1 orgs = 1;
// in seconds since unix epoch
uint64 timestamp = 2;
Expand All @@ -151,9 +174,104 @@ message org_list_res_v1 {
bytes signature = 4;
}

message org_get_req_v1 { uint64 oui = 1; }
message org_list_req_v2 {}

message org_list_res_v2 {
repeated org_v2 orgs = 1;
// in seconds since unix epoch
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
// Signature over the response by the config service
bytes signature = 4;
}

message org_get_req_v1 {
option deprecated = true;

uint64 oui = 1;
}

message org_get_req_v2 { uint64 oui = 1; }

message org_create_helium_req_v1 {
option deprecated = true;

enum helium_net_id {
type0_0x00003c = 0;
type3_0x60002d = 1;
type6_0xc00053 = 2;
}

bytes owner = 1;
bytes payer = 2;
// Number of device address needed
// Even number required, minimum of 8
uint64 devaddrs = 3;
// in milliseconds since unix epoch
uint64 timestamp = 4;
bytes signature = 5;
repeated bytes delegate_keys = 6;
// pubkey binary of the signing keypair
bytes signer = 7;
helium_net_id net_id = 8;
}

message org_create_roamer_req_v1 {
option deprecated = true;

bytes owner = 1;
bytes payer = 2;
uint32 net_id = 3;
// in milliseconds since unix epoch
uint64 timestamp = 4;
bytes signature = 5;
repeated bytes delegate_keys = 6;
// pubkey binary of the signing keypair
bytes signer = 7;
}

message org_update_req_v1 {
option deprecated = true;

message delegate_key_update_v1 {
option deprecated = true;

bytes delegate_key = 1;
action_v1 action = 2;
}

message devaddr_constraint_update_v1 {
option deprecated = true;

devaddr_constraint_v1 constraint = 1;
action_v1 action = 2;
}

message update_v1 {
option deprecated = true;

oneof update {
bytes owner = 1;
bytes payer = 2;
delegate_key_update_v1 delegate_key = 3;
// count of devaddrs to add, in even numbers
uint64 devaddrs = 4;
// devaddr constraints to explicitly add or remove
devaddr_constraint_update_v1 constraint = 5;
}
}

uint64 oui = 1;
repeated update_v1 updates = 2;
uint64 timestamp = 3;
bytes signer = 4;
bytes signature = 5;
}

message org_res_v1 {
option deprecated = true;

org_v1 org = 1;
uint32 net_id = 2;
repeated devaddr_constraint_v1 devaddr_constraints = 3;
Expand All @@ -165,6 +283,18 @@ message org_res_v1 {
bytes signature = 6;
}

message org_res_v2 {
org_v2 org = 1;
uint32 net_id = 2;
repeated devaddr_constraint_v1 devaddr_constraints = 3;
// in seconds since unix epoch
uint64 timestamp = 4;
// pubkey binary of the signing keypair
bytes signer = 5;
// Signature over the response by the config service
bytes signature = 6;
}

message org_disable_req_v1 {
uint64 oui = 1;
// in milliseconds since unix epoch
Expand Down Expand Up @@ -586,9 +716,29 @@ message region_params_res_v1 {

service org {
// List Org (no auth)
rpc list(org_list_req_v1) returns (org_list_res_v1);
rpc list(org_list_req_v1) returns (org_list_res_v1) {
option deprecated = true;
};
rpc list_v2(org_list_req_v2) returns (org_list_res_v2);
// Get Org (no auth)
rpc get(org_get_req_v1) returns (org_res_v1);
rpc get(org_get_req_v1) returns (org_res_v1) {
option deprecated = true;
};
rpc get_v2(org_get_req_v2) returns (org_res_v2);
// Create Org on Helium Network (auth admin only)
rpc create_helium(org_create_helium_req_v1) returns (org_res_v1) {
option deprecated = true;
};
// Create Org on any network (auth admin only)
rpc create_roamer(org_create_roamer_req_v1) returns (org_res_v1) {
option deprecated = true;
};
// Update any Org (Helium or Roaming)
// Modify payer and add/remove delegate keys (owner/admin)
// Modify owner and add/remove devaddr constraints (auth admin only)
rpc update(org_update_req_v1) returns (org_res_v1) {
option deprecated = true;
};
// Disable an org, this sends a stream route delete update to HPR
// for all associated routes (auth admin only)
rpc disable(org_disable_req_v1) returns (org_disable_res_v1);
Expand Down

0 comments on commit a9b6070

Please sign in to comment.