omniauth-artsy 0.2.0 → 0.2.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 +4 -4
- data/.rubocop_todo.yml +33 -11
- data/CHANGELOG.md +10 -0
- data/README.md +11 -1
- data/lib/omniauth-artsy.rb +1 -0
- data/lib/omniauth-artsy/config.rb +25 -0
- data/lib/omniauth-artsy/version.rb +1 -1
- data/lib/omniauth/strategies/artsy.rb +1 -1
- data/omniauth-artsy.gemspec +2 -1
- data/spec/lib/config_spec.rb +17 -0
- data/spec/omniauth/strategies/artsy_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -3
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72a0934cb2f200b475f98786ff00b6f6e941e0ea
|
4
|
+
data.tar.gz: 94efa9e5725f75610d36174e15770ed27582c7fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3291407926b8f67989fd079e52e201f0c3d59f94a817a8631788dfc906dfe9ae0b2ed982ed7c1af757e5b4f2bcd1d1909dc5acd146d389d4ef440785109ea58
|
7
|
+
data.tar.gz: baf43adc69c2258fff4a456c9ab27ec25606c283a4f26fc1fa200bccfdba2c310223a6330e8d5f9f0c713dd26b4d5da2d47ad8d6636942b5482ed2557ed5d3b2
|
data/.rubocop_todo.yml
CHANGED
@@ -1,25 +1,47 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
#
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2017-03-31 17:08:47 -0400 using RuboCop version 0.48.0.
|
3
4
|
# The point is for the user to remove these configuration records
|
4
5
|
# one by one as the offenses are removed from the code base.
|
5
6
|
# Note that changes in the inspected code, or installation of new
|
6
7
|
# versions of RuboCop, may require this file to be generated again.
|
7
8
|
|
9
|
+
# Offense count: 2
|
10
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Max: 64
|
13
|
+
|
8
14
|
# Offense count: 8
|
9
|
-
# Configuration parameters: AllowURI.
|
15
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
16
|
+
# URISchemes: http, https
|
10
17
|
Metrics/LineLength:
|
11
18
|
Max: 154
|
12
19
|
|
13
|
-
# Offense count:
|
20
|
+
# Offense count: 3
|
14
21
|
Style/Documentation:
|
15
|
-
|
22
|
+
Exclude:
|
23
|
+
- 'spec/**/*'
|
24
|
+
- 'test/**/*'
|
25
|
+
- 'lib/omniauth-artsy/config.rb'
|
26
|
+
- 'lib/omniauth/strategies/artsy.rb'
|
27
|
+
|
28
|
+
# Offense count: 1
|
29
|
+
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
30
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
31
|
+
Style/FileName:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/omniauth-artsy.rb'
|
16
34
|
|
17
|
-
# Offense count:
|
35
|
+
# Offense count: 1
|
18
36
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
19
|
-
|
20
|
-
|
37
|
+
# SupportedStyles: module_function, extend_self
|
38
|
+
Style/ModuleFunction:
|
39
|
+
Exclude:
|
40
|
+
- 'lib/omniauth-artsy/config.rb'
|
21
41
|
|
22
42
|
# Offense count: 1
|
23
|
-
#
|
24
|
-
|
25
|
-
|
43
|
+
# Cop supports --auto-correct.
|
44
|
+
# Configuration parameters: SupportedStyles.
|
45
|
+
# SupportedStyles: percent, brackets
|
46
|
+
Style/SymbolArray:
|
47
|
+
EnforcedStyle: brackets
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
0.2.2 (Next)
|
2
|
+
============
|
3
|
+
|
4
|
+
* Your contribution here.
|
5
|
+
|
6
|
+
0.2.1
|
7
|
+
============
|
8
|
+
|
9
|
+
* [#6](https://github.com/artsy/omniauth-artsy/pull/6): Add config so we can configure/initialize `OmniAuth::Artsy` - [@ashkan18](https://github.com/ashkan18).
|
10
|
+
|
1
11
|
0.2.0 (5/4/2016)
|
2
12
|
================
|
3
13
|
|
data/README.md
CHANGED
@@ -28,7 +28,17 @@ end
|
|
28
28
|
|
29
29
|
#### Configuration
|
30
30
|
|
31
|
-
|
31
|
+
##### Configure in your app
|
32
|
+
Add `omniauth_artsy.rb` to your `config/initializers` and set `artsy_api_url`.
|
33
|
+
```ruby
|
34
|
+
# config/initializers/omniauth_artsy.rb
|
35
|
+
OmniAuth::Artsy.configure do |config|
|
36
|
+
config.artsy_api_url = ENV['ARTSY_API_URL']
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
##### Using ENV
|
41
|
+
Set `ENV['ARTSY_API_URL']` to the location of the Artsy API, typically *https://api.artsy.net* in production.
|
32
42
|
|
33
43
|
### License
|
34
44
|
|
data/lib/omniauth-artsy.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module OmniAuth
|
2
|
+
module Artsy
|
3
|
+
module Config
|
4
|
+
extend self
|
5
|
+
|
6
|
+
attr_accessor :artsy_api_url
|
7
|
+
|
8
|
+
def reset
|
9
|
+
self.artsy_api_url = nil
|
10
|
+
end
|
11
|
+
|
12
|
+
reset
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def configure
|
17
|
+
block_given? ? yield(Config) : Config
|
18
|
+
end
|
19
|
+
|
20
|
+
def config
|
21
|
+
Config
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -4,7 +4,7 @@ module OmniAuth
|
|
4
4
|
module Strategies
|
5
5
|
class Artsy < OmniAuth::Strategies::OAuth2
|
6
6
|
option :client_options,
|
7
|
-
site: ENV['ARTSY_API_URL'] || ENV['gravity_url']
|
7
|
+
site: OmniAuth::Artsy.config.artsy_api_url || ENV['ARTSY_API_URL'] || ENV['gravity_url'],
|
8
8
|
authorize_url: '/oauth2/authorize?scope=offline_access&response_type=code',
|
9
9
|
token_url: '/oauth2/access_token?scope=offline_access&response_type=code&grant_type=authorization_code'
|
10
10
|
|
data/omniauth-artsy.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
3
4
|
require 'omniauth-artsy/version'
|
4
5
|
|
@@ -21,5 +22,5 @@ Gem::Specification.new do |s|
|
|
21
22
|
s.add_development_dependency 'rake'
|
22
23
|
s.add_development_dependency 'rspec'
|
23
24
|
s.add_development_dependency 'webmock'
|
24
|
-
s.add_development_dependency 'rubocop'
|
25
|
+
s.add_development_dependency 'rubocop'
|
25
26
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OmniAuth::Artsy::Config do
|
4
|
+
describe '#configure' do
|
5
|
+
before do
|
6
|
+
OmniAuth::Artsy.configure do |config|
|
7
|
+
config.artsy_api_url = 'http://localhost:3000/api'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
after do
|
11
|
+
OmniAuth::Artsy.config.reset
|
12
|
+
end
|
13
|
+
it 'sets token' do
|
14
|
+
expect(OmniAuth::Artsy.config.artsy_api_url).to eq 'http://localhost:3000/api'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -22,8 +22,8 @@ describe OmniAuth::Strategies::Artsy do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
describe '#client_options' do
|
25
|
-
it '
|
26
|
-
expect(subject.options.client_options.site).to
|
25
|
+
it 'returns nil for Artsy API URL without setting' do
|
26
|
+
expect(subject.options.client_options.site).to be_nil
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'has correct authorize url' do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-artsy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Fareed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
82
|
+
version: '0'
|
83
83
|
description: 'Omniauth plugin for Artsy authentication. '
|
84
84
|
email:
|
85
85
|
- dylan@artsy.net
|
@@ -98,9 +98,11 @@ files:
|
|
98
98
|
- README.md
|
99
99
|
- Rakefile
|
100
100
|
- lib/omniauth-artsy.rb
|
101
|
+
- lib/omniauth-artsy/config.rb
|
101
102
|
- lib/omniauth-artsy/version.rb
|
102
103
|
- lib/omniauth/strategies/artsy.rb
|
103
104
|
- omniauth-artsy.gemspec
|
105
|
+
- spec/lib/config_spec.rb
|
104
106
|
- spec/omniauth/strategies/artsy_spec.rb
|
105
107
|
- spec/spec_helper.rb
|
106
108
|
homepage: https://github.com/artsy/omniauth-artsy
|
@@ -123,10 +125,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
125
|
version: '0'
|
124
126
|
requirements: []
|
125
127
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.6.11
|
127
129
|
signing_key:
|
128
130
|
specification_version: 4
|
129
131
|
summary: Omniauth plugin for Artsy authentication.
|
130
132
|
test_files:
|
133
|
+
- spec/lib/config_spec.rb
|
131
134
|
- spec/omniauth/strategies/artsy_spec.rb
|
132
135
|
- spec/spec_helper.rb
|