simple-oauth2 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6718fc68ed99fe811d8d5ca0d4ce6f2dc1139bf0
4
- data.tar.gz: b3ef8352517d8940d5bb7bb66c1c63afdcae8ca9
3
+ metadata.gz: ef184588478b46fd4e334b78fa141a3b7a540703
4
+ data.tar.gz: 579123b59a3b7fa1c56fee46c3eb7dd2325e694b
5
5
  SHA512:
6
- metadata.gz: 3d9a3bc52d3274487fa233523b9e5619d826bf5168d99ece462e789030afccd655fb907cb401361ab9a39a9a661db89606dff4829e4ea07c8f476c3e1e15d8cc
7
- data.tar.gz: 73b3755a18361ccbe9ef1d46919b67c46ba2fcb4bac5cf3f2f6bf1556f765be4db5dc6abf00730b02a1c00f2e28403d24642a9b0e8428acbcb42181da2fe3bb3
6
+ metadata.gz: 787dd620b5f76f8e787a647ceb9d00a2208630e00a919c63f12891c982cd21428298e2d46e9e8511aaea6b90f29603f4456f8afd7cba2e92dcd6ff19ead91cab
7
+ data.tar.gz: 00a0cf3e24f5365a9602fc9486d0646ce990ad407c5297136d09ec0f0ef9cc74feb23397c93038e67f2cad3c5907e6d6c4f51a6d67d08e1a9f8cbc8656aea7ef
@@ -1,4 +1,3 @@
1
- require "simple/oauth2/version"
2
1
  require "faraday"
3
2
  require "addressable/template"
4
3
  require "addressable/uri"
@@ -35,7 +34,6 @@ module Simple
35
34
  end
36
35
 
37
36
  # Returns a new access token.
38
- # Returns reply { access_token, expires_in }
39
37
  def new_access_token
40
38
  params = Addressable::URI.new
41
39
  params.query_values = {
@@ -56,7 +54,6 @@ module Simple
56
54
  end
57
55
 
58
56
  # Exchanges a verification code for an access token.
59
- # Returns reply { access_token, expires_in }
60
57
  def exchange_for_access_token(code)
61
58
  params = Addressable::URI.new
62
59
  params.query_values = {
@@ -75,6 +72,17 @@ module Simple
75
72
  expires_in: response['expires_in']
76
73
  }
77
74
  end
75
+
76
+ # Returns redirect url.
77
+ def redirect_url
78
+ params = Addressable::URI.new
79
+ params.query_values = {
80
+ type: 'web_server',
81
+ client_id: @client_id,
82
+ redirect_uri: @redirect_uri,
83
+ }
84
+ "#{@base_uri}#{@auth_endpoint}?#{params.query}"
85
+ end
78
86
  end
79
87
  end
80
88
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch Stewart
@@ -107,18 +107,7 @@ executables: []
107
107
  extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
- - ".gitignore"
111
- - ".rspec"
112
- - ".travis.yml"
113
- - Gemfile
114
- - LICENSE.txt
115
- - README.md
116
- - Rakefile
117
- - bin/console
118
- - bin/setup
119
- - lib/simple/oauth2.rb
120
- - lib/simple/oauth2/version.rb
121
- - simple-oauth2.gemspec
110
+ - lib/simple-oauth2.rb
122
111
  homepage: https://github.com/mitchstewart/simple-oauth2
123
112
  licenses:
124
113
  - MIT
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.14.6
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in simple-oauth2.gemspec
4
- gemspec
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Mitch Stewart
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,41 +0,0 @@
1
- # Simple::Oauth2
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/simple/oauth2`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'simple-oauth2'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install simple-oauth2
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/simple-oauth2.
36
-
37
-
38
- ## License
39
-
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "simple/oauth2"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,5 +0,0 @@
1
- module Simple
2
- module Oauth2
3
- VERSION = "0.1.0"
4
- end
5
- end
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'simple/oauth2/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "simple-oauth2"
8
- spec.version = Simple::Oauth2::VERSION
9
- spec.authors = ["Mitch Stewart"]
10
- spec.email = ["mitch.stewart.io@gmail.com"]
11
-
12
- spec.summary = %q{A simple oauth2 client.}
13
- spec.description = %q{No fuss, weird stuff, or oddities. Just an oauth2 client.}
14
- spec.homepage = "https://github.com/mitchstewart/simple-oauth2"
15
- spec.license = "MIT"
16
-
17
- if spec.respond_to?(:metadata)
18
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
19
- else
20
- raise "RubyGems 2.0 or newer is required to protect against " \
21
- "public gem pushes."
22
- end
23
-
24
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
- f.match(%r{^(test|spec|features)/})
26
- end
27
- spec.bindir = "exe"
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_development_dependency "bundler", "~> 1.14"
32
- spec.add_development_dependency "rake", "~> 10.0"
33
- spec.add_development_dependency "rspec", "~> 3.0"
34
- spec.add_development_dependency "pry"
35
- spec.add_development_dependency "faraday", "~> 0.9.2"
36
- spec.add_development_dependency 'addressable', '~> 2.5', '>= 2.5.1'
37
- end