Index: api/class-base.php
===================================================================
--- api/class-base.php	(revision 3453)
+++ api/class-base.php	(working copy)
@@ -11,6 +11,7 @@
 	 * Initialises each API route we offer.
 	 */
 	static function load_routes() {
+		new Routes\Commit_Subscriptions();
 		new Routes\Internal_Stats();
 		new Routes\Plugin();
 		new Routes\Popular_Categories();
Index: api/routes/class-commit-subscriptions.php
===================================================================
--- api/routes/class-commit-subscriptions.php	(revision 0)
+++ api/routes/class-commit-subscriptions.php	(working copy)
@@ -0,0 +1,72 @@
+<?php
+namespace WordPressdotorg\Plugin_Directory\API\Routes;
+use WordPressdotorg\Plugin_Directory\Plugin_Directory;
+use WordPressdotorg\Plugin_Directory\API\Base;
+
+/**
+ * An API endpoint for subscribing to commits for a particular plugin.
+ *
+ * @package WordPressdotorg_Plugin_Directory
+ */
+class Commit_Subscriptions extends Base {
+
+	public function __construct() {
+		register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/commit-subscribe?', array(
+			'methods'  => \WP_REST_Server::READABLE,
+			'callback' => array( $this, 'subscribe' ),
+			'args' => array(
+				'plugin_slug' => array(
+					'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
+				),
+				'subscribe' => array(
+					'validate_callback' => 'is_bool',
+				),
+				'unsubscribe' => array(
+					'validate_callback' => 'is_bool',
+				),
+			),
+			'permission_callback' => 'is_user_logged_in'
+		) );
+
+		register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/commit-subscription?', array(
+			'methods'  => \WP_REST_Server::READABLE,
+			'callback' => array( $this, 'subscription_list' ),
+			'args' => array(
+				'plugin_slug' => array(
+					'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
+				),
+			),
+		) );
+	}
+
+	/**
+	 * Endpoint to subscribe to a plugin's commits.
+	 *
+	 * @param \WP_REST_Request $request The Rest API Request.
+	 * @return bool True if the subscription was successful.
+	 */
+	public function subscribe( $request ) {
+	}
+
+	/**
+	 * Endpoint to return the list of subscribers to a plugin.
+	 *
+	 * If the internal API key is passed, a full list is returned. If the user is logged
+	 * in, a list containing that user (if they're subscribed), or an empty list (if they're not)
+	 * is returned.
+	 *
+	 * @param \WP_REST_Request $request The Rest API Request.
+	 * @return array List of subscribed users
+	 */
+	public function subscription_list( $request ) {
+		$subscribers = array();
+
+		if ( $this->permission_check_internal_api_bearer( $request ) ) {
+			// This is an internal call, grab all subscribed users
+		} elseif ( is_user_logged_in() ) {
+			// A logged in user can only check if they're subscribed
+		}
+
+		return $subscribers;
+	}
+}

Property changes on: api/routes/class-commit-subscriptions.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
