omniauth-soundcloud2 1.0.0 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f98fb76717174c57aba29869a0c66343e926de7f068afb622dbe8983d9a5233
4
- data.tar.gz: '0991c9b13d02d8ec9f5374e6f131b6c4b22ccd546c390c91cad8c42c4b94e441'
3
+ metadata.gz: 7d138708a43feb70e82f00238fdf9bf3cd05f521abb1c6b0166989743ccda5eb
4
+ data.tar.gz: 05f3a049f2f354b0371ea587071cddcd84c0c5b79a8a1aa329d015eb23de2403
5
5
  SHA512:
6
- metadata.gz: b86712bb55610ab72d4be226399e23bc58013956a4925f02a69120bd234b13732e50bfddc20bb77a9e8c2721be4bfe12cf553bb004070be935ffa25d21cac836
7
- data.tar.gz: 8849688b39e1a24889244bfa95d1ba538171600599e9675e765ccfdc49f5f1692a665075348e368be366799ea135797cb7216501891a8528a286dc6a97060684
6
+ metadata.gz: b48a57ad3766aa5b72a437721235d1b4711f0da7a9a740e12303de441804a19734299d0b4461756fcf5ca8967d593c6d004cfb62cad29605580f61be3ad86e6b
7
+ data.tar.gz: b5e815b0599cc0b7957fe0b146e46bf51885873df09131b0271f36e8062efe117bd5b456ab566176b41b902e38ffdda60efe9318cdb1a7e9d19d98c86138e7b3
data/README.md CHANGED
@@ -31,7 +31,16 @@ Rails.application.config.middleware.use OmniAuth::Builder do
31
31
  end
32
32
  ```
33
33
 
34
- You can optionally pass `scope` and `display` in the request query.
34
+ ## Provider App Setup
35
+
36
+ - SoundCloud apps: <https://soundcloud.com/you/apps>
37
+ - OAuth guide: <https://developers.soundcloud.com/docs/api/guide#authentication>
38
+ - Register callback URL (example): `https://your-app.example.com/auth/soundcloud/callback`
39
+
40
+ ## Options
41
+
42
+ - `scope` (default: `non-expiring`)
43
+ - `display`
35
44
 
36
45
  ## Auth Hash
37
46
 
@@ -52,7 +61,8 @@ Example payload from `request.env['omniauth.auth']` (realistic shape, anonymized
52
61
  "token": "eyJ...redacted...xYxvrQ",
53
62
  "refresh_token": "A1B2C3D4E5F6",
54
63
  "expires_at": 1772691847,
55
- "expires": true
64
+ "expires": true,
65
+ "scope": "non-expiring"
56
66
  },
57
67
  "extra": {
58
68
  "raw_info": {
@@ -121,6 +131,12 @@ RAILS_VERSION='~> 8.1.0' bundle install
121
131
  RAILS_VERSION='~> 8.1.0' bundle exec rake test_rails_integration
122
132
  ```
123
133
 
134
+ ## Test Structure
135
+
136
+ - `test/omniauth_soundcloud_test.rb`: strategy/unit behavior
137
+ - `test/rails_integration_test.rb`: full Rack/Rails request+callback flow
138
+ - `test/test_helper.rb`: shared test bootstrap
139
+
124
140
  ## Compatibility
125
141
 
126
142
  - Ruby: `>= 3.2` (tested on `3.2`, `3.3`, `3.4`, `4.0`)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Soundcloud2
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
7
7
  end
@@ -39,6 +39,16 @@ module OmniAuth
39
39
  }.compact
40
40
  end
41
41
 
42
+ credentials do
43
+ {
44
+ 'token' => access_token.token,
45
+ 'refresh_token' => access_token.refresh_token,
46
+ 'expires_at' => access_token.expires_at,
47
+ 'expires' => access_token.expires?,
48
+ 'scope' => token_scope
49
+ }.compact
50
+ end
51
+
42
52
  extra do
43
53
  {
44
54
  'raw_info' => raw_info
@@ -63,6 +73,11 @@ module OmniAuth
63
73
 
64
74
  private
65
75
 
76
+ def token_scope
77
+ token_params = access_token.respond_to?(:params) ? access_token.params : {}
78
+ token_params['scope'] || (access_token['scope'] if access_token.respond_to?(:[]))
79
+ end
80
+
66
81
  def urls
67
82
  data = {
68
83
  SoundCloud: raw_info['permalink_url'],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-soundcloud2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli