Browse Source

First commit: package created from http://docs.meteor.com/#/full/writingpackages

Frederic G. MARAND 8 years ago
commit
fc2b5526e3
4 changed files with 80 additions and 0 deletions
  1. 34 0
      README.md
  2. 5 0
      drupal-sso-tests.js
  3. 1 0
      drupal-sso.js
  4. 40 0
      package.js

+ 34 - 0
README.md

@@ -0,0 +1,34 @@
+Drupal SSO
+==========
+
+The Drupal SSO package provides transparent authentication integration with a Drupal instance.
+ 
+
+What does this mean ?
+---------------------
+
+Unlike Meteor, Drupal relies by default on cookie-based authentication. This 
+package makes use of the Drupal session cookie to authenticate the user with the
+Drupal instance having created the cookie.
+
+It enables adding Meteor pages to a Drupal site without having to care for authentication, which
+is carried over from Drupal for each logged-in user.
+
+Pros and cons
+-------------
+
+* Pros
+    * Unlike OAuth-based users Meteor packages, users never see any authentication 
+      request from the backend Drupal instance
+    * The user experience is seamless authentication-wise: users can link from a Drupal page to a Meteor page and vice-versa and their credentials track them
+    * The Drupal instance authorizes the Meteor applications in advance 
+    * A Drupal instance can authorize multiple Meteor applications
+    * Supports Drupal 8 instances
+* Cons
+    * This is a one-off, _ad hoc_ mechanism, not a standards-based approach like
+      OAuth
+    * This package does not (currently) provide integration with the Meteor accounts API
+    * The authentication targets a single Drupal instance for a given application, preventing integration with multiple backends, as a NOC-type dashboard applciation might need
+    * Does not support Drupal 7, BackdropCMS, nor earlier Drupal versions 
+* Double-edged
+    * Login/logout is centralized on Drupal. This is good for Meteor pages as a complement to an existing site, not so much for more decoupled cases. 

+ 5 - 0
drupal-sso-tests.js

@@ -0,0 +1,5 @@
+// Write your tests here!
+// Here is an example.
+Tinytest.add('example', function (test) {
+  test.equal(true, true);
+});

+ 1 - 0
drupal-sso.js

@@ -0,0 +1 @@
+// Write your package code here!

+ 40 - 0
package.js

@@ -0,0 +1,40 @@
+Package.describe({
+  name: 'fgm:drupal-sso',
+  version: '0.0.1',
+  summary: 'A transparent authentication package for Drupal',
+  // git: '',
+  documentation: 'README.md'
+});
+
+Package.onUse(function(api) {
+  // If no version is specified for an 'api.use' dependency, use the one defined in Meteor 0.9.0.
+  api.versionsFrom('1.1.0.3');
+
+  // Need to addFiles() for each file in the package.
+  api.addFiles('drupal-sso.js');
+
+  // This is a reactive source exposing the user session information.
+  api.export('DrupalSession');
+  // This contains the server-only information for the Drupal instance:
+  // - The application token
+  api.export('DrupalServer', 'server');
+
+  //* @var "client", "server", "web.browser", or "web.cordova".
+  // var architecture
+  //   When not specified, component is available everywhere.
+
+  //* @var { weak: Boolean, unordered: Boolean }
+  // var options
+  //   both options default to false.
+
+  // api.use('packagename@version', architecture, options)
+});
+
+Package.onTest(function(api) {
+  api.use('tinytest');
+  api.use('fgm:drupal-sso');
+  api.addFiles('drupal-sso-tests.js');
+});
+
+// Npm.depends({ packageName: "version", ... });
+// Cordova.depends({ packageName: "version", packageName2: "http://packageName2.tar", ... });