Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Suite

on:
push:
branches: [ master, ruby30 ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.7'
bundler-cache: true

- name: Run tests
run: bundle exec rspec

- name: Upload coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: coverage/
retention-days: 30
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pkg
.swp
.idea
.rvmrc
coverage

Gemfile.lock
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.7
23 changes: 0 additions & 23 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,3 @@ source "http://rubygems.org"

# Specify your gem's dependencies in oauth-plugin.gemspec
gemspec

require 'rbconfig'

platforms :ruby do
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'rb-fsevent'
gem 'growl'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
end
end

platforms :jruby do
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'growl'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
end
end
278 changes: 278 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
PATH
remote: .
specs:
oauth-plugin (0.5.1)
multi_json
oauth (>= 0.6.0)
oauth2 (>= 0.5.0)
rack

GEM
remote: http://rubygems.org/
specs:
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (>= 2.7.1)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.10)
actionpack (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
nokogiri (>= 1.8.5)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
globalid (>= 0.3.6)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activestorage (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activesupport (= 6.1.7.10)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
base64 (0.3.0)
builder (3.3.0)
coderay (1.1.3)
concurrent-ruby (1.3.5)
crass (1.0.6)
date (3.4.1)
diff-lcs (1.6.2)
docile (1.4.1)
erubi (1.13.1)
fakeweb (1.3.0)
faraday (2.14.0)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.17.2)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
formatador (1.2.1)
reline
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
globalid (1.3.0)
activesupport (>= 6.1)
guard (2.19.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
logger (~> 1.6)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
ostruct (~> 0.6)
pry (>= 0.13.0)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashie (5.0.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-console (0.8.1)
json (2.15.0)
jwt (3.1.2)
base64
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
loofah (2.24.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.4.2)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.1.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.5)
multi_json (1.17.0)
multi_xml (0.6.0)
nenv (0.3.0)
net-http (0.6.0)
uri
net-imap (0.4.22)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nokogiri (1.17.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
oauth (1.1.2)
oauth-tty (~> 1.0, >= 1.0.6)
snaky_hash (~> 2.0)
version_gem (~> 1.1, >= 1.1.9)
oauth-tty (1.0.6)
version_gem (~> 1.1, >= 1.1.9)
oauth2 (2.0.17)
faraday (>= 0.17.3, < 4.0)
jwt (>= 1.0, < 4.0)
logger (~> 1.2)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
snaky_hash (~> 2.0, >= 2.0.3)
version_gem (~> 1.1, >= 1.1.9)
ostruct (0.6.3)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.8.1)
rack (2.2.18)
rack-test (2.2.0)
rack (>= 1.3)
rails (6.1.7.10)
actioncable (= 6.1.7.10)
actionmailbox (= 6.1.7.10)
actionmailer (= 6.1.7.10)
actionpack (= 6.1.7.10)
actiontext (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activemodel (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
bundler (>= 1.15.0)
railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
method_source
rake (>= 12.2)
thor (~> 1.0)
rake (13.3.0)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
reline (0.6.2)
io-console (~> 0.5)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
ruby-progressbar (1.13.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
snaky_hash (2.0.3)
hashie (>= 0.1.0, < 6)
version_gem (>= 1.1.8, < 3)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
thor (1.4.0)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (1.0.3)
version_gem (1.1.9)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)

PLATFORMS
arm64-darwin
x86_64-darwin
x86_64-linux

DEPENDENCIES
fakeweb
fuubar
guard-rspec
oauth-plugin!
rack-test
rails (~> 6.1.0)
rspec (~> 3.10)
simplecov

BUNDLED WITH
2.5.23
8 changes: 4 additions & 4 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,16 @@ I recommend that you think about what your users would want to provide access to

If you want to give oauth access to everything a registered user can do, just replace the filter you have in your controllers with:

before_filter :login_or_oauth_required
before_action :login_or_oauth_required

If you want to restrict consumers to the index and show methods of your controller do the following:

before_filter :login_required, :except => [:show,:index]
before_filter :login_or_oauth_required, :only => [:show,:index]
before_action :login_required, :except => [:show,:index]
before_action :login_or_oauth_required, :only => [:show,:index]

If you have an action you only want used via oauth:

before_filter :oauth_required
before_action :oauth_required

You can also use this method in your controller:

Expand Down
2 changes: 1 addition & 1 deletion UPGRADE.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ You should also upgrade your oauth_consumer_controller as we no longer call logi
class OauthConsumersController < ApplicationController
include Oauth::Controllers::ConsumerController
# Replace this with the equivalent for your authentication framework
before_filter :login_required, :only=>:index
before_action :login_required, :only=>:index
4 changes: 2 additions & 2 deletions generators/oauth_provider/templates/clients_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class OauthClientsController < ApplicationController
before_filter :login_required
before_filter :get_client_application, :only => [:show, :edit, :update, :destroy]
before_action :login_required
before_action :get_client_application, :only => [:show, :edit, :update, :destroy]

def index
@client_applications = current_user.client_applications
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/oauth_consumer/templates/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class OauthConsumersController < ApplicationController
# Replace this with the equivalent for your authentication framework
# Eg. for devise
#
# before_filter :authenticate_user!, :only=>:index
before_filter :login_required, :only=>:index
# before_action :authenticate_user!, :only=>:index
before_action :login_required, :only=>:index

def index
@consumer_tokens=ConsumerToken.all :conditions=>{:user_id=>current_user.id}
Expand Down
Loading