omniauth-backstage 0.0.1 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9df104def5c10cbbbdc3e2c63fbf5c49259e53d8
4
- data.tar.gz: ca386cab89dd903c77faf55abec828ca12bafdb4
3
+ metadata.gz: f6946109cd68bc9223dd97a54f665f5478528619
4
+ data.tar.gz: 727935ea4a3a82f6a6d9e73cfe05c29e24d42d16
5
5
  SHA512:
6
- metadata.gz: be5baccfd1147e73fe934ae6e5f6e6c17effeec0ede8264b7b24f09acb664ba49e4195d989753611fb5ce54f9dd08fba1fe169907e6c9ea5c590362db02852ad
7
- data.tar.gz: 9ea870c390ae43e58803fe5c797ad2016e7c998a2f4ef12bbc57b7c22c0ac9c7d0ef30d329182722e8aa4f02c7ec3257957be469a36a15e29afc2bf44ecc4283
6
+ metadata.gz: 1efac4a3d6997a402cf1087fa3bac0df9eab9818039521c51942357ea3ccbd979246fdf24a84fd84dcbae431262feb29d0c351323ad38258ea954bb1640358f9
7
+ data.tar.gz: 12158a904db13767f57baa1cb9feb1dba9c65639c4443ba78109a03150c3e8f4d423484c9a7d9c500c7ff9ab376d239dbc2a4870a8eff13c2d9a156d0362ece6
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -5,7 +5,7 @@ This is the OmniAuth strategy for authenticating to [Backstage](https://github.c
5
5
  ## Usage
6
6
 
7
7
  ```ruby
8
- use OmniAuth::Builder do
8
+ Rails.application.config.middleware.use OmniAuth::Builder do
9
9
  provider :backstage, ENV['BACKSTAGE_CLIENT_ID'], ENV['BACKSTAGE_CLIENT_SECRET'], { site: ENV['BACKSTAGE_SITE'], authorize_url: ENV['BACKSTAGE_AUTHORIZE_URL'], token_url: ENV['BACKSTAGE_TOKEN_URL'] }
10
10
  end
11
11
  ```
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Backstage
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require 'omniauth-oauth2'
2
2
  require "omniauth/backstage/client"
3
+ require 'base64'
3
4
 
4
5
  module OmniAuth
5
6
  module Strategies
@@ -32,6 +33,16 @@ module OmniAuth
32
33
  payload = access_token.get('me').parsed
33
34
  @raw_info ||= payload[:user]
34
35
  end
36
+
37
+ def build_access_token
38
+ options.token_params.merge!(:headers => {'Authorization' => basic_auth_header })
39
+ super
40
+ end
41
+
42
+ private
43
+ def basic_auth_header
44
+ "Basic " + Base64.strict_encode64("#{options[:client_id]}:#{options[:client_secret]}")
45
+ end
35
46
  end
36
47
  end
37
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-backstage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Leal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-01 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - Gemfile
120
+ - LICENSE
120
121
  - README.md
121
122
  - Rakefile
122
123
  - lib/omniauth-backstage.rb