Closed Bug 1218039 Opened 10 years ago Closed 10 years ago

Make it easier to tell what kind of principal you have

Categories

(Core :: Security: CAPS, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: bholley, Assigned: bholley)

Details

Attachments

(1 file)

Right now there are various roundabout ways to do this, but we should just expose something obvious on nsIPrincipal. I've got a patch.
Comment on attachment 8678406 [details] [diff] [review] Add a nice interface for both C++ and JS to access the principal kind. v1 Review of attachment 8678406 [details] [diff] [review]: ----------------------------------------------------------------- This is an awesome idea, thanks! Can we also expose |kind| on the IDL level? It would be so cool sometime to just print the principals type (eh, kind). I know it's annoying to expose enums with IDL, but would be useful imo, what do you think?
Attachment #8678406 - Flags: review?(gkrizsanits) → review+
(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #2) > This is an awesome idea, thanks! Can we also expose |kind| on the IDL level? > It would be so cool sometime to just print the principals type (eh, kind). I > know it's annoying to expose enums with IDL, but would be useful imo, what > do you think? Do you mean to access from C++ or JS? With C++ you can already get it via BasePrincipal::Cast. For debugging JS, I think it's good enough to print .origin, which has all the information needed.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
> Do you mean to access from C++ or JS? With C++ you can already get it via > BasePrincipal::Cast. For debugging JS, I think it's good enough to print > .origin, which has all the information needed. Oh, you're right I forgot that we already have meaningful origin for all principals.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: