Skip to content

Commit e2617c7

Browse files
author
HD Moore
committed
Return the workspace id in responses, lands rapid7#4142
2 parents 00590f9 + ddb62c8 commit e2617c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/msf/core/rpc/v10/rpc_db.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def rpc_workspaces
285285
res[:workspaces] = []
286286
self.framework.db.workspaces.each do |j|
287287
ws = {}
288+
ws[:id] = j.id
288289
ws[:name] = j.name
289290
ws[:created_at] = j.created_at.to_i
290291
ws[:updated_at] = j.updated_at.to_i
@@ -295,7 +296,7 @@ def rpc_workspaces
295296

296297
def rpc_current_workspace
297298
db_check
298-
{ "workspace" => self.framework.db.workspace.name }
299+
{ "workspace" => self.framework.db.workspace.name, "workspace_id" => self.framework.db.workspace.id }
299300
end
300301

301302
def rpc_get_workspace(wspace)
@@ -306,6 +307,7 @@ def rpc_get_workspace(wspace)
306307
if(wspace)
307308
w = {}
308309
w[:name] = wspace.name
310+
w[:id] = wspace.id
309311
w[:created_at] = wspace.created_at.to_i
310312
w[:updated_at] = wspace.updated_at.to_i
311313
ret[:workspace] << w

0 commit comments

Comments
 (0)