Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Include quest name on gRPC task #453

Merged
merged 4 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions implants/lib/c2/src/c2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ pub struct Task {
>,
#[prost(string, repeated, tag = "4")]
pub file_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "5")]
pub quest_name: ::prost::alloc::string::String,
}
/// TaskError provides information when task execution fails.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
1 change: 1 addition & 0 deletions tavern/internal/c2/api_claim_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func (srv *Server) ClaimTasks(ctx context.Context, req *c2pb.ClaimTasksRequest)
Eldritch: claimedTome.Eldritch,
Parameters: params,
FileNames: claimedFileNames,
QuestName: claimedQuest.Name,
})
}

Expand Down
1 change: 1 addition & 0 deletions tavern/internal/c2/c2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ message Task {
string eldritch = 2;
map<string, string> parameters = 3;
repeated string file_names = 4;
string quest_name = 5;
}

// TaskError provides information when task execution fails.
Expand Down
126 changes: 68 additions & 58 deletions tavern/internal/c2/c2pb/c2.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tavern/internal/c2/c2test/ent.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func ConvertTaskToC2PB(t *testing.T, ctx context.Context, task *ent.Task) *c2pb.
Eldritch,
Parameters: params,
FileNames: fileNames,
QuestName: task.
QueryQuest().
OnlyX(ctx).
Name,
}
}

Expand Down
Loading