License validation rules

The UPM 2.0 licensing API checks add-on licenses for validity, and returns an error that add-ons can use to enforce license validity in a custom manner. The error conditions are listed below.

By default, an invalid license is enforced differently between standard and evaluation licenses, as follows:

  • Non-evaluation licenses have maintenance termination dates. When a maintenance term expires for a standard license, the plugin continues to work but cannot be updated to new versions of the plugin. Also, vendor support for the plugin in no longer available after the maintenance period ends.
  • Evaluation licenses have expiration dates. The plugin can be updated as long as the evaluation license is valid. However, unlike a standard license, the plugin stops working when the license period for an evaluation license ends.

Valid license

A license is valid if it does not have any error conditions.

Conditions that invalidate a plugin license

Expired

A license is invalid if the current date is greater than or equal to the license's expiration date. Normally, only evaluation and subscription licenses have expiration dates. Perpetual licenses do not have expiration dates; instead, perpetual licenses have maintenance expiration dates after which the add-on should continue to be fully functioning, but the customer will no longer be eligible for add-on updates or support.

Suggested Error Message:

Invalid license: Your evaluation license of ADD_ON_NAME expired. Please use the 'Buy' button to purchase a new license.

Type mismatch

A license is invalid if its type (commercial, developer, academic, etc.) is incompatible with the type of the application license:

  • If the application license is developer, all plugin license types are compatible.
  • If the application license is hosted, the plugin license type must be hosted, academic, commercial, community, or open source. (This license type was used for hosted installations prior to On-Demand; it will likely become obsolete.)
  • For all other application license types, the plugin license type must be the same as the application license type.

Starting with UPM 2.7, Enterprise license enforcement is also supported. Customers using UPM 2.7 or later will also have an incompatibility:

  • If the application license is an Enterprise license and the plugin license is not.

Suggested Error Message:

Invalid license: Your evaluation license of ADD_ON_NAME expired. Please use the 'Buy' button to purchase a new license.

Evaluation Licenses

The system skips this test for evaluation licenses and considers all license types compatible. This is true if either or both of the plugin license and application license is an evaluation license.

User mismatch

A license is invalid if its maximum number of users property is less than that of the application license:

  • Application is licensed for an unlimited number of users; plugin license has a fixed user limit
  • Application is licensed for a fixed limit; plugin license has a fixed limit that is lower

Suggested Error Message:

Invalid license: Your ADD_ON_NAME is only licensed for LIMIT_VALUE users. Your ATLASSIAN_APPLICATION installation requires a license for LIMIT users. Please get a ADD_ON_NAME license for LIMIT_VALUE users and try again.

Evaluation Licenses

The system skips this test for evaluation licenses and considers all license types compatible. This is true if either or both of the plugin license and application license is an evaluation license.

Edition mismatch

This error currently only applies to Bamboo plugin licenses. A license is invalid if its maximum number of remote agents property is less than that of the application license:

  • Application is licensed for an unlimited number of remote agents; plugin license has a fixed remote agent limit
  • Application is licensed for a fixed limit; plugin license has a fixed limit that is lower

Suggested Error Message:

Invalid license: Your ADD_ON_NAME is only licensed for LIMIT_VALUE remote agents. Your ATLASSIAN_APPLICATION installation requires a license for LIMIT remote agents. Please get a ADD_ON_NAME license for LIMIT_VALUE users and try again.

Evaluation Licenses

The system skips this test for evaluation licenses and considers all license types compatible. This is true if either or both of the plugin license and application license is an evaluation license.

Version mismatch

A license is invalid if the plugin's build date is greater than or equal to the license's maintenance expiration date. That is, if the license says that support is only available through 1/1/2012, then an existing installation of a plugin version with a build date of 1/1/2011 will continue working indefinitely, but if you install a new version built on 1/2/2012 or later it will not work with the old license.

The plugin build date is indicated by an Atlassian-specific property in the manifest of the plugin JAR, Atlassian-Build-Date. This property is added to the plugin manifest by the Plugins SDK. You should not remove the Atlassian-Build-Date property from the manifest.

Suggested Error Message:

Invalid license: Your license for maintenance of ADD_ON_NAME is not valid for version X.Y.Z. Please use the 'Renew' button to renew your ADD_ON_NAME license.

Handling a license validation error

You can implement your own license enforcement behavior through the ThirdPartyPluginLicenseStorageManager class. For example, an invalid license may cause your plugin to function in read-only mode, or you might choose to display a renewal banner.

The class includes the getLicense() method, which lets you check the validity of the license for the current plugin. A license error indicates an invalid or expired license. You can inspect the license status in the following form:

if (licenseManager.getLicense().isDefined())
{
   PluginLicense license = licenseManager.getLicense().get();
   if (license.getError().isDefined())
   {
        // handle license error scenario
        // (e.g., expiration or user mismatch) 
   }
   else
   {
        // handle valid license scenario
   }
} 
else
{
        // handle unlicensed scenario
}

We recommend that you check for license validity at each of the plugin's entry points. Upon detecting an invalid license you can either hide all UI elements, make your plugin read-only, disable your plugin, or any other behavior your define.

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport