Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Oct 10, 2011
0 parents commit ba9ef89
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.DS_Store
node_modules
8 changes: 8 additions & 0 deletions .npmignore
@@ -0,0 +1,8 @@
*.md
.DS_Store
.git*
Makefile
docs/
examples/
support/
test/
20 changes: 20 additions & 0 deletions 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 changes: 19 additions & 0 deletions 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 changes: 27 additions & 0 deletions 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 changes: 15 additions & 0 deletions 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 changes: 32 additions & 0 deletions 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 changes: 16 additions & 0 deletions 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.