omniauth-wrike 0.1.0
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 +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/README.md +33 -0
- data/lib/omniauth-wrike.rb +2 -0
- data/lib/omniauth-wrike/version.rb +5 -0
- data/lib/omniauth/strategies/wrike.rb +43 -0
- data/omniauth-wrike.gemspec +23 -0
- metadata +65 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e3aa6e8b1cd73dca739b66d821c35c32ef3b9d18
|
|
4
|
+
data.tar.gz: aa95e917288d67c70ec2bda3f22c35404c460313
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9ec81a68cc8e6e91d9bcc869d682b9456ca88cba75ae90190f28dc1ba24ef7efe62271d782855ebce480cf54ffb6aaa28d91c14d16ad7094577b0acc5412d804
|
|
7
|
+
data.tar.gz: 7b47fc7e6845a45797fbf3b0a6531606e15127108fa33f9c9c5179762fe423c3f912a4306ccecd795f95cb5234c9c98fc5a1709150e2a350320be37c829d16db
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Omniauth Wrike OAuth 2
|
|
2
|
+
|
|
3
|
+
OmniAuth OAuth2 Strategy to authenticate [Wrike](https://www.wrike.com).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'omniauth'
|
|
11
|
+
gem 'omniauth-wrike'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Integrate this strategy to your OmniAuth middleware.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
use OmniAuth::Builder do
|
|
18
|
+
provider :wrike, ENV['WRIKE_CLIENT_ID'], ENV['WRIKE_CLIENT_SECRET']
|
|
19
|
+
end
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
To get your Wrike client ID and Secret, you must [request them here](https://developers.wrike.com/getting-started/).
|
|
23
|
+
|
|
24
|
+
[Wrike API 3.0 Documentation](https://developers.wrike.com/documentation/api/overview)
|
|
25
|
+
|
|
26
|
+
## TODO
|
|
27
|
+
|
|
28
|
+
- Tests
|
|
29
|
+
|
|
30
|
+
## Contributing
|
|
31
|
+
|
|
32
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Jpuelpan/omniauth-wrike
|
|
33
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require 'omniauth-oauth2'
|
|
2
|
+
|
|
3
|
+
module OmniAuth
|
|
4
|
+
module Strategies
|
|
5
|
+
class Wrike < OmniAuth::Strategies::OAuth2
|
|
6
|
+
option :name, 'wrike'
|
|
7
|
+
|
|
8
|
+
option :client_options, {
|
|
9
|
+
:site => 'https://www.wrike.com/api/v3',
|
|
10
|
+
:authorize_url => 'https://www.wrike.com/oauth2/authorize',
|
|
11
|
+
:token_url => 'https://www.wrike.com/oauth2/token'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
uid { raw_info['id'] }
|
|
15
|
+
|
|
16
|
+
info do
|
|
17
|
+
{
|
|
18
|
+
'uid' => raw_info['id'],
|
|
19
|
+
'name' => raw_info['name']
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
extra do
|
|
24
|
+
{
|
|
25
|
+
'raw_info' => raw_info,
|
|
26
|
+
'accounts' => accounts
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def raw_info
|
|
31
|
+
@raw_info ||= first_account
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def accounts
|
|
35
|
+
@accounts ||= access_token.get('/accounts').parsed['data']
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def first_account
|
|
39
|
+
@first_account ||= accounts.first
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require File.expand_path('../lib/omniauth-wrike/version', __FILE__)
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.version = OmniAuth::Wrike::VERSION
|
|
8
|
+
spec.name = 'omniauth-wrike'
|
|
9
|
+
spec.authors = ['Juan Puelpan']
|
|
10
|
+
spec.email = ['juan@puelpan.com']
|
|
11
|
+
spec.licenses = ['MIT']
|
|
12
|
+
spec.homepage = 'https://github.com/Jpuelpan/omniauth-wrike'
|
|
13
|
+
|
|
14
|
+
spec.summary = %q{Wrike strategy for Omniauth.}
|
|
15
|
+
spec.description = %q{Wrike strategy for Omniauth.}
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files`.split("\n")
|
|
18
|
+
spec.bindir = 'exe'
|
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
|
+
spec.require_paths = ['lib']
|
|
21
|
+
|
|
22
|
+
spec.add_dependency 'omniauth-oauth2', '~> 1.4'
|
|
23
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: omniauth-wrike
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Juan Puelpan
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: omniauth-oauth2
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.4'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.4'
|
|
27
|
+
description: Wrike strategy for Omniauth.
|
|
28
|
+
email:
|
|
29
|
+
- juan@puelpan.com
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- ".gitignore"
|
|
35
|
+
- Gemfile
|
|
36
|
+
- README.md
|
|
37
|
+
- lib/omniauth-wrike.rb
|
|
38
|
+
- lib/omniauth-wrike/version.rb
|
|
39
|
+
- lib/omniauth/strategies/wrike.rb
|
|
40
|
+
- omniauth-wrike.gemspec
|
|
41
|
+
homepage: https://github.com/Jpuelpan/omniauth-wrike
|
|
42
|
+
licenses:
|
|
43
|
+
- MIT
|
|
44
|
+
metadata: {}
|
|
45
|
+
post_install_message:
|
|
46
|
+
rdoc_options: []
|
|
47
|
+
require_paths:
|
|
48
|
+
- lib
|
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
- - ">="
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '0'
|
|
59
|
+
requirements: []
|
|
60
|
+
rubyforge_project:
|
|
61
|
+
rubygems_version: 2.5.1
|
|
62
|
+
signing_key:
|
|
63
|
+
specification_version: 4
|
|
64
|
+
summary: Wrike strategy for Omniauth.
|
|
65
|
+
test_files: []
|