Closed Bug 183824 Opened 22 years ago Closed 22 years ago

Implement an alternative mechanism to ensure SOAP security

Categories

(Core :: XML, defect, P1)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.4alpha

People

(Reporter: harishd, Assigned: harishd)

Details

Attachments

(2 files, 6 obsolete files)

Status: NEW → ASSIGNED
Looks great. Do we have a demo?
Mitch: Not yet. I discovered a flaw in my implementation and hence rewiring my code.
Attached patch patch v1.0 (obsolete) — Splinter Review
Note: This is not the final patch. However, would appreciate reviews.
Attached patch patch v1.1 (obsolete) — Splinter Review
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)
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...
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.
Attachment #108425 - Attachment description: draft_v1.0 → Security Model Documentation, draft 1.0
Attached patch patch v1.2 (obsolete) — Splinter Review
Addressing jst's concerns. This patch also includes error reporting ( localized ).
Attachment #108958 - Attachment is obsolete: true
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)
Attachment #108958 - Flags: superreview?(jst)
Attachment #108958 - Flags: review?(rayw)
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)
Attached file Tar ball. (obsolete) —
Attachment #112325 - Attachment is obsolete: true
Attachment #112766 - Attachment is obsolete: true
Attached patch patchSplinter Review
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
Comment on attachment 118101 [details] [diff] [review] patch Adding jst's email sr=
Attachment #118101 - Flags: superreview+
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)
Priority: -- → P1
Target Milestone: --- → mozilla1.4alpha
Comment on attachment 118101 [details] [diff] [review] patch r=rayw
Attachment #118101 - Flags: review?(rayw) → review+
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 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
Feature landed and enabled.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment on attachment 112766 [details] tar ball ( gzipped ) - Includes changes suggested by rayw. clearing obsolete review requests
Attachment #112766 - Flags: review?(rayw)
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.

Attachment

General

Creator:
Created:
Updated:
Size: