Skip to content
Browse files

First commit.

  • Loading branch information...
0 parents commit ba9ef897078f0d4b917b059d242b3cd454d684b6 @jaredhanson committed Oct 9, 2011
Showing with 139 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +8 −0 .npmignore
  3. +20 −0 LICENSE
  4. +19 −0 Makefile
  5. +27 −0 README.md
  6. +15 −0 lib/passport-twitter/index.js
  7. +32 −0 lib/passport-twitter/strategy.js
  8. +16 −0 package.json
2 .gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules
8 .npmignore
@@ -0,0 +1,8 @@
+*.md
+.DS_Store
+.git*
+Makefile
+docs/
+examples/
+support/
+test/
20 LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2011 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 Makefile
@@ -0,0 +1,19 @@
+NODE = node
+TEST = vows
+TESTS ?= test/*-test.js test/**/*-test.js
+
+test:
+ @NODE_ENV=test NODE_PATH=lib $(TEST) $(TEST_FLAGS) $(TESTS)
+
+docs: docs/api.html
+
+docs/api.html: lib/passport-twitter/*.js
+ dox \
+ --title Passport-Twitter \
+ --desc "Twitter authentication strategy for Passport" \
+ $(shell find lib/passport-twitter/* -type f) > $@
+
+docclean:
+ rm -f docs/*.{1,html}
+
+.PHONY: test docs docclean
27 README.md
@@ -0,0 +1,27 @@
+# Passport-OAuth
+
+[Passport](https://github.com/jaredhanson/passport) strategy for authenticating
+with Twitter using the OAuth 1.0a API.
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 lib/passport-twitter/index.js
@@ -0,0 +1,15 @@
+/**
+ * Module dependencies.
+ */
+var Strategy = require('./strategy');
+
+
+/**
+ * Framework version.
+ */
+exports.version = '0.1.0';
+
+/**
+ * Expose constructors.
+ */
+exports.Strategy = Strategy;
32 lib/passport-twitter/strategy.js
@@ -0,0 +1,32 @@
+/**
+ * Module dependencies.
+ */
+var util = require('util')
+ , OAuthStrategy = require("passport-oauth").OAuthStrategy;
+
+
+/**
+ * `Strategy` constructor.
+ *
+ * @api public
+ */
+function Strategy(options, validate) {
+ options = options || {};
+ options.requestTokenURL = options.requestTokenURL || 'https://twitter.com/oauth/request_token';
+ options.accessTokenURL = options.accessTokenURL || 'https://twitter.com/oauth/access_token';
+ options.userAuthorizationURL = options.userAuthorizationURL || 'https://twitter.com/oauth/authenticate';
+
+ OAuthStrategy.call(this, options, validate);
+ this.name = 'twitter';
+}
+
+/**
+ * Inherit from `OAuthStrategy`.
+ */
+util.inherits(Strategy, OAuthStrategy);
+
+
+/**
+ * Expose `Strategy`.
+ */
+module.exports = Strategy;
16 package.json
@@ -0,0 +1,16 @@
+{
+ "name": "passport-twitter",
+ "version": "0.1.0",
+ "description": "Twitter authentication strategy for Passport.",
+ "author": "Jared Hanson <jaredhanson@gmail.com> (http://www.jaredhanson.net/)",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/jaredhanson/passport-twitter.git"
+ },
+ "main": "./lib/passport-twitter",
+ "dependencies": {
+ "passport-oauth": ">= 0.0.1"
+ },
+ "engines": { "node": ">= 0.4.0" },
+ "keywords": ["passport", "twitter", "auth", "authn", "authentication"]
+}

0 comments on commit ba9ef89

Please sign in to comment.
Something went wrong with that request. Please try again.