Skip to content

Commit

Permalink
Merge branch '496-modify-public-huntgroupscript-public-apis' into 'ma…
Browse files Browse the repository at this point in the history
…ster'

Resolve "Modify HuntGroupScript Public APIs"

Closes #496

See merge request tcnpublic/api!519
  • Loading branch information
Florin Stan committed Apr 23, 2024
2 parents 38d11b9 + f1e1aeb commit ca81b17
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 9 deletions.
58 changes: 53 additions & 5 deletions api/v1alpha1/org/huntgroup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,46 @@ message UpdateAgentTriggersRequest {
// UpdateAgentTriggersResponse is the response message for the UpdateAgentTriggers RPC method.
message UpdateAgentTriggersResponse {}

// The request message for ListHuntGroupScript
message ListHuntGroupScriptsRequest {}

// The response message for ListHuntGroupScript
message ListHuntGroupScriptsResponse {
// The scripts belonging to an org
repeated api.commons.org.HuntGroupScript scripts = 1;
}

// The request message for GetHuntGroupScript
message GetHuntGroupScriptRequest {
// The hunt group sid of where the script belongs
int64 hunt_group_sid = 1;
int64 hunt_group_sid = 1 [deprecated = true];
// The sid of the script
int64 script_sid = 2;
}

// The response message for GetHuntGroupScript
message GetHuntGroupScriptResponse {
// HuntGroupScriptDetails represents the details of a hunt group script.
message HuntGroupScriptDetails {
// The hunt group script
api.commons.org.HuntGroupScript script = 1;
// The hunt groups that have been assigned this script
repeated int64 hunt_group_sids = 2;
// The outbound broadcast templates that have been assigned this script
repeated int64 outbound_broadcast_template_sids = 3;
// The inbound broadcast templates that have been assigned this script
repeated int64 inbound_broadcast_template_sids = 4;
}
// The script for the given hunt group
api.commons.org.HuntGroupScript hunt_group_script = 1;
api.commons.org.HuntGroupScript hunt_group_script = 1 [deprecated = true];
// The details of the hunt group script
HuntGroupScriptDetails script_details = 2;
}

// The request message for CreateHuntGroupScript
message CreateHuntGroupScriptRequest {
// The hunt group sid of where the script belongs
int64 hunt_group_sid = 1;
int64 hunt_group_sid = 1 [deprecated = true];
// The script to be created
api.commons.org.HuntGroupScript hunt_group_script = 2;
}
Expand All @@ -498,9 +522,11 @@ message CreateHuntGroupScriptResponse {}
// The request message for UpdateHuntGroupScript
message UpdateHuntGroupScriptRequest {
// The hunt group sid of where the script belongs
int64 hunt_group_sid = 1;
int64 hunt_group_sid = 1 [deprecated = true];
// The script to be created
api.commons.org.HuntGroupScript hunt_group_script = 2;
// The sid of the script to be updated
int64 script_sid = 3;
}

// The response message for UpdateHuntGroupScript
Expand All @@ -509,10 +535,32 @@ message UpdateHuntGroupScriptResponse {}
// The request message for DeleteHuntGroupScript
message DeleteHuntGroupScriptRequest {
// The hunt group sid of where the script belongs
int64 hunt_group_sid = 1;
int64 hunt_group_sid = 1 [deprecated = true];
// The sid of the hunt group script to be deleted
int64 script_sid = 2;
}

// The response message for DeleteHuntGroupScript
message DeleteHuntGroupScriptResponse {}

// The request message for AssignScriptToHuntGroups
message AssignScriptToHuntGroupsRequest {
// The script to be assigned
int64 script_sid = 1;
// The target hunt groups to assign the specified script
repeated int64 hunt_group_sids = 2;
}

// The response message for AssignScriptToHuntGroups
message AssignScriptToHuntGroupsResponse {}

// The request message for UnassignScriptFromHuntGroups
message UnassignScriptFromHuntGroupsRequest {
// The script to be unassigned
int64 script_sid = 1;
// The target hunt groups to unassign the specified script
repeated int64 hunt_group_sids = 2;
}

// The response message for UnassignScriptFromHuntGroups
message UnassignScriptFromHuntGroupsResponse {}
47 changes: 43 additions & 4 deletions api/v1alpha1/org/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,20 @@ service Org {

// Hunt Group Scripts

// GetHuntGroupScript gets the hunt group script for a given hunt group
// ListHuntGroupScripts lists all hunt group scripts for the current organization.
rpc ListHuntGroupScripts(ListHuntGroupScriptsRequest) returns (ListHuntGroupScriptsResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/listhuntgroupscript";
option (google.api.http).body = "*";
option (annotations.authz) = {
sets: [
{
permissions: [PERMISSION_HUNTGROUP_VIEW],
}
];
};
}

// GetHuntGroupScript gets the specified script from the given script sid
rpc GetHuntGroupScript(GetHuntGroupScriptRequest) returns (GetHuntGroupScriptResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/gethuntgroupscript";
option (google.api.http).body = "*";
Expand All @@ -2099,7 +2112,7 @@ service Org {
};
}

// CreateHuntGroupScript adds a hunt group script within the given hunt group
// CreateHuntGroupScript adds a creates a new hunt group script
rpc CreateHuntGroupScript(CreateHuntGroupScriptRequest) returns (CreateHuntGroupScriptResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/createhuntgroupscript";
option (google.api.http).body = "*";
Expand All @@ -2112,7 +2125,7 @@ service Org {
};
}

// UpdateHuntGroupScript updates a hunt group script within the given hunt group
// UpdateHuntGroupScript updates a script specified by the given script sid
rpc UpdateHuntGroupScript(UpdateHuntGroupScriptRequest) returns (UpdateHuntGroupScriptResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/updatehuntgroupscript";
option (google.api.http).body = "*";
Expand All @@ -2125,7 +2138,7 @@ service Org {
};
}

// DeleteHuntGroupScript removes a hunt group script within the given hunt group
// DeleteHuntGroupScript deletes a hunt group script
rpc DeleteHuntGroupScript(DeleteHuntGroupScriptRequest) returns (DeleteHuntGroupScriptResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/deletehuntgroupscript";
option (google.api.http).body = "*";
Expand All @@ -2138,6 +2151,32 @@ service Org {
};
}

// AssignScriptToHuntGroups assigns a script to the specified hunt groups
rpc AssignScriptToHuntGroups(AssignScriptToHuntGroupsRequest) returns (AssignScriptToHuntGroupsResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/assignscripttohuntgroups";
option (google.api.http).body = "*";
option (annotations.authz) = {
sets: [
{
permissions: [PERMISSION_HUNTGROUP_EDIT]
}
];
};
}

// UnassignScriptFromHuntGroups unassigns a script from the specified hunt groups
rpc UnassignScriptFromHuntGroups(UnassignScriptFromHuntGroupsRequest) returns (UnassignScriptFromHuntGroupsResponse) {
option (google.api.http).post = "/api/v1alpha1/org/huntgroup/unassignscriptfromhuntgroups";
option (google.api.http).body = "*";
option (annotations.authz) = {
sets: [
{
permissions: [PERMISSION_HUNTGROUP_EDIT]
}
];
};
}

// TRUSTS

// CreateTrust creates a new trust.
Expand Down

0 comments on commit ca81b17

Please sign in to comment.