omniauth-pam 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: af3fd0f82b596952bb68609a7a6a58fff1cdc374
4
+ data.tar.gz: ea13e98427607e8eda92559493577f21fbcb8653
5
+ SHA512:
6
+ metadata.gz: 74fa66c8a34ee8377212413e15c7cdefb3efd74c5408309b623a6df66879e82127c9bd2cbb5dccfe607826f3b9e0508052246b083acc77cea977fcd6f9e352ec
7
+ data.tar.gz: 475d096738a732439c3df8e72dc4acb5d9ccf85583918cd056b91f071dbdc6d3d080b1af67dd04d5b2c0a0b9490d427b8459d28eac78a486ac1fc60440fa74f2
@@ -0,0 +1,15 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure('2') do |config|
5
+ config.vm.hostname = 'omniauth-pam'
6
+ config.vm.box = 'boxes-wheezy64-chef'
7
+ config.vm.box_url = 'http://boxes.nickcharlton.net/wheezy64-chef-virtualbox.box'
8
+
9
+ # forward a port for testing
10
+ config.vm.network "forwarded_port", guest: 5000, host: 8080, auto_correct: true
11
+
12
+ # ensure the basic packages exist to get it all working
13
+ config.vm.provision 'shell', inline: 'sudo apt-get -yqq install git libpam0g-dev;'\
14
+ 'sudo gem install bundler foreman'
15
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'sinatra', '~> 1.3.2', require: 'sinatra/base'
4
+ gem 'omniauth', '~> 1.0.2'
5
+ gem 'omniauth-pam', path: File.join(__FILE__, '../..')
6
+ gem 'unicorn'
@@ -0,0 +1 @@
1
+ web: bundle exec unicorn -p $PORT
@@ -0,0 +1,22 @@
1
+ # omniauth-pam example
2
+
3
+ This is a very simple example to demonstrate how OmniAuth::PAM can be used within a
4
+ primitive [Sinatra][] application.
5
+
6
+ You can start it by doing:
7
+
8
+ ```bash
9
+ [sudo] gem install bundler foreman
10
+ bundle install
11
+ foreman start
12
+ ```
13
+
14
+ Preferably from within the Vagrantfile included in the root of the repository.
15
+
16
+ ## Usage
17
+
18
+ 1. Go to http://localhost:5000
19
+ 2. You'll be redirected to a login page.
20
+ 3. Enter a system user account (for example: vagrant/vagrant).
21
+ 4. Then, you'll be redirected to another page listing the auth hash details.
22
+
@@ -0,0 +1,33 @@
1
+ class App < Sinatra::Base
2
+ use Rack::Session::Cookie
3
+ use OmniAuth::Strategies::PAM
4
+
5
+ helpers do
6
+ def ensure_auth
7
+ unless session[:auth]
8
+ redirect '/auth/pam'
9
+ end
10
+ end
11
+ end
12
+
13
+ get '/' do
14
+ ensure_auth
15
+ end
16
+
17
+ # OmniAuth support
18
+ post '/auth/:name/callback' do
19
+ auth = request.env['omniauth.auth']
20
+ puts auth
21
+
22
+ <<-HTML
23
+ <h1>Authenticated via #{auth[:provider]}.</h1>
24
+
25
+ <ul>
26
+ <li>name: #{auth.info[:name]}</li>
27
+ <li>nickname: #{auth.info[:nickname]}</li>
28
+ <li>email: #{auth.info[:email]}</li>
29
+ <li>uid: #{auth[:uid]}</li>
30
+ </ul>
31
+ HTML
32
+ end
33
+ end
@@ -0,0 +1,6 @@
1
+ require 'bundler'
2
+ Bundler.require
3
+
4
+ require './app'
5
+
6
+ run App
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module PAM
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -3,6 +3,7 @@ module OmniAuth
3
3
  class PAM
4
4
  include OmniAuth::Strategy
5
5
 
6
+ option :name, 'pam'
6
7
  option :fields, [:username]
7
8
  option :uid_field, :username
8
9
 
@@ -47,7 +48,8 @@ module OmniAuth
47
48
  info do
48
49
  {
49
50
  :nickname => uid,
50
- :name => uid
51
+ :name => uid,
52
+ :email => "#{uid}#{ options.has_key?(:email) ? options[:email] : ''}"
51
53
  }.merge!(parse_gecos)
52
54
  end
53
55
  end
metadata CHANGED
@@ -1,108 +1,99 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: omniauth-pam
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 1
8
- - 0
9
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Nick Charlton
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-02-26 00:00:00 +00:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: omniauth
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
25
17
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 0
30
- version: "1.0"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
31
20
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: rpam-ruby19
35
21
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rpam-ruby19
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
38
31
  - - ~>
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 1
42
- - 2
43
- - 1
32
+ - !ruby/object:Gem::Version
44
33
  version: 1.2.1
45
34
  type: :runtime
46
- version_requirements: *id002
47
- - !ruby/object:Gem::Dependency
48
- name: etc
49
35
  prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 1.2.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: etc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
57
48
  type: :runtime
58
- version_requirements: *id003
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
59
55
  description: A PAM strategy for OmniAuth.
60
- email:
56
+ email:
61
57
  - hello@nickcharlton.net
62
58
  executables: []
63
-
64
59
  extensions: []
65
-
66
60
  extra_rdoc_files: []
67
-
68
- files:
61
+ files:
69
62
  - .gitignore
70
63
  - Gemfile
71
64
  - README.md
72
65
  - Rakefile
66
+ - Vagrantfile
67
+ - example/Gemfile
68
+ - example/Procfile
69
+ - example/README.md
70
+ - example/app.rb
71
+ - example/config.ru
73
72
  - lib/omniauth-pam.rb
74
73
  - lib/omniauth-pam/version.rb
75
74
  - lib/omniauth/strategies/pam.rb
76
75
  - omniauth-pam.gemspec
77
- has_rdoc: true
78
76
  homepage: https://github.com/nickcharlton/omniauth-pam
79
77
  licenses: []
80
-
78
+ metadata: {}
81
79
  post_install_message:
82
80
  rdoc_options: []
83
-
84
- require_paths:
81
+ require_paths:
85
82
  - lib
86
- required_ruby_version: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- segments:
91
- - 0
92
- version: "0"
93
- required_rubygems_version: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- segments:
98
- - 0
99
- version: "0"
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
100
93
  requirements: []
101
-
102
94
  rubyforge_project: omniauth-pam
103
- rubygems_version: 1.3.6
95
+ rubygems_version: 2.0.3
104
96
  signing_key:
105
- specification_version: 3
97
+ specification_version: 4
106
98
  summary: A PAM strategy for OmniAuth.
107
99
  test_files: []
108
-