omniauth-notion 0.0.2 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cda4c0f8b266a70db2d2e46d543fbcc9ec9c2fc4ce5bf84a5af5d4f7e076bda7
4
- data.tar.gz: ef501a338060cc59de200956c539b6cf2e685511ad45d3cc86ac7b3e661255b4
3
+ metadata.gz: 579f1477594f5da4b893863e4b99498a479cce10442497b8b4683e06fa7d07fe
4
+ data.tar.gz: 367e3db9ad9281a31911a88d40daddb8f17c986707f96724470dfe89ceb33235
5
5
  SHA512:
6
- metadata.gz: 220eb10e5ffc947209f84c3dfbf809fc9761a0f4d9359cbad8889247941f564a652458eed3316100a2be3607da2b902f52acdcbe5d21ccac89740be73c1aebc1
7
- data.tar.gz: c45865f7f27de90bed1027cb68b4f85c00b975a7cd7a4447f238bf7f76f31e6656afb2e4f1aa3ae5e0979b5bfba7a7de4a2444d90ff69d3f428e2449f7bd76e4
6
+ metadata.gz: db3215d1789cbad459cc24d3b158cb491df00f20e56b4687676fa184309354e0434be8fec4379d9147cf746e1ad8064b5f28cbdef9d4321cdc581c8ff4396459
7
+ data.tar.gz: eb51e259ff7c2981fde2d37b77658d56b9500707749ca6edae58575b13f3701c56bf47e38daca430de83e4a9379e98a2f3337c38f2e03e2d57018df1c900bf9e
@@ -0,0 +1,20 @@
1
+ name: Release Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '3.3'
19
+ bundler-cache: true
20
+ - uses: rubygems/release-gem@v1
data/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-02-28
6
+
7
+ ### Breaking Changes
8
+ - Requires OmniAuth 2.x (`~> 2.0`). Users on OmniAuth 1.x should pin `omniauth-notion ~> 0.0.3`.
9
+
10
+ ### Fixed
11
+ - Declare `omniauth-oauth2 ~> 1.8` as an explicit dependency (it was previously undeclared but required at runtime).
12
+
13
+ ### Security
14
+ - OmniAuth 2.x resolves [CVE-2015-9284](https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284), a CSRF vulnerability present in OmniAuth 1.x.
15
+
16
+ Closes #7.
17
+
18
+ ## [0.0.3] - 2022-02-09
19
+
20
+ - Update auth params to install at the user level (#6)
21
+
22
+ ## [0.0.2] - 2021-06-01
23
+
24
+ - Initial public release
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This gem provides a simple way to authenticate to Notion using OmniAuth with OAuth2.
4
4
 
5
+ > **OmniAuth version compatibility**
6
+ > - `omniauth-notion >= 1.0` requires OmniAuth 2.x
7
+ > - `omniauth-notion ~> 0.0.3` supports OmniAuth 1.x (no longer maintained)
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -18,7 +22,16 @@ Or install it yourself as:
18
22
 
19
23
  ## Usage
20
24
 
21
- TODO: Write instructions
25
+ 1. Get your client key & secret from notion [here](https://www.notion.so/my-integrations)
26
+ 2. configure omniauth or Devise or whatever you're using to use this as another oauth provider.
27
+
28
+ This looks something like below for Devise.
29
+ ```ruby
30
+ Devise.setup do |config|
31
+ ...
32
+ config.omniauth :notion, ENV['NOTION_CLIENT_KEY'], ENV['NOTION_CLIENT_SECRET']
33
+ end
34
+ ```
22
35
 
23
36
  ## Contributing
24
37
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Notion
5
- VERSION = "0.0.2"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
@@ -22,6 +22,10 @@ module OmniAuth
22
22
  },
23
23
  }
24
24
 
25
+ option :authorize_params, {
26
+ owner: 'user',
27
+ }
28
+
25
29
  # These are called after authentication has succeeded. If
26
30
  # possible, you should try to set the UID without making
27
31
  # additional calls (if the user id is returned with the token
@@ -32,16 +36,16 @@ module OmniAuth
32
36
  # https://developers.notion.com/docs/authorization#exchanging-the-grant-for-an-access-token
33
37
  info do
34
38
  {
39
+ workspace_id: raw_info['workspace_id'],
35
40
  workspace_name: raw_info['workspace_name'],
36
41
  workspace_icon: raw_info['workspace_icon'],
42
+ owner: raw_info['owner'],
37
43
  bot_id: raw_info['bot_id']
38
44
  }
39
45
  end
40
46
 
41
47
  extra do
42
- {
43
- 'raw_info' => raw_info
44
- }
48
+ { 'raw_info' => raw_info }
45
49
  end
46
50
 
47
51
  # The Notion API requires HTTP Basic Authentication when exchanging the
@@ -70,32 +74,6 @@ module OmniAuth
70
74
  def callback_url
71
75
  full_host + script_name + callback_path
72
76
  end
73
-
74
- # def callback_url
75
- # if @authorization_code_from_signed_request
76
- # ''
77
- # else
78
- # options[:callback_url] || super
79
- # end
80
- # end
81
-
82
- # def callback_url
83
- # # If redirect_uri is configured in token_params, use that
84
- # # value.
85
- # token_params.to_hash(symbolize_keys: true)[:redirect_uri] || super
86
- # end
87
-
88
- def query_string
89
- # This method is called by callback_url, only if redirect_uri
90
- # is omitted in token_params.
91
- if request.params['code']
92
- # If this is a callback, ignore query parameters added by
93
- # the provider.
94
- ''
95
- else
96
- super
97
- end
98
- end
99
77
  end
100
78
  end
101
79
  end
@@ -19,5 +19,6 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ["lib"]
21
21
 
22
- gem.add_dependency 'omniauth', '~> 1.0'
22
+ gem.add_dependency 'omniauth', '~> 2.0'
23
+ gem.add_dependency 'omniauth-oauth2', '~> 1.8'
23
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-notion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Church
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-20 00:00:00.000000000 Z
11
+ date: 2026-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
27
41
  description: OmniAuth strategy for Notion using OAuth2
28
42
  email:
29
43
  - jeremiahchurch@gmail.com
@@ -33,7 +47,9 @@ extra_rdoc_files: []
33
47
  files:
34
48
  - ".github/ISSUE_TEMPLATE/bug_report.md"
35
49
  - ".github/ISSUE_TEMPLATE/feature_request.md"
50
+ - ".github/workflows/release.yml"
36
51
  - ".gitignore"
52
+ - CHANGELOG.md
37
53
  - CODE_OF_CONDUCT.md
38
54
  - Gemfile
39
55
  - LICENSE.txt
@@ -46,7 +62,7 @@ homepage: https://github.com/jeremiahchurch/omniauth-notion
46
62
  licenses:
47
63
  - MIT
48
64
  metadata: {}
49
- post_install_message:
65
+ post_install_message:
50
66
  rdoc_options: []
51
67
  require_paths:
52
68
  - lib
@@ -61,8 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
77
  - !ruby/object:Gem::Version
62
78
  version: '0'
63
79
  requirements: []
64
- rubygems_version: 3.2.3
65
- signing_key:
80
+ rubygems_version: 3.4.20
81
+ signing_key:
66
82
  specification_version: 4
67
83
  summary: OmniAuth strategy for Notion using OAuth2
68
84
  test_files: []