Closed Bug 625054 Opened 15 years ago Closed 11 years ago

Add-on builder accepts invalid identifiers as package names

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: kmag, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110109 Firefox/4.0b9pre Build Identifier: The add-on builder should only accept strings which constitute valid domain names as package names, and should mangle them into proper JavaScript identifiers before using them to generate code. At the moment, for instance, foo-addon is accepted as a package name and used as a JavaScript identifier without complaint (I've just rejected and add-on which used it unchanged, I'm sorry to say). I'd recommend a validator that accepts /^[a-z][a-z0-9-]+$/ and a mangler along the lines of re.sub(r'-(.)', lambda m: m.group(1).upper(), name). Reproducible: Always
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch Proposed fixSplinter Review
This is against the http://svn.mozilla.org/projects/fizzypop/trunk/ repo that Jorge has been pushing to. If the http://svn.mozilla.org/libs/fizzypop.mozdev repo has changed significantly since then, I'll update once Jorge's changes have been pushed, since this patch depends on them.
Attachment #503200 - Flags: review?(mark.finkle)
Comment on attachment 503200 [details] [diff] [review] Proposed fix looks good to me. we can tweak the "valid_namespace" regex if it seems to restrictive.
Attachment #503200 - Flags: review?(mark.finkle) → review+
Assignee: nobody → mbasta
Assignee: mbasta → zaloon
So not sure why this got taken, but for whoever works on this, the new packager is here: https://github.com/mattbasta/addon-packager and here: https://github.com/jbalogh/zamboni/blob/master/apps/devhub/views.py#L512
ohhh, I think this is in the wrong component...
Assignee: zaloon → nobody
Component: Add-on Builder → Developer Pages
QA Contact: add-on-builder → developers
Assignee: nobody → mbasta
Depends on: 922101
Assignee: mattbasta → nobody
Thanks for filing this. Due to resource constraints we are closing bugs which we won't realistically be able to fix. If you have a patch that applies to this bug please reopen. For more info see http://micropipes.com/blog/2014/09/24/the-great-add-on-bug-triage/
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: