omniauth-nextcloud 0.2.0 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1311dd4e0d9237de153bad4b0396602fb2702c54a22017e389d3609e3917e82a
4
- data.tar.gz: 85117f5dcb02df9439c9072e58c38717e3a1f7e996e8cc4a635c3f2169f0ec6c
3
+ metadata.gz: 762ed8b8bbe3fa1fb7e93aa1e982b31311266f2f0df9fdc563f12b9bf816d9a8
4
+ data.tar.gz: fae79f69152e32557891bc687a28a2dbf6d0d90df01a5c2ca32db5b99791d5df
5
5
  SHA512:
6
- metadata.gz: c786e179a8b614c06598b17095ef4823f12bd5fcdcb8eebbae8e1e007c2b25941d4d082f3af5ac1084a8a23dcb03e4be9151f0deabfdc3f24a1f9316784da252
7
- data.tar.gz: 2dd7ac856c6d88ed85e9c52a95f872febc2da1afb1bc9503c5c219be6d4cd925b92770f04e22c09ff12a6e51e489f0ca1f731eb4e28a6f846f855d6223a0a0e5
6
+ metadata.gz: fcb9f9463912e6dcf9bcd4f83772d71378f5c98a602849be04942def7eba5285bf0560c9ba238accebd89206c11054e6bb417cacdd43d3838e1b26a22191f440
7
+ data.tar.gz: d7e4d38e14850784888a163755c41e98bc132f402e7d33e222974929af9ed40f53223b8d72fc73cc2130987bb747f4cc7089bb9f3df5836e3640858956529407
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.7
3
+ Exclude:
4
+ - 'spec/**/*.rb'
5
+
3
6
 
4
7
  Style/StringLiterals:
5
8
  Enabled: true
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-nextcloud (0.2.0)
4
+ omniauth-nextcloud (0.2.2)
5
5
  omniauth (= 2.0.4)
6
- omniauth-oauth2 (= 1.7.1)
6
+ omniauth-oauth2 (= 1.7.2)
7
7
  rexml (= 3.2.5)
8
8
 
9
9
  GEM
@@ -11,48 +11,32 @@ GEM
11
11
  specs:
12
12
  ast (2.4.2)
13
13
  diff-lcs (1.4.4)
14
- faraday (1.8.0)
15
- faraday-em_http (~> 1.0)
16
- faraday-em_synchrony (~> 1.0)
17
- faraday-excon (~> 1.1)
18
- faraday-httpclient (~> 1.0.1)
19
- faraday-net_http (~> 1.0)
20
- faraday-net_http_persistent (~> 1.1)
21
- faraday-patron (~> 1.0)
22
- faraday-rack (~> 1.0)
23
- multipart-post (>= 1.2, < 3)
14
+ faraday (2.7.1)
15
+ faraday-net_http (>= 2.0, < 3.1)
24
16
  ruby2_keywords (>= 0.0.4)
25
- faraday-em_http (1.0.0)
26
- faraday-em_synchrony (1.0.0)
27
- faraday-excon (1.1.0)
28
- faraday-httpclient (1.0.1)
29
- faraday-net_http (1.0.1)
30
- faraday-net_http_persistent (1.2.0)
31
- faraday-patron (1.0.0)
32
- faraday-rack (1.0.0)
33
- hashie (4.1.0)
34
- jwt (2.3.0)
17
+ faraday-net_http (3.0.2)
18
+ hashie (5.0.0)
19
+ jwt (2.5.0)
35
20
  multi_json (1.15.0)
36
21
  multi_xml (0.6.0)
37
- multipart-post (2.1.1)
38
- oauth2 (1.4.7)
39
- faraday (>= 0.8, < 2.0)
22
+ oauth2 (1.4.11)
23
+ faraday (>= 0.17.3, < 3.0)
40
24
  jwt (>= 1.0, < 3.0)
41
25
  multi_json (~> 1.3)
42
26
  multi_xml (~> 0.5)
43
- rack (>= 1.2, < 3)
27
+ rack (>= 1.2, < 4)
44
28
  omniauth (2.0.4)
45
29
  hashie (>= 3.4.6)
46
30
  rack (>= 1.6.2, < 3)
47
31
  rack-protection
48
- omniauth-oauth2 (1.7.1)
32
+ omniauth-oauth2 (1.7.2)
49
33
  oauth2 (~> 1.4)
50
34
  omniauth (>= 1.9, < 3)
51
35
  parallel (1.21.0)
52
36
  parser (3.0.2.0)
53
37
  ast (~> 2.4.1)
54
- rack (2.2.3)
55
- rack-protection (2.1.0)
38
+ rack (2.2.4)
39
+ rack-protection (3.0.4)
56
40
  rack
57
41
  rainbow (3.0.0)
58
42
  rake (13.0.6)
data/README.md CHANGED
@@ -22,13 +22,10 @@ Or install it yourself as:
22
22
 
23
23
  ### Configuration
24
24
 
25
+ Create a new OAuth2 token in your Nextcloud instance. You can find the option in `Settings > Administration > Security` at the bottom of the page or using the link [https://nc.example.com/index.php/settings/admin/security#oauth2](https://nc.example.com/index.php/settings/admin/security#oauth2) by substituting the hostname.
26
+
25
27
  ```ruby
26
- NEXTCLOUD_URL = 'https://nc.bbz-cfp.ch'
27
- config.omniauth :nextcloud, ENV['NEXTCLOUD_APP_ID'], ENV['NEXTCLOUD_APP_SECRET'], client_options: {
28
- :site => "#{NEXTCLOUD_URL}/index.php/apps/oauth2",
29
- :authorize_url => "#{NEXTCLOUD_URL}/index.php/apps/oauth2/authorize",
30
- :token_url => "#{NEXTCLOUD_URL}/index.php/apps/oauth2/api/v1/token",
31
- }
28
+ config.omniauth :nextcloud, ENV['NEXTCLOUD_APP_ID'], ENV['NEXTCLOUD_APP_SECRET'], site_url: 'https://nc.bbz-cfp.ch'
32
29
  ```
33
30
 
34
31
  ### Rails
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Nextcloud
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -15,14 +15,17 @@ module OmniAuth
15
15
  # initializing your consumer from the OAuth gem.
16
16
  option :client_options, {}
17
17
 
18
- def client
18
+ def merged_client_options
19
19
  overrides = options.client_options
20
- client_options = {
20
+ {
21
21
  site: overrides.site || "#{options.site_url}/index.php/apps/oauth2",
22
22
  authorize_url: overrides.authorize_url || "#{options.site_url}/index.php/apps/oauth2/authorize",
23
23
  token_url: overrides.token_url || "#{options.site_url}/index.php/apps/oauth2/api/v1/token"
24
24
  }
25
- ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(client_options))
25
+ end
26
+
27
+ def client
28
+ ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(merged_client_options))
26
29
  end
27
30
 
28
31
  # You may specify that your strategy should use PKCE by setting
@@ -50,7 +53,7 @@ module OmniAuth
50
53
  end
51
54
 
52
55
  def raw_info
53
- @raw_info ||= Hash.from_xml(access_token.get("/ocs/v2.php/cloud/user").body)
56
+ @raw_info ||= Hash.from_xml(access_token.get("#{options.site_url}/ocs/v2.php/cloud/user").body)
54
57
  end
55
58
  end
56
59
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  # Uncomment to register a new dependency of your gem
31
31
  spec.add_dependency "omniauth", "2.0.4"
32
- spec.add_dependency "omniauth-oauth2", "1.7.1"
32
+ spec.add_dependency "omniauth-oauth2", "1.7.2"
33
33
  spec.add_dependency "rexml", "3.2.5"
34
34
 
35
35
  # For more information and examples about making a new gem, checkout our
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-nextcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-17 00:00:00.000000000 Z
11
+ date: 2022-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.1
33
+ version: 1.7.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.1
40
+ version: 1.7.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rexml
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +84,7 @@ metadata:
84
84
  homepage_uri: https://github.com/code-fabrik/omniauth-nextcloud
85
85
  source_code_uri: https://github.com/code-fabrik/omniauth-nextcloud
86
86
  changelog_uri: https://github.com/code-fabrik/omniauth-nextcloud
87
- post_install_message:
87
+ post_install_message:
88
88
  rdoc_options: []
89
89
  require_paths:
90
90
  - lib
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubygems_version: 3.2.22
103
- signing_key:
103
+ signing_key:
104
104
  specification_version: 4
105
105
  summary: omniauth provider for Nextcloud
106
106
  test_files: []