omniauth-teamleader 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 27308cee9dbc7b3dac3e1f809febd79efec7ff8f
4
+ data.tar.gz: 6ab9fb37823f71b14932cbf1bb8d147dcd1b124b
5
+ SHA512:
6
+ metadata.gz: 3cb6bca8b668d9a6c81a1352d6ab476f2d2d0a596e7aa630ca8e371955625dbe47e16c7a5315fae224417223a515a98ef080f412eb914bf93930cb5ee0dae531
7
+ data.tar.gz: 667cd25e3b1a600b684f7e59042ffdc3a3d922b69c992dc83e00bc4626090755235cefe9e09c850b73f9fdd89e4bfefdd28b42c6f13c5571fb04fd0c14dc2f70
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-nimble.gemspec
4
+ gemspec
@@ -0,0 +1,5 @@
1
+ Copyright 2018 Slaask
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+ not use this file except in compliance with the License. You may obtain
5
+ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -0,0 +1,25 @@
1
+ # Omniauth::Teamleader
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'omniauth-teamleader'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install omniauth-teamleader
18
+
19
+ ## Usage
20
+
21
+ **Basic Usage**
22
+
23
+ use OmniAuth::Builder do
24
+ provider :teamleader, ENV['TEAMLEADER_KEY'], ENV['TEAMLEADER_SECRET']
25
+ end
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ require "omniauth-teamleader/version"
2
+ require 'omniauth/strategies/teamleader'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Teamleader
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1,46 @@
1
+ # Copyright 2018 Slaask
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+ # not use this file except in compliance with the License. You may obtain
5
+ # a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ require 'omniauth-oauth2'
8
+
9
+ module OmniAuth
10
+ module Strategies
11
+ class Teamleader < OmniAuth::Strategies::OAuth2
12
+ option :name, 'teamleader'
13
+
14
+ option :client_options, {
15
+ :site => 'https://app.teamleader.eu',
16
+ :authorize_url => '/oauth2/authorize',
17
+ :token_url => '/oauth2/access_token'
18
+ }
19
+
20
+ option :provider_ignores_state, true
21
+
22
+ uid { raw_info['id'] }
23
+
24
+ info do
25
+ {
26
+ 'uid' => raw_info['id'],
27
+ 'first_name' => raw_info['first_name'],
28
+ 'last_name' => raw_info['last_name'],
29
+ 'email' => raw_info['email'],
30
+ 'language' => raw_info['language'],
31
+ 'time_zone' => raw_info['time_zone']
32
+ }
33
+ end
34
+
35
+ extra do
36
+ { 'raw_info' => raw_info }
37
+ end
38
+
39
+ def raw_info
40
+ @raw_info ||= access_token.get('https://api.teamleader.eu/users.me', {:parse => :json}).parsed['data']
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ OmniAuth.config.add_camelization 'teamleader', 'Teamleader'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth-teamleader/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "omniauth-teamleader"
8
+ gem.version = Omniauth::Teamleader::VERSION
9
+ gem.authors = ["Rémi Delhaye"]
10
+ gem.email = ["remi@slaask.com"]
11
+ gem.description = %q{OAuth2 strategy to use with Teamleader API}
12
+ gem.summary = %q{OAuth2 strategy to use with Teamleader API}
13
+ gem.homepage = "https://github.com/slaaskhq/omniauth-teamleader"
14
+
15
+ gem.add_dependency 'omniauth', '~> 1.0'
16
+ gem.add_dependency 'omniauth-oauth2', '~> 1.1'
17
+
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
+ gem.require_paths = ["lib"]
22
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-teamleader
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Rémi Delhaye
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-27 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.0'
20
+ type: :runtime
21
+ prerelease: false
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: omniauth-oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ description: OAuth2 strategy to use with Teamleader API
42
+ email:
43
+ - remi@slaask.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/omniauth-teamleader.rb
54
+ - lib/omniauth-teamleader/version.rb
55
+ - lib/omniauth/strategies/teamleader.rb
56
+ - omniauth-teamleader.gemspec
57
+ homepage: https://github.com/slaaskhq/omniauth-teamleader
58
+ licenses: []
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.6.13
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: OAuth2 strategy to use with Teamleader API
80
+ test_files: []