#1722 closed task (blessed) (fixed)
Generate a plugins.svn authentication file
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | high | |
Component: | Plugin Directory | Keywords: | has-patch 2nd-opinion |
Cc: |
Description
plugins.svn.wordpress.org
needs a standard svn formatted authentication file for authenticating users against each plugin directory.
We'll need to provide a URL or REST API endpoint which the SVN server can request a copy of this file from. The SVN server will also need to be updated to fetch it from here rather than from bbPress.
The REST API endpoint should not be readable without our internal authentication token.
An example of what the file should look like is:
[/] * = r [/plugin-x] dd32 = rw dd63 = rw [/plugin-y] dd64 = rw
Attachments (1)
Change History (12)
This ticket was mentioned in Slack in #meta by obenland. View the logs.
9 years ago
This ticket was mentioned in Slack in #meta by obenland. View the logs.
9 years ago
#7
@
9 years ago
@pento agreed on all points there.
exit()
is weird, but logical in this case - technically I think there's a "proper" way to have an alternate output format, but it'd be overkill here.
Only downside is that post-rest-api actions potentially won't be called, so no caching middleman etc - we don't care about that for this endpoint though.
You could use PLUGINS_TABLE_PREFIX . 'svn_access'
if you wanted (which is what we use in the other functions that interact with the table) but 'eh. It would probably be best for us to rename the table to wporg_367_svn_access
after launch to ensure that the table never goes astray, so we'd update it then anyway.
only nitpick would be:
this->svn_access = array(); $this->svn_access_table = 'plugin_2_svn_access';
Why define those there, when they can just be defined inline?
protected $svn_access = array(); protected $svn_access_table = 'plugin_2_svn_access';
And in general I also have been using protected
over private
so that the methods/properties are available to subclasses (if one was to ever exist for some reason).
@dd32: Can you sanity check this patch? It's a bit weird to be
exit()
ing a REST API endpoint, but that'll make it easiest to integrate with the existing SVN server.The output is 2 lines longer than the existing script, because it doesn't
trim()
the newlines off each end.To grab the file:
(With the correct
PLUGIN_API_INTERNAL_BEARER_TOKEN
, of course.)