atlassian_connect_shelf 0.11.9

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 22

Atlassian Connect Shelf Server

Introduction

Provides a server based on the Shelf library.

It includes the following Shelf Middleware components:

  • productHostAuthenticator. A Shelf Middleware component for authenticating requests from product hosts
  • sessionTokenAuthenticator. A Shelf Middleware component for authenticating requests from the addon client code using the Atlassian Connect session token mechanism

In addition it includes:

  • AcDartRouter. An extension of a Shelf Route router adding:

    • helpers for easily defining core routes such as for handling installation requests and serving atlassian-connect.json
    • Additional Shelf Bind custom objects to support injection of the following into handlers
      • AcSessionContext containing the session information relating to the current request
      • AcHostService for all host related services for the Atlassian product host that is associated with the current request.
      • AcHostHttpClient to communicate with the Atlassian product host that is associated with the current request.
      • AcHostRegistration the registration details for the Atlassian product host that is associated with the current request.
      • AcDartRequestContext a wrapper object that contains access to the other context objects aiding discoverability
  • AcDartApp. Provides a convenient entry point into the app

The Shelf Server uses all the other Atlassian Connect Dart libraries. It's the easiest way to get started and we believe provides a good solution. However, if you prefer another web framework then you can still use all the other Atlassian Connect Dart libraries, greatly reducing the effort to get up and running.

Using

Basic Usage

Note there is an example project that is in the example folder of the library that illustrates basic usage.

Create your Configuration

See the documentation for the Atlassian Connect Configuration library for details.

Define your Routes

Create your app and set up the routes by using the acdart function as the entry point. Call start when ready to bring up the server.

void main() {
  final app = acdart(config);
  
  // add standard handlers for installation and descriptor
  app.router..addInstallationRoute()
            ..addDescriptorTemplateRoute();
  
  // define a child route for all routes that will be authenticated via addon session token
  app.router.child('/service',
      middleware: app.addonSessionAuthenticator)
      ..get('/issue/{issueKey}', _fetchJiraIssue)
      ..put('/issue/{issueKey}', _updateJiraIssue);
      
  // define a child route for all routes that will be authenticated via Atlassian Host token
  app.router.child('/ui',
      middleware: app.atlassianHostAuthenticator)
      ..get('/exampleUI.html',
          app.moustacheFile('ui/exampleUI.html', includeExtraParams: true));
  
  // start your engines
  app.start();
}

Request handlers (thanks to Shelf Bind) are just ordinary Dart functions and have access to the additional objects injected via AcDartApp.

In this case the issueKey was defined on the route (/issue/{issueKey}) so can simply be accessed as a function parameter and AcHostHttpClient is one of the objects AcDart can inject for you.

As the route is a child of /service it is authenticated via the Addon Session token so the AcHostHttpClient object will be initialised for communication with the correct host.

Future<Map> _fetchJiraIssue(String issueKey, AcHostHttpClient httpClient) {
  _log.fine('fetching jira issue $issueKey');

  final jiraResponse =
      httpClient.get('rest/api/2/issue/$issueKey', signRequest: true)
        .then((req) => req.close());

  return jiraResponse
      .then(HttpBodyHandler.processResponse)
      .then((body) => body.body);
}

0.11.8

  • ngrok 2

0.10.0

  • upgraded mojito

0.8.0

  • Now built on top of mojito framework \o/

0.7.0

  • Turn off parameter validation till https://bitbucket.org/andersmholmgren/constraint/issue/34/constraint-resolver-does-not-cope-with-all fixed

0.6.2

  • Added support for jwt in header
  • Added heroku setup helper

0.6.1

  • Added more injectable objects

0.6.0

  • Reworked around new capabilities of Shelf Route and Shelf Bind

0.5.3

  • AcDart Config upgraded to 0.3.2

0.5.2

  • minor bits and bobs

0.5.1

  • AcDart Config upgraded to 0.3.1

0.5.0

  • AcDart Config upgraded to 0.3.0

0.4.0

  • AcDart Config upgraded to 0.2.0

0.3.1

  • upgraded host services (via config) to pick up hijacking fix

0.3.0+4

  • upgraded min sdk version

0.3.0+3

  • Bug fix. Resolve file paths correctly

0.3.0+2

  • Bug fix. Using correct serverPort

0.3.0+1

  • Upgraded to atlassian_connect_config 0.1.0+1

0.3.0

  • Upgraded to shelf route 0.3.1. Note path variables have now changed to {}

0.2.0

  • Upgraded to shelf 0.4.0 and shelf route 0.2.0

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  atlassian_connect_shelf: "^0.11.9"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:atlassian_connect_shelf/atlassian_connect_shelf.dart';
        
Version Uploaded Documentation Archive
0.11.9 May 11, 2016 Go to the documentation of atlassian_connect_shelf 0.11.9 Download atlassian_connect_shelf 0.11.9 archive
0.11.8 May 11, 2016 Go to the documentation of atlassian_connect_shelf 0.11.8 Download atlassian_connect_shelf 0.11.8 archive
0.11.7 Apr 10, 2016 Go to the documentation of atlassian_connect_shelf 0.11.7 Download atlassian_connect_shelf 0.11.7 archive
0.11.6 Mar 11, 2016 Go to the documentation of atlassian_connect_shelf 0.11.6 Download atlassian_connect_shelf 0.11.6 archive
0.11.5 Mar 11, 2016 Go to the documentation of atlassian_connect_shelf 0.11.5 Download atlassian_connect_shelf 0.11.5 archive
0.11.4 Oct 28, 2015 Go to the documentation of atlassian_connect_shelf 0.11.4 Download atlassian_connect_shelf 0.11.4 archive
0.11.3 Aug 20, 2015 Go to the documentation of atlassian_connect_shelf 0.11.3 Download atlassian_connect_shelf 0.11.3 archive
0.11.2 Aug 12, 2015 Go to the documentation of atlassian_connect_shelf 0.11.2 Download atlassian_connect_shelf 0.11.2 archive
0.11.1 Jul 14, 2015 Go to the documentation of atlassian_connect_shelf 0.11.1 Download atlassian_connect_shelf 0.11.1 archive
0.11.0 Jul 14, 2015 Go to the documentation of atlassian_connect_shelf 0.11.0 Download atlassian_connect_shelf 0.11.0 archive

All 32 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 19, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
61 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
19 / 100
Overall score:
Weighted score of the above. [more]
22

Platforms

Detected platforms: other

Primary library: package:atlassian_connect_shelf/atlassian_connect_shelf.dart with components: io, mirrors.

Suggestions

  • Fix lib/src/descriptor_builders/bitbucket_impl.dart.

    Strong-mode analysis of lib/src/descriptor_builders/bitbucket_impl.dart failed with the following error:

    line: 14 col: 38
    Base class introduces an invalid override. The type of 'StandardDescriptorBuilderImpl.addAdminPage' ('(String, String, BitbucketLocation) → void') isn't a subtype of 'StandardDescriptorBuilder<BitbucketModuleList, BitbucketScope, BitbucketConnectAddon>.addAdminPage' ('(String, String, ModuleLocation) → void').

  • Fix lib/src/descriptor_builders/standard_impl.dart.

    Strong-mode analysis of lib/src/descriptor_builders/standard_impl.dart failed with the following error:

    line: 48 col: 22
    The method 'change' isn't defined for the class 'Module'.

  • Fix further 13 Dart files.

    Similar analysis of the following files failed:

    • lib/src/descriptor_builders/jira_impl.dart
    • lib/src/descriptor_builders/confluence_impl.dart
    • lib/src/descriptor_builders/hipchat.dart
    • lib/src/config/config.dart
    • lib/src/router/jira/jira_impl.dart
    • lib/src/router/bitbucket/bitbucket_impl.dart
    • lib/src/router/acdart_router.dart
    • lib/src/router/common/common_routes_impl.dart
    • lib/src/router/common/standard_routes_impl.dart
    • lib/src/router/hipchat/hipchat_impl.dart
    • lib/src/router/confluence/confluence_impl.dart
    • lib/src/auth/auth_impl.dart
    • lib/acdart_app.dart
  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use atlassian_connect_shelf.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.9.0 <2.0.0
appengine ^0.3.3 0.3.3+1 0.4.3+1
atlassian_connect_host >=0.5.7 <0.5.8 0.5.7
constrain ^0.2.8 0.2.8
either ^0.1.8 0.1.8
http_exception ^0.1.0 0.1.0
mojito >=0.6.5 <0.6.6 0.6.5 0.6.6
mustache >=0.2.5 <0.3.0 0.2.5+1 1.0.0
option ^1.1.0 1.2.0
stuff ^0.0.6 0.0.7
unscripted >=0.6.2 <0.7.0 0.6.2
uuid >=0.5.0 <0.6.0 0.5.1 0.5.3
Transitive dependencies
_discoveryapis_commons 0.1.5
ansicolor 0.0.9
args 0.13.7 1.3.0
async 1.13.3 2.0.4
atlassian_connect_jwt 0.3.7
atlassian_connect_models 0.0.3
bignum 0.0.7 0.1.0
bson 0.2.0 0.3.0
charcode 1.1.1
cipher 0.7.1
collection 1.14.5
concepts 0.2.0
config 0.0.5
convert 1.1.1 2.0.1
converters 0.0.3
crypto 0.9.2+1 2.0.2+1
dart_jwt 0.4.6 0.6.0
fixnum 0.9.1+2 0.10.7
gcloud 0.2.0+14 0.4.0+1
googleapis 0.28.0 0.50.0
googleapis_auth 0.2.4
googleapis_beta 0.27.1 0.45.0
hateoas_models 0.2.0
http 0.11.3+16
http_parser 3.1.1
http_server 0.9.7
logging 0.11.3+1
matcher 0.12.1+4
memcache 0.2.1+2
mime 0.9.6
mockable_filesystem 0.0.3
mongo_dart 0.2.10 0.3.1
mongo_dart_query 0.2.2 0.3.0
more 1.8.1
oauth 0.3.0 0.4.0
path 1.3.9 1.5.1
petitparser 1.7.0
protobuf 0.5.5 0.7.0
quiver 0.21.4 0.28.0
shelf 0.6.8 0.7.2
shelf_auth 0.7.2 0.7.4
shelf_auth_session 0.4.11 0.4.12
shelf_bind 0.9.3 0.9.4
shelf_exception_handler 0.1.0
shelf_oauth 0.8.2
shelf_oauth_memcache 0.3.7
shelf_path 0.1.8
shelf_proxy 0.1.0+4
shelf_response_formatter 0.1.0
shelf_rest 0.3.4 0.3.5
shelf_route 0.14.2 0.14.3
shelf_static 0.2.7
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.3
string_scanner 1.0.2
supports_color 0.1.1
typed_data 1.1.5
uri 0.11.1
utf 0.9.0+4
xml 2.6.0 3.0.0-alpha
Dev dependencies
mockito >=0.11.0 <0.12.0
test ^0.12.0