omniauth-toodledo-oauth2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f6abe455e3ef52dc303de7f46548b59f1141253
4
+ data.tar.gz: 24d8a15f041b16da881ad7a4367819b8a8698ea7
5
+ SHA512:
6
+ metadata.gz: ef0d8ec61a7b219deca4d55dc1bb317056d1d888b520a7122acf7a89d3bff6feab43e22565693e2933ea6c006fac885d5a826a735276586d888ab969ed8264b6
7
+ data.tar.gz: 72d3198af87a76f1d5a0abd03fbd7d07376f560c579768a1c7922ce37d292e39fac93375e2908f4e129046a582a23f1502a5bf8ea6059fc35ddca49e08e891d3
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in omniauth-toodledo-oauth2.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Omniauth::Toodledo::Oauth2
2
+
3
+ An unofficial Omniauth OAuth2 strategy for Toodledo. Authentication flow based on [api.toodledo.com](https://api.toodledo.com/3/account/index.php).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'omniauth-toodledo-oauth2'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install omniauth-toodledo-oauth2
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Mailbutler/omniauth-toodledo-oauth2.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "omniauth/toodledo_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 ADDED
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/toodledo_oauth2'
Binary file
@@ -0,0 +1,42 @@
1
+ require 'omniauth/strategies/oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class ToodledoOauth2 < OmniAuth::Strategies::OAuth2
6
+
7
+ option :name, 'toodledo_oauth2'
8
+
9
+ option :client_options, {
10
+ site: "https://api.toodledo.com/",
11
+ authorize_url: "https://api.toodledo.com/3/account/authorize.php",
12
+ token_url: "https://api.toodledo.com/3/account/token.php"
13
+ }
14
+
15
+ uid { raw_info["id"] }
16
+
17
+ info do
18
+ # raw_info.merge(token: access_token.token)
19
+ {
20
+ name: raw_info['alias'],
21
+ email: raw_info['email']
22
+ }
23
+ end
24
+
25
+ extra do
26
+ { raw_info: raw_info }
27
+ end
28
+
29
+ def raw_info
30
+ @raw_info ||= access_token.get('https://api.toodledo.com/3/account/get.php').parsed
31
+ end
32
+
33
+ def request_phase
34
+ super
35
+ end
36
+
37
+ def callback_phase
38
+ super
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/strategies/toodledo_oauth2'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module ToodledoOauth2
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "omniauth/toodledo_oauth2/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "omniauth-toodledo-oauth2"
7
+ spec.version = Omniauth::ToodledoOauth2::VERSION
8
+ spec.authors = ["Honey Go"]
9
+ spec.email = ["honelyn@mailbutler.io"]
10
+
11
+ spec.summary = %q{ Omniauth strategy for Toodledo }
12
+ spec.description = %q{ Omniauth strategy for Toodledo. This allows you to authenticate to Toodledo from your ruby app. }
13
+ spec.homepage = 'https://github.com/Mailbutler/omniauth-toodledo-oauth2'
14
+ spec.license = 'MIT'
15
+
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata["allowed_push_host"] = 'https://rubygems.org'
18
+ else
19
+ raise "RubyGems 2.0 or newer is required to protect against " \
20
+ "public gem pushes."
21
+ end
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.required_ruby_version = '>= 2.1'
33
+ spec.add_runtime_dependency 'omniauth', '~> 1.1', '>= 1.1.1'
34
+ spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.3', '>= 1.3.1'
35
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-toodledo-oauth2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Honey Go
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.1.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.1'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.1.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: omniauth-oauth2
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.3'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.3.1
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.3'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.3.1
53
+ description: " Omniauth strategy for Toodledo. This allows you to authenticate to
54
+ Toodledo from your ruby app. "
55
+ email:
56
+ - honelyn@mailbutler.io
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - Gemfile
63
+ - README.md
64
+ - Rakefile
65
+ - bin/console
66
+ - bin/setup
67
+ - lib/omniauth-toodledo-oauth2.rb
68
+ - lib/omniauth/.DS_Store
69
+ - lib/omniauth/strategies/toodledo_oauth2.rb
70
+ - lib/omniauth/toodledo_oauth2.rb
71
+ - lib/omniauth/toodledo_oauth2/.DS_Store
72
+ - lib/omniauth/toodledo_oauth2/version.rb
73
+ - omniauth-toodledo-oauth2.gemspec
74
+ homepage: https://github.com/Mailbutler/omniauth-toodledo-oauth2
75
+ licenses:
76
+ - MIT
77
+ metadata:
78
+ allowed_push_host: https://rubygems.org
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '2.1'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.6.14
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Omniauth strategy for Toodledo
99
+ test_files: []