Closed
Bug 183824
Opened 22 years ago
Closed 22 years ago
Implement an alternative mechanism to ensure SOAP security
Categories
(Core :: XML, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.4alpha
People
(Reporter: harishd, Assigned: harishd)
Details
Attachments
(2 files, 6 obsolete files)
7.46 KB,
patch
|
rayw
:
review+
harishd
:
superreview+
|
Details | Diff | Splinter Review |
7.86 KB,
application/x-gzip
|
rayw
:
review+
harishd
:
superreview+
|
Details |
Comment 2•22 years ago
|
||
Looks great. Do we have a demo?
Mitch: Not yet. I discovered a flaw in my implementation and hence rewiring my code.
Note: This is not the final patch. However, would appreciate reviews.
Please ignore patch v1.0
Attachment #108957 -
Attachment is obsolete: true
Mitch and I breifly discussed about the patch and Mitch brought up the point
that I should be comparing nsIURIs instead of plain uri strings. I'll work on
that but that shouldn't stop people from reviewing the patch :-)
Attachment #108958 -
Flags: superreview?(jst)
Attachment #108958 -
Flags: review?(rayw)
Comment 7•22 years ago
|
||
A couple of general notes before I'll start looking at this line-by-line...
I see this all over:
+NS_NAMED_LITERAL_STRING(webScriptAccess, "webScriptAccess");
+const nsAString& kWebScriptAccessTag = webScriptAccess;
Why not just:
+NS_NAMED_LITERAL_STRING(kWebScriptAccessTag, "webScriptAccess");
?
The struct 'Attributes' should IMO be renamed, Attributes is IMO way too
generic, find a name that describes the struct better. And while you're at it,
make it a class and incapsulate the cleanup of the struct/class into its destructor.
+ PRBool success = status / 100 == 2;
Why help the optimizer a bit and write this as:
+ PRBool success = status == 200;
This would also make it possible to search the code for the success code 200.
- In nsSOAPSecurity::CreateAccessInfoEntry():
+ node->GetAttributes(getter_AddRefs(attrs));
+ NS_ENSURE_TRUE(attrs, NS_ERROR_UNEXPECTED);
+
+ attrs->GetNamedItemNS(kNamespace2002, kTypeAttr,
+ getter_AddRefs(attr));
+ if (attr)
+ attr->GetNodeValue(type);
Couldn't this be done using nsIDOMElement::GetAttributeNS()? That would
definately be faster than creating an attribute list (they're lazily created, so
evey call here would malloc to create the list).
This method also uses ToNewUnicode() in a few places w/o doing any error
checking, i.e. it doesn't deal with OOM (and FreeEntries() frees the memory that
was returned by ToNewUnicode() w/o checking that it's not null too).
- In nsSOAPSecurity::ValidateDocument():
+ nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(rootElement));
+ NS_ENSURE_TRUE(rootNode, NS_ERROR_UNEXPECTED);
An element is always a node, therefore the error checking is unnecessary. And
since you're only using rootNode to get the children of the root element, you
don't even need rootNode, nsIDOMElement inherits nsIDOMNode, so you can call
GetCholdNodes() on rootElement directly...
I still think it would be a good idea to put a InvalidateCache() method in the
nsISOPASecurityService interface, even if there are no callers today. The
implementation of this would be on the order of 2 lines, so the cost is really
really low, and some developers migh find this extremely useful.
Fix that, and what you talked to Mitch about and I can have a closer look...
Comment 8•22 years ago
|
||
Harish,
Can you explain the alternate algorithm? What exactly does this new model
consist of? What evangelism tasks are necessary (e.g. should documentation
exist on evangelizing SOAP services to do anything additional in order to allow
cross-domain Mozilla access?)
Arun, please take a look a the draft ( v1.0 ) in comment #1.
Updated•22 years ago
|
Attachment #108425 -
Attachment description: draft_v1.0 → Security Model Documentation, draft 1.0
Assignee | ||
Comment 10•22 years ago
|
||
Addressing jst's concerns. This patch also includes error reporting ( localized
).
Attachment #108958 -
Attachment is obsolete: true
Assignee | ||
Comment 11•22 years ago
|
||
Comment on attachment 112325 [details] [diff] [review]
patch v1.2
Note to reviewers:
Please ignore the changes in nsHTTPSOAPTransport.cpp.
I was only using those changes to trigger my code.
Attachment #112325 -
Flags: superreview?(jst)
Attachment #112325 -
Flags: review?(rayw)
Updated•22 years ago
|
Attachment #108958 -
Flags: superreview?(jst)
Attachment #108958 -
Flags: review?(rayw)
Assignee | ||
Comment 12•22 years ago
|
||
Note: I've created a new directory called "security" under xmlextras and have
named the new files as nsIWebScriptsAccessService and nsWebScriptsAccess.* to
reflect the proposed security model. I'll post a patch once the directory/file
names are finalized.
Attachment #112766 -
Flags: review?(rayw)
Assignee | ||
Comment 13•22 years ago
|
||
Attachment #112325 -
Attachment is obsolete: true
Attachment #112766 -
Attachment is obsolete: true
Assignee | ||
Comment 14•22 years ago
|
||
This patch includes:
1) Build changes
2) Code to trigger the new security.
Attachment #108425 -
Attachment is obsolete: true
Attachment #117641 -
Attachment is obsolete: true
Assignee | ||
Comment 15•22 years ago
|
||
Comment on attachment 118101 [details] [diff] [review]
patch
Adding jst's email sr=
Attachment #118101 -
Flags: superreview+
Assignee | ||
Comment 16•22 years ago
|
||
Assignee | ||
Comment 17•22 years ago
|
||
Comment on attachment 118103 [details]
Tarball of new security implementation [ gzipped ]
Adding jst's email sr=
Attachment #118103 -
Flags: superreview+
Attachment #118101 -
Flags: review?(rayw)
Attachment #118103 -
Flags: review?(rayw)
Updated•22 years ago
|
Priority: -- → P1
Target Milestone: --- → mozilla1.4alpha
Comment 18•22 years ago
|
||
Comment on attachment 118101 [details] [diff] [review]
patch
r=rayw
Attachment #118101 -
Flags: review?(rayw) → review+
Comment 19•22 years ago
|
||
Comment on attachment 118103 [details]
Tarball of new security implementation [ gzipped ]
One thing to fix, on line 128-129, change to:
if (rhs_end == rhs_begin)
return PR_FALSE;
Attachment #118103 -
Flags: review?(rayw) → review+
Comment 20•22 years ago
|
||
Comment on attachment 118103 [details]
Tarball of new security implementation [ gzipped ]
One thing to fix, on line 128-129, change to:
if (rhs_end == rhs_begin)
return PR_FALSE;
r=rayw
Assignee | ||
Comment 21•22 years ago
|
||
Feature landed and enabled.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 22•22 years ago
|
||
Comment on attachment 112766 [details]
tar ball ( gzipped ) - Includes changes suggested by rayw.
clearing obsolete review requests
Attachment #112766 -
Flags: review?(rayw)
Updated•22 years ago
|
Attachment #112325 -
Flags: superreview?(jst)
Attachment #112325 -
Flags: review?(rayw)
You need to log in
before you can comment on or make changes to this bug.
Description
•