The default bug view has changed. See this FAQ.

[FIX] Make nsIPrincipal scriptable so things like CheckLoadURIWithPrincipal are usable from script

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
Security: CAPS
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla1.9alpha1
x86
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

The noscript silliness with nsIPrincipal is just that -- silliness, imo.  If we don't want script messing with the principal, we should make all the methods and properties noscript instead.
Created attachment 211948 [details] [diff] [review]
Fix

I made most stuff on nsIPrincipal noscript; the exceptions are equals() (which I think should be scriptable for sure) and the certificate stuff (which I think it makes sense to leave scriptable).

I'm open to more things being noscript if desired, though.
Attachment #211948 - Flags: superreview?(dveditz)
Attachment #211948 - Flags: review?(jst)
Assignee: dveditz → bzbarsky
Target Milestone: --- → mozilla1.9alpha
Blocks: 327244
Blocks: 147145
Comment on attachment 211948 [details] [diff] [review]
Fix

If you're going to expose the cert stuff (which is fine) should we also expose the readonly URI for non-cert principals? But then it may be a domain principal, and domain is not readonly. I guess we don't want people to care what's inside a principal.
sr=dveditz
Attachment #211948 - Flags: superreview?(dveditz) → superreview+
I do think eventually we may want to expose a scriptable URI, but when we do I want to return a clone.  Right now people can get the "readonly" URI and then modify the object; I don't think we want to support that from script.  ;)
Comment on attachment 211948 [details] [diff] [review]
Fix

r=jst
Attachment #211948 - Flags: review?(jst) → review+
Blocks: 293973
Created attachment 212186 [details] [diff] [review]
Patch that I checked in

Revs the nsIScriptSecurityManager IID too.
Attachment #211948 - Attachment is obsolete: true
Except tree's closed, so I did not in fact check this in yet.
Fixed for real.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.