Create an Allura Application that stores shortened URLs.  The short_name of the URL is given by the user, and the URL can be made either public or private.  We will also need a migration script, which will be created in another ticket, to pull existing URL data from a MySQL database.
Example URL (if installed on myproject at mount point url with a URL short_name of 'sshfp'):
http://sf.net/p/myproject/url/sshfpURL Data:
urlshort_name (indexed, unique)descriptionprivatecreate_usercreatedlast_updatedPermissions (all should default to Admin):
CREATEUPDATEVIEW_PRIVATEApp properties:
default_mount_point = 'url'installable = False (the tool should not show up in the installable list)hidden = True (the tool should not show up in the navigation bar)sitemap = []Adding or editing a URL should create an entry in the project audit log that includes the old and new URLs.
The admin menu for the tool should have an Add and Browse option.
Add should present a pop-up with inputs for the short_name, full URL and a checkbox for private.
Browse should open a separate page which lists the URLs for the app.  Users without the VIEW_PRIVATE permission should be able to view the page, but shouldn't see the private URLs listed.  The page should list the following:
privatecreate_usershort URLfull URLdescriptioncreatedlast_updatedThe Add and Browse pages will need not conflict with user-defined short_names, perhaps by overloading index via query paramaters (e.g., /p/myproject/url/?action=browse).  Or /p/myproject/url with no param is used for browsing, and adding is via the admin controller /p/myproject/admin/url/add
milestone: limbo --> forge-backlog
Description has changed:
Diff:
created #146: [#4637] Create URL shortener Allura App (4cp)
Related
Tickets:
#4637Closed #146. Branch 42cc_4637.
I've been working on [#4785] and made some fixes to
ShortUrlmodel that related to this ticket, so I updated the code in branch 42cc_4637 with those fixes (commit b6270002882d58bbb34b33850a6c11a1a4083843)Related
Tickets:
#4785The
ShortUrlmodel should inherit fromArtifactand add anindexmethod, so that the URLs are searchable. Additionally, this ties the model to the project via the AppConfig instance, so theproject_idfield is unnecessary (using instead theapp_config_idandappproperties). Also, uninstalling the app should remove the URLs data for that app instance.Also, I was mistaken about how the
hiddenfield works, as it appears to only hide the tool from the list of installed tools on the Admin page, preventing access to the permissions and other configuration. What we actually need is abrowsepermission that controls whether the app shows up in the navigation bar by way of the app implementing theis_visible_tomethod (seeAllura/allura/ext/admin/admin_main.pyline 69). By default, only Admins should be able to browse the URLs.Created #168: [#4637] URL shortener Allura App improvements (1cp)
Related
Tickets:
#4637Closed #168. All changes in branch 42cc_4637.
I made some corrections to the private flag and search, but otherwise good.
Discovered some more items that need to be addressed:
ShortURLAdminController.add()doesn't enforceCREATE/UPDATEpermissions, allowing anyone to add or modify URLs if they can construct the POST request without the UI.Should probably add Update / Remove links to the table.
Please note that I made some changes as well, so you'll need to rebase from dev.
Created #176: [#4637] URL shortener improvements (2cp)
Related
Tickets:
#4637Closed #176. Changes are in branch 42cc_4637a.