From a53cea6b7e4094ea51339c80ab5fe160a19a9f6b Mon Sep 17 00:00:00 2001
From: Dr Scofield
Date: Tue, 20 May 2008 16:51:45 +0000
Subject: i'm extending the RestStreamHandler.Handler(...) signature to
actually provide OSHttpRequest and OSHttpResponse to our REST handler.
also, this adds proper RestPlugin.IsGod() checking against the X-OpenSim-Godkey
HTTP request header.
last, i added XML doc comments to RestPlugin.cs
---
OpenSim/Grid/GridServer/GridManager.cs | 24 ++++++++++++++++++------
OpenSim/Grid/UserServer/UserManager.cs | 6 +++++-
2 files changed, 23 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Grid')
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 83b5319..5a6a328 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -877,10 +877,13 @@ namespace OpenSim.Grid.GridServer
///
///
///
+ /// HTTP request header object
+ /// HTTP response header object
///
- public string RestGetRegionMethod(string request, string path, string param)
+ public string RestGetRegionMethod(string request, string path, string param,
+ OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- return RestGetSimMethod(String.Empty, "/sims/", param);
+ return RestGetSimMethod(String.Empty, "/sims/", param, httpRequest, httpResponse);
}
///
@@ -889,10 +892,13 @@ namespace OpenSim.Grid.GridServer
///
///
///
+ /// HTTP request header object
+ /// HTTP response header object
///
- public string RestSetRegionMethod(string request, string path, string param)
+ public string RestSetRegionMethod(string request, string path, string param,
+ OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- return RestSetSimMethod(String.Empty, "/sims/", param);
+ return RestSetSimMethod(String.Empty, "/sims/", param, httpRequest, httpResponse);
}
///
@@ -901,8 +907,11 @@ namespace OpenSim.Grid.GridServer
///
///
/// A string representing the sim's UUID
+ /// HTTP request header object
+ /// HTTP response header object
/// Information about the sim in XML
- public string RestGetSimMethod(string request, string path, string param)
+ public string RestGetSimMethod(string request, string path, string param,
+ OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
string respstring = String.Empty;
@@ -946,8 +955,11 @@ namespace OpenSim.Grid.GridServer
///
///
///
+ /// HTTP request header object
+ /// HTTP response header object
/// "OK" or an error
- public string RestSetSimMethod(string request, string path, string param)
+ public string RestSetSimMethod(string request, string path, string param,
+ OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
Console.WriteLine("Processing region update via REST method");
RegionProfileData theSim;
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index 1cf2a48..706f461 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -35,6 +35,7 @@ using log4net;
using Nwc.XmlRpc;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
+using OpenSim.Framework.Servers;
namespace OpenSim.Grid.UserServer
{
@@ -53,8 +54,11 @@ namespace OpenSim.Grid.UserServer
/// The request
/// The path (eg /bork/narf/test)
/// Parameters sent
+ /// HTTP request header object
+ /// HTTP response header object
/// Success "OK" else error
- public string RestDeleteUserSessionMethod(string request, string path, string param)
+ public string RestDeleteUserSessionMethod(string request, string path, string param,
+ OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
// TODO! Important!
--
cgit v1.1