Seb Ruiz avatar Seb Ruiz committed b776c82

AC-831: Remove deprecated Atlassian Connect registration methods

This makes debugging UPM installation issues very difficult

Comments (0)

Files changed (1)

lib/internal/registration.js

           self._registrations[hostRegUrl] = clientKey;
           resolve();
         }
-        function fallback(args) {
-          self.logger.warn('Falling back to deprecated registration service');
-          registerConnect(hostRegUrl, descriptorUrl).then(done, fail);
-        }
         function fail(args) {
           self.logger.error(registrationError('register', clientKey, args[0], args[1]));
           resolve();
         }
-        registerUpm(hostRegUrl, descriptorUrl).then(done, fallback);
+        registerUpm(hostRegUrl, descriptorUrl).then(done, fail);
       },
       function () {
         // ignore connection errors as registration no-ops
   return promise;
 }
 
-function registerConnect(hostRegUrl, descriptorUrl) {
-  var promise = new RSVP.Promise(function(resolve,reject) {
-    request.post({
-      uri: hostRegUrl + '/rest/atlassian-connect/latest/installer',
-      form: {url: descriptorUrl},
-      jar: false
-    }, function (err, res) {
-      if (err || (res && res.statusCode !== 200)) return reject([err, res]);
-      resolve();
-    });
-  });
-  return promise;
-}
-
 function deregister(hostRegUrl) {
   var self = this;
   var clientKey = self._registrations[hostRegUrl];
         }
       );
     }
-    function fallback() {
-      deregisterConnect(self, hostRegUrl, clientKey).then(done, fail);
-    }
     function fail(args) {
       self.logger.error(registrationError('deregister', clientKey, args[0], args[1]));
       resolve();
     }
     if (clientKey) {
-      deregisterUpm(self, hostRegUrl, clientKey).then(done, fallback);
+      deregisterUpm(self, hostRegUrl, clientKey).then(done, fail);
     }
     else {
       resolve();
   return promise;
 }
 
-function deregisterConnect(self, hostRegUrl, clientKey) {
-  var promise = new RSVP.Promise(function(resolve,reject) {
-    request.del({
-      uri: hostRegUrl + '/rest/atlassian-connect/latest/uninstaller/' + self.key,
-      jar: false
-    }, function (err, res) {
-      if (err || (res && res.statusCode !== 204)) return reject([err, res]);
-      resolve();
-    });
-  });
-  return promise;
-}
-
 function registrationError(action, clientKey, err, res) {
   var args = ['Failed to ' + action + ' with host ' + clientKey];
   if (res && res.statusCode) args[0] = args[0] + (' (' + res.statusCode + ')');
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.