omniauth-smaregi 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43e7bb3c3c40fa9f2719a2238d1ed05c58f3a5660cd6055585e1307f0b26c349
4
- data.tar.gz: e8c8ef6a0150492348ff2ee4f84c8160f453b1272fd81b6bbc0f6350455c5eb3
3
+ metadata.gz: 7861ddad70f884e802c1b783735fc4aa90371395cef23e27bfc053ed363de5dc
4
+ data.tar.gz: a64848d32a57d603d3f33df7de454827873ea575387bcb5fa2a17272eb383447
5
5
  SHA512:
6
- metadata.gz: c3d042a3ff1b855975c0d9489ecd1750805234335505cd3d945f42a903b9c0eb788f8720b481a52bf916863f78b4c5a9d52fa8be6eb2220949693cd3d00d0c98
7
- data.tar.gz: c80bd210fa29366aa7bdb565f5ff3a3968cea9048a395ff6c37d2bc5311873213892ad023b9863a02cce4b0838208c8b3e10118bf76c59137f423608db8c19f4
6
+ metadata.gz: 89223754f0080b62a1c50954d83b6bd9dad144fe5d54bb54cd83bad9e4cc63b7f898911c443d94a82e5bb8db6832fa52f51872122628885c498d3af38ebe691b
7
+ data.tar.gz: 1e93ce2b8ef6a9e4c496fa89d4ea9688b636e0d6569162575bf7aafca436938723cff9e2d2cab76cae92c54c824fe6f41ac89f205bf5e5266a430b7e628154ef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.0] - 2021-11-10
4
+ - add sanbox option
5
+
3
6
  ## [0.1.1] - 2021-10-29
4
7
  - fix undefined local variable verifier
5
8
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Smaregi
5
- VERSION = "0.1.1"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
@@ -5,16 +5,21 @@ require "omniauth-oauth2"
5
5
  module OmniAuth
6
6
  module Strategies
7
7
  class Smaregi < OmniAuth::Strategies::OAuth2
8
+ SANDBOX_SITE = "https://id.smaregi.dev"
9
+ SANDBOX_AUTHORIZE_URL = "https://id.smaregi.dev/authorize"
10
+ SANDBOX_TOKEN_URL = "https://id.smaregi.dev/authorize/token"
8
11
  option :name, "smaregi"
9
12
 
10
13
  option :client_options, {
11
- site: "https://id.smaregi.dev",
12
- authorize_url: "https://id.smaregi.dev/authorize",
13
- token_url: "https://id.smaregi.dev/authorize/token"
14
+ site: "https://id.smaregi.jp",
15
+ authorize_url: "https://id.smaregi.jp/authorize",
16
+ token_url: "https://id.smaregi.jp/authorize/token"
14
17
  }
15
18
 
16
19
  option :authorize_options, [:scope]
17
20
 
21
+ option :sandbox, false
22
+
18
23
  uid { raw_info["contract"]["id"] }
19
24
 
20
25
  info { raw_info }
@@ -27,6 +32,15 @@ module OmniAuth
27
32
  full_host + script_name + callback_path
28
33
  end
29
34
 
35
+ def setup_phase
36
+ if options.sandbox
37
+ options.client_options[:site] = SANDBOX_SITE
38
+ options.client_options[:authorize_url] = SANDBOX_AUTHORIZE_URL
39
+ options.client_options[:token_url] = SANDBOX_TOKEN_URL
40
+ end
41
+ super
42
+ end
43
+
30
44
  def build_access_token
31
45
  client.auth_code.get_token(
32
46
  request.params["code"],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-smaregi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ntakanashi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-29 00:00:00.000000000 Z
11
+ date: 2021-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2