Browse Source

Documented service-configuration.

Frederic G. MARAND 8 years ago
parent
commit
eb760a3d1d
5 changed files with 77 additions and 24 deletions
  1. 1 2
      .meteor/packages
  2. 0 6
      .meteor/versions
  3. 14 16
      docs/accounts-base/README.md
  4. 53 0
      docs/service-configuration/README.md
  5. 9 0
      server/admin.js

+ 1 - 2
.meteor/packages

@@ -16,8 +16,7 @@ standard-minifiers      # JS/CSS minifiers run for production mode
 es5-shim                # ECMAScript 5 compatibility for older browsers.
 ecmascript              # Enable ECMAScript2015+ syntax in app code
 
-insecure                # Allow all DB writes from clients (for prototyping)
 accounts-ui
 check
+service-configuration
 autopublish
-accounts-facebook

+ 0 - 6
.meteor/versions

@@ -1,6 +1,4 @@
 accounts-base@1.2.2
-accounts-facebook@1.0.6
-accounts-oauth@1.1.8
 accounts-ui@1.1.6
 accounts-ui-unstyled@1.1.8
 autopublish@1.0.4
@@ -28,7 +26,6 @@ ecmascript@0.1.6
 ecmascript-runtime@0.2.6
 ejson@1.0.7
 es5-shim@4.1.14
-facebook@1.2.2
 fastclick@1.0.7
 geojson-utils@1.0.4
 hot-code-push@1.0.0
@@ -36,7 +33,6 @@ html-tools@1.0.5
 htmljs@1.0.5
 http@1.1.1
 id-map@1.0.4
-insecure@1.0.4
 jquery@1.11.4
 launch-screen@1.0.4
 less@2.5.1
@@ -52,8 +48,6 @@ mobile-status-bar@1.0.6
 mongo@1.1.3
 mongo-id@1.0.1
 npm-mongo@1.4.39_1
-oauth@1.1.6
-oauth2@1.1.5
 observe-sequence@1.0.7
 ordered-dict@1.0.4
 promise@0.5.1

File diff suppressed because it is too large
+ 14 - 16
docs/accounts-base/README.md


+ 53 - 0
docs/service-configuration/README.md

@@ -0,0 +1,53 @@
+# service-configuration package
+
+## Files documented
+
+* `service_configuration_common.js`: defines the collection publish and a `ServiceConfiguration.ConfigError` error class.
+* `service_configuration_server.hs`: ensures the index on the service collection.
+
+## Architecture
+
+This package just provides access to a configuration collection in `ServiceConfiguration.configurations`. Packages using the configuration are expected to use Mongo queries on that collection, find-ing using `{ service: service_name }`.
+
+All properties of that collection are published client-side, except `secret` which is only available server-side.
+
+## Collections
+
+* `meteor_accounts_loginServiceConfiguration`
+    * Index: `{ "service": 1 }, { unique: true }`
+
+The service-configuration package persists configuration in the `meteor_accounts_loginServiceConfiguration` collection in MongoDB. As each service should have exactly one configuration, Meteor automatically creates a MongoDB index with a unique constraint on the `meteor_accounts_loginServiceConfiguration` collection.
+
+## Constants
+
+None
+
+## Classes
+
+None
+
+## Functions
+
+None
+
+## Dependencies / Exports (`package.js` _et al._)
+### Exports
+
+| Symbol                | Client | Server | Test |
+|----------------------|:------:|:------:|:----:|
+| ServiceConfiguration | O      | O      | O    |
+
+Silently used (without a declared dependency) in `accounts-base`.
+
+### Dependencies
+
+* uses `accounts-base`
+* uses `mongo`
+
+## Package-local variables
+
+* None
+
+## Side-effects
+
+* Ensures the index on the service configuration collection upon launch.

+ 9 - 0
server/admin.js

@@ -38,3 +38,12 @@ Accounts.registerLoginHandler("adminHandler", function (loginRequest) {
     roles: ['authenticated user', 'administrator']
     }, {});
 });
+
+Accounts.addAutopublishFields({
+  // publish all fields including access token, which can legitimately
+  // be used from the client (if transmitted over ssl or on
+  // localhost). https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/,
+  // "Sharing of Access Tokens"
+  forLoggedInUser: ["services.drupal"],
+  forOtherUsers: ["services.drupal.id", "services.drupal.roles"]
+});

Some files were not shown because too many files changed in this diff