omniauth-threads 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f5596649f40b3b480192fe2b6279ef38fd511dce287a063d51a7e4f106bd3e89
4
+ data.tar.gz: f30e5559b65c7529beae026f3c3c6350e3945792a1b31320ad2574faafa24b89
5
+ SHA512:
6
+ metadata.gz: d2ad53d4c24ce25dccdafec4edbefc03631971d47476538a0eed370f22bc5a709296a70e232166ea73139125edb66692211d5bb1fc420df9eba695868e1bfcb1
7
+ data.tar.gz: 03d46d203409351d8c04a881209495a27e1678eebba1ef35913581631093611c1647af05e412cb1044456acc22c4f722e137fdc0938cb02e58df7901b439685b
@@ -0,0 +1,25 @@
1
+ name: Ruby
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby:
12
+ - "3.0"
13
+ - "3.1"
14
+ - "3.2"
15
+ - "3.3"
16
+ - head
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ bundler-cache: true # 'bundle install' and cache
24
+ - name: Run tests
25
+ run: bundle exec rake
@@ -0,0 +1,23 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/stale@v1
14
+ with:
15
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
16
+ stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
17
+ stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
18
+ stale-issue-label: 'no-issue-activity'
19
+ stale-pr-label: 'no-pr-activity'
20
+ days-before-stale: 90
21
+ days-before-close: 60
22
+ exempt-pr-label: 'pinned'
23
+ exempt-issue-label: 'pinned'
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ .bundle
3
+ .rspec
4
+ /Gemfile.lock
5
+ pkg/*
6
+ .powenv
7
+ .powder
8
+ tmp
9
+ bin
data/CHANGELOG.md ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'rack', '>= 2.0'
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # OmniAuth Threads Threads  [![Build Status](https://secure.travis-ci.org/simi/omniauth-threads.svg?branch=master)](https://travis-ci.org/simi/omniauth-threads) [![Gem Version](https://img.shields.io/gem/v/omniauth-threads.svg)](https://rubygems.org/gems/omniauth-threads)
2
+ 📣 **NOTICE** We’re looking for maintainers to help keep this project up-to-date. If you are interested in helping please open an Issue expressing your interest. Thanks! 📣
3
+
4
+ **These notes are based on master, please see tags for README pertaining to specific releases.**
5
+
6
+ Threads Threads API Strategy for OmniAuth.
7
+
8
+ Supports server-side and client-side flows. Read the Threads docs for more details: https://developers.threads.net/docs/messenger-platform/threads-api
9
+
10
+ ## Installing
11
+
12
+ Add to your `Gemfile`:
13
+
14
+ ```ruby
15
+ gem 'omniauth-threads-threads'
16
+ ```
17
+
18
+ Then `bundle install`.
19
+
20
+
21
+ Then `bundle install`.
22
+
23
+ ## Usage
24
+
25
+ `OmniAuth::Strategies::ThreadsThreads` is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.
26
+
27
+ Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
28
+
29
+
30
+ ```ruby
31
+ Rails.application.config.middleware.use OmniAuth::Builder do
32
+ provider :threads, ENV['THREADS_APP_ID'], ENV['THREADS_APP_SECRET']
33
+ end
34
+ ```
35
+
36
+
37
+
38
+
39
+
40
+ ## Supported Rubies
41
+
42
+ - Ruby MRI (3.0, 3.1, 3.2 and 3.3)
43
+
44
+ ## Licens
45
+
46
+
47
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
48
+
49
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |task|
5
+ task.libs << 'test'
6
+ task.test_files = FileList['test/*_test.rb']
7
+ end
8
+
9
+ task default: :test
@@ -0,0 +1,46 @@
1
+ require 'omniauth-oauth2'
2
+
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Threads < OmniAuth::Strategies::OAuth2
7
+ option :name, "threads"
8
+
9
+ option :client_options, {
10
+ site: "https://graph.threads.net/",
11
+ authorize_url: "https://threads.net/oauth/authorize",
12
+ token_url: 'oauth/access_token'
13
+ }
14
+
15
+ def token_params
16
+ super.tap do |params|
17
+ params.client_secret = options.client_secret
18
+ params.client_id = options.client_id
19
+ end
20
+ end
21
+
22
+ def callback_url
23
+ super.split("?").first
24
+ end
25
+
26
+
27
+
28
+ uid { raw_info['id'] }
29
+
30
+ info do
31
+ {}
32
+ end
33
+
34
+ extra do
35
+ {
36
+ 'raw_info' => raw_info
37
+ }
38
+ end
39
+
40
+ def raw_info
41
+ @raw_info ||= access_token.get('/me').parsed
42
+ end
43
+
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Threads
3
+ VERSION = '0.1.1'
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth/threads/version'
2
+ require 'omniauth/strategies/threads'
@@ -0,0 +1 @@
1
+ require 'omniauth/threads'
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'omniauth/threads/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'omniauth-threads'
7
+ s.version = OmniAuth::Threads::VERSION
8
+ s.summary = 'Threads OAuth2 Strategy for OmniAuth'
9
+ s.homepage = 'https://github.com/bborn/omniauth-threads'
10
+ s.authors = ['Bruno Bornsztein']
11
+ s.license = 'MIT'
12
+
13
+ s.files = `git ls-files`.split("\n")
14
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
16
+ s.require_paths = ['lib']
17
+
18
+ s.add_runtime_dependency 'omniauth-oauth2', '>= 1.2', '< 3'
19
+ s.add_runtime_dependency 'bigdecimal'
20
+
21
+ s.add_development_dependency 'minitest'
22
+ s.add_development_dependency 'mocha'
23
+ s.add_development_dependency 'rake'
24
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-threads
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Bruno Bornsztein
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bigdecimal
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: minitest
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: mocha
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ description:
90
+ email:
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - ".github/workflows/ci.yml"
96
+ - ".github/workflows/stale.yml"
97
+ - ".gitignore"
98
+ - CHANGELOG.md
99
+ - Gemfile
100
+ - README.md
101
+ - Rakefile
102
+ - lib/omniauth-threads.rb
103
+ - lib/omniauth/strategies/threads.rb
104
+ - lib/omniauth/threads.rb
105
+ - lib/omniauth/threads/version.rb
106
+ - omniauth-threads.gemspec
107
+ homepage: https://github.com/bborn/omniauth-threads
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubygems_version: 3.2.32
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: Threads OAuth2 Strategy for OmniAuth
130
+ test_files: []