source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/tubes_test.rb | Ruby | mit | 200 | master | 4,689 | # frozen_string_literal: true
# test/tubes_test.rb
require File.expand_path('../test_helper', __FILE__)
describe Beaneater::Tubes do
describe "for #find" do
before do
@beanstalk = stub
@tubes = Beaneater::Tubes.new(@beanstalk)
end
it("should return Tube obj") { assert_kind_of Beaneater::T... |
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/job_test.rb | Ruby | mit | 200 | master | 6,019 | # frozen_string_literal: true
# test/job_test.rb
require File.expand_path('../test_helper', __FILE__)
describe Beaneater::Job do
before do
@beanstalk = Beaneater.new('localhost')
@tube = @beanstalk.tubes.find 'tube'
end
describe "for #bury" do
before do
@tube.clear
@time = Time.now.t... |
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/beaneater_test.rb | Ruby | mit | 200 | master | 2,733 | # frozen_string_literal: true
require File.expand_path('../test_helper', __FILE__)
describe "beanstalk-client" do
before do
@beanstalk = Beaneater.new('127.0.0.1:11300')
@tubes = ['one', 'two', 'three']
# Put something on each tube so they exist
tube_one = @beanstalk.tubes.find('one')
tube_one.... |
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/tube_test.rb | Ruby | mit | 200 | master | 5,523 | # frozen_string_literal: true
# test/tube_test.rb
require File.expand_path('../test_helper', __FILE__)
describe Beaneater::Tube do
before do
@beanstalk = Beaneater.new('localhost')
@tube = Beaneater::Tube.new(@beanstalk, 'baz')
end
describe "for #put" do
before do
@time = Time.now.to_i
e... |
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/connection_test.rb | Ruby | mit | 200 | master | 5,919 | # frozen_string_literal: true
# test/connection_test.rb
require File.expand_path('../test_helper', __FILE__)
describe Beaneater::Connection do
describe 'for #new' do
before do
@host = 'localhost'
@bc = Beaneater::Connection.new(@host)
end
it "should store address, host and port" do
... |
github | beanstalkd/beaneater | https://github.com/beanstalkd/beaneater | test/prompt_regexp_test.rb | Ruby | mit | 200 | master | 1,468 | # frozen_string_literal: true
# test/prompt_regexp_test.rb
require File.expand_path('../test_helper', __FILE__)
require 'socket'
describe "Reading from socket client" do
before do
@fake_port = 11301
@tube_name = 'tube.to.test'
@fake_server = Thread.start do
server = TCPServer.new(@fake_port)
... |
github | sudara/sometimes | https://github.com/sudara/sometimes | sometimes.gemspec | Ruby | mit | 200 | main | 784 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sometimes/version'
Gem::Specification.new do |gem|
gem.name = "sometimes"
gem.version = Sometimes::VERSION
gem.authors = ["Sudara"]
gem.email = ["sudara@alonetone.com"]
gem... |
github | sudara/sometimes | https://github.com/sudara/sometimes | lib/sometimes.rb | Ruby | mit | 200 | main | 1,506 | require "sometimes/version"
# OH SO FUN HELPERS!
# RANDOMLY EXECUTES A BLOCK X percent OF THE TIME
#
# TEST WITH
#
# i = 0
# 100000.times do
# 75.percent_of_the_time do
# i += 1
# end
# end
# i
#
#
# 40.percent_of_the_time do
# some_task
# end
#
# 40.percent_of_the_time(true, otherwise: false)
#
# 40.percen... |
github | sudara/sometimes | https://github.com/sudara/sometimes | test/test_percent_of_the_time.rb | Ruby | mit | 200 | main | 682 | require 'test/unit'
require 'sometimes'
class PercentOfTheTimeTest < Test::Unit::TestCase
def test_percent
i = 0
100000.times do
75.percent_of_the_time do
i += 1
end
end
assert i > 73000
assert i < 76000
end
def test_99
i = 0
100000.times do
99.percent_of_th... |
github | sudara/sometimes | https://github.com/sudara/sometimes | test/test_otherwise.rb | Ruby | mit | 200 | main | 1,838 | require 'test/unit'
require 'sometimes'
class OtherwiseTest < Test::Unit::TestCase
def test_percent_with_implicit_integer_otherwise
i = 0
100000.times do
i += 50.percent_of_the_time(1)
end
assert_in_delta(i, 50000, 500)
end
def test_sometimes_with_implicit_integer_otherwise
i = 0
1... |
github | sudara/sometimes | https://github.com/sudara/sometimes | test/helper.rb | Ruby | mit | 200 | main | 4,510 | # ……………………………………………..__„„„„------„„¸._¸„
# ………………………………__„„---^^^^””¯. . . ƒ|. . „~”„”^--¸
# ………………………..„„---^^”””””””””””””””'-------ƒ-|--„-“„-”_. . .”~„
# ……………………..„•”. . . . . . . . . . . . .|---ƒ¸ƒ/¯¯. . . . . . . .“-„
# …………………..„-“. . . . . . . . . . . . . . .|/ƒ„”/|. . . . . . . . . . .”^”-„
# …………..__.„„•”. . ... |
github | sudara/sometimes | https://github.com/sudara/sometimes | test/test_sometimes.rb | Ruby | mit | 200 | main | 814 | require 'test/unit'
require 'sometimes'
class SometimesTest < Test::Unit::TestCase
def test_sometimes_with_block
i = 0
100000.times do
sometimes do
i += 1
end
end
assert (i < 51000) && (i > 49000)
end
def test_ranges
i = 0
(25..50).times { i += 1 }
assert i > 24
... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | atomic.gemspec | Ruby | apache-2.0 | 200 | master | 809 | # -*- encoding: utf-8 -*-
# Update these to get proper version and commit history
Gem::Specification.new do |s|
s.name = %q{atomic}
s.version = "1.1.16"
s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"]
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "An atomic reference implementation f... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | Rakefile | Ruby | apache-2.0 | 200 | master | 1,672 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | ext/extconf.rb | Ruby | apache-2.0 | 200 | master | 1,233 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | test/test_atomic.rb | Ruby | apache-2.0 | 200 | master | 4,180 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | examples/atomic_example.rb | Ruby | apache-2.0 | 200 | master | 823 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | examples/bench_atomic_1.rb | Ruby | apache-2.0 | 200 | master | 2,993 | #!/usr/bin/env ruby
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | examples/graph_atomic_bench.rb | Ruby | apache-2.0 | 200 | master | 2,201 | #!/usr/bin/env ruby
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | examples/bench_atomic.rb | Ruby | apache-2.0 | 200 | master | 2,438 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic.rb | Ruby | apache-2.0 | 200 | master | 948 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/numeric_cas_wrapper.rb | Ruby | apache-2.0 | 200 | master | 1,015 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/delegated_update.rb | Ruby | apache-2.0 | 200 | master | 1,278 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/fallback.rb | Ruby | apache-2.0 | 200 | master | 1,364 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/direct_update.rb | Ruby | apache-2.0 | 200 | master | 1,252 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/jruby.rb | Ruby | apache-2.0 | 200 | master | 602 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/ruby.rb | Ruby | apache-2.0 | 200 | master | 639 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/rbx.rb | Ruby | apache-2.0 | 200 | master | 782 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | headius/ruby-atomic | https://github.com/headius/ruby-atomic | lib/atomic/concurrent_update_error.rb | Ruby | apache-2.0 | 200 | master | 758 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | doorkeeper-openid_connect.gemspec | Ruby | mit | 200 | master | 1,980 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'doorkeeper/openid_connect/version'
Gem::Specification.new do |spec|
spec.name = 'doorkeeper-openid_connect'
spec.version = Doorkeeper::OpenidConnect::VERSION
spec.authors = ['Sam Dengler', 'Markus Koller... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | Rakefile | Ruby | mit | 200 | master | 532 | # frozen_string_literal: true
ENV['RAILS_ENV'] ||= 'test'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task default: :spec
task test: :spec
desc 'Generate and run migrations in the test application'
task :migrate do
Dir.chdir('spec/dummy') do
system('bin/rails generate... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | Gemfile | Ruby | mit | 200 | master | 345 | # frozen_string_literal: true
source 'https://rubygems.org'
# use Rails version specified by environment
ENV['rails'] ||= '8.0.0'
gem 'rails', "~> #{ENV['rails']}"
gem 'rails-controller-testing'
gem 'rubocop', '~> 1.6'
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec',... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/rails_helper.rb | Ruby | mit | 200 | master | 2,515 | # frozen_string_literal: true
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'dummy/config/environment'
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
r... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/factories.rb | Ruby | mit | 200 | master | 896 | # frozen_string_literal: true
FactoryBot.define do
factory :access_grant, class: 'Doorkeeper::AccessGrant' do
resource_owner_id { create(:user).id }
application
redirect_uri { 'https://app.com/callback' }
expires_in { 100 }
scopes { 'public write' }
end
factory :access_token, class: 'Doorkee... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/spec_helper.rb | Ruby | mit | 200 | master | 4,007 | # frozen_string_literal: true
require 'pry-byebug' unless ENV['CI']
puts "====> Doorkeeper version: #{Doorkeeper::VERSION::STRING}"
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if yo... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/config/application.rb | Ruby | mit | 200 | master | 478 | require_relative 'boot'
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified h... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/config/initializers/doorkeeper.rb | Ruby | mit | 200 | master | 329 | # frozen_string_literal: true
Doorkeeper.configure do
optional_scopes :openid
resource_owner_authenticator do
if params[:current_user].present?
User.find(params[:current_user])
else
redirect_to('/login')
nil
end
end
grant_flows %w[authorization_code client_credentials implicit_o... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/config/initializers/doorkeeper_openid_connect.rb | Ruby | mit | 200 | master | 3,125 | # frozen_string_literal: true
Doorkeeper::OpenidConnect.configure do
issuer 'dummy'
signing_key <<~EOL
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEAsjdnSA6UWUQQHf6BLIkIEUhMRNBJC1NN/pFt1EJmEiI88GS0
ceROO5B5Ooo9Y3QOWJ/n+u1uwTHBz0HCTN4wgArWd1TcqB5GQzQRP4eYnWyPfi4C
feqAHzQp+v4VwbcK0LW4FqtW5D0dtrFtI... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/config/environments/test.rb | Ruby | mit | 200 | master | 1,516 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "s... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/schema.rb | Ruby | mit | 200 | master | 3,255 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb | Ruby | mit | 200 | master | 262 | # frozen_string_literal: true
class AddPreviousRefreshTokenToAccessTokens < ActiveRecord::Migration[4.2]
def change
add_column(
:oauth_access_tokens,
:previous_refresh_token,
:string,
default: '',
null: false
)
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb | Ruby | mit | 200 | master | 310 | # frozen_string_literal: true
class AddOwnerToApplication < ActiveRecord::Migration[4.2]
def change
add_column :oauth_applications, :owner_id, :integer, null: true
add_column :oauth_applications, :owner_type, :string, null: true
add_index :oauth_applications, [:owner_id, :owner_type]
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/migrate/20180904152859_add_confidential_to_applications.rb | Ruby | mit | 200 | master | 246 | # frozen_string_literal: true
class AddConfidentialToApplications < ActiveRecord::Migration[5.0]
def change
add_column(
:oauth_applications,
:confidential,
:boolean,
null: false,
default: true
)
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/migrate/20221122044143_enable_pkce.rb | Ruby | mit | 200 | master | 257 | # frozen_string_literal: true
class EnablePkce < ActiveRecord::Migration[6.0]
def change
add_column :oauth_access_grants, :code_challenge, :string, null: true
add_column :oauth_access_grants, :code_challenge_method, :string, null: true
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb | Ruby | mit | 200 | master | 2,062 | # frozen_string_literal: true
class CreateDoorkeeperTables < ActiveRecord::Migration[4.2]
def change
create_table :oauth_applications do |t|
t.string :name, null: false
t.string :uid, null: false
t.string :secret, null: false
t.text :redirect_uri, null: false
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/controllers/dynamic_client_registration_controller_spec.rb | Ruby | mit | 200 | master | 1,997 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::DynamicClientRegistrationController, type: :controller do
before do
Doorkeeper::OpenidConnect.configure do
issuer "dummy"
dynamic_client_registration true
end
Rails.application.reload_routes!
end
d... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/controllers/discovery_controller_spec.rb | Ruby | mit | 200 | master | 15,155 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::DiscoveryController, type: :controller do
describe '#provider' do
it 'returns the provider configuration' do
get :provider
data = JSON.parse(response.body)
expect(data.sort).to match({
'issuer' =>... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/controllers/userinfo_controller_spec.rb | Ruby | mit | 200 | master | 2,295 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::UserinfoController, type: :controller do
let(:client) { create :application }
let(:user) { create :user, name: 'Joe' }
let(:token) { create :access_token, application: client, resource_owner_id: user.id }
describe '#s... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/controllers/doorkeeper/authorizations_controller_spec.rb | Ruby | mit | 200 | master | 18,775 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::AuthorizationsController, type: :controller do
let(:user) { create :user }
let(:application) { create :application, scopes: default_scopes }
let(:default_scopes) { 'openid profile' }
let(:token_attributes) { { application_id: applicatio... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/controllers/doorkeeper/authorized_applications_controller_spec.rb | Ruby | mit | 200 | master | 351 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::AuthorizedApplicationsController, type: :controller do
let(:access_token) { create :access_token }
describe '#index' do
it 'does not run the extended #authenticate_resource_owner!' do
expect do
get :index
end.not_to... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/models/request_spec.rb | Ruby | mit | 200 | master | 989 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::Request do
let(:expected_access_grant_class_name) do
if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0')
Doorkeeper.config.access_grant_class.to_s
else
'Doorkeeper::AccessGrant'
end... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/models/access_grant_spec.rb | Ruby | mit | 200 | master | 1,371 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::AccessGrant do
subject { Doorkeeper.config.access_grant_model.new }
let(:openid_request_class_name) { Doorkeeper::OpenidConnect.configuration.open_id_request_class }
let(:openid_request_class) { Doorkeeper::OpenidConnect.co... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/support/doorkeeper_configuration.rb | Ruby | mit | 200 | master | 1,225 | # frozen_string_literal: true
module DoorkeeperConfiguration
def configure_doorkeeper(signing_key, signing_algorithm)
Doorkeeper::OpenidConnect.configure do
signing_key signing_key
signing_algorithm signing_algorithm
resource_owner_from_access_token do |access_token|
User.find_by(id: ... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/config_spec.rb | Ruby | mit | 200 | master | 6,468 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect, 'configuration' do
subject { described_class.configuration }
describe '#configure' do
it 'fails if not set to :active_record' do
# stub ORM setup to avoid Doorkeeper exceptions
allow(Doorkeeper).to receive(:s... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/routes_spec.rb | Ruby | mit | 200 | master | 1,653 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::Rails::Routes, type: :routing do
describe 'userinfo' do
it 'maps GET #show' do
expect(get: 'oauth/userinfo').to route_to(
controller: 'doorkeeper/openid_connect/userinfo',
action: 'show'
)
en... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/id_token_spec.rb | Ruby | mit | 200 | master | 4,794 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::IdToken do
subject { described_class.new(access_token, nonce) }
let(:access_token) { create :access_token, resource_owner_id: user.id, scopes: 'openid' }
let(:user) { create :user }
let(:nonce) { '123456' }
before do
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/openid_connect_spec.rb | Ruby | mit | 200 | master | 9,306 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect do
describe '.signing_algorithm' do
it 'returns the signing_algorithm as an uppercase symbol' do
expect(subject.signing_algorithm).to eq :RS256
end
end
describe '.signing_key' do
it 'returns the private ke... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/id_token_token_spec.rb | Ruby | mit | 200 | master | 2,090 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::IdTokenToken do
subject { described_class.new(access_token, nonce) }
let(:access_token) { create :access_token, resource_owner_id: user.id, scopes: 'openid' }
let(:user) { create :user }
let(:nonce) { '123456' }
befor... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/user_info_spec.rb | Ruby | mit | 200 | master | 1,432 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::UserInfo do
subject { described_class.new token }
let(:user) { create :user, name: 'Joe' }
let(:token) { create :access_token, resource_owner_id: user.id, scopes: scopes }
let(:scopes) { 'openid' }
describe '#claims' ... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/claims/claim_spec.rb | Ruby | mit | 200 | master | 1,184 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::Claims::Claim do
subject { described_class.new name: 'username', scope: 'profile' }
describe '#initialize' do
it 'uses the given name' do
expect(subject.name).to eq :username
end
it 'uses the given scope' ... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/id_token_token_response_spec.rb | Ruby | mit | 200 | master | 1,642 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OAuth::IdTokenTokenResponse do
subject { described_class.new(pre_auth, auth, id_token) }
let(:token) { create :access_token }
let(:application) do
create(:application, scopes: 'public')
end
let(:pre_auth) do
double(
:pr... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/id_token_request_spec.rb | Ruby | mit | 200 | master | 2,386 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OAuth::IdTokenRequest do
subject do
described_class.new(pre_auth, owner)
end
let :application do
FactoryBot.create(:application, scopes: 'public')
end
let :pre_auth do
server = Doorkeeper.configuration
allow(server).... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/id_token_response_spec.rb | Ruby | mit | 200 | master | 1,692 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OAuth::IdTokenResponse do
subject { described_class.new(pre_auth, auth, id_token) }
let(:token) { create :access_token }
let(:application) do
create(:application, scopes: 'public')
end
let(:pre_auth) do
double(
:pre_au... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/authorization_code_request_spec.rb | Ruby | mit | 200 | master | 1,418 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::OAuth::AuthorizationCodeRequest do
subject do
Doorkeeper::OAuth::AuthorizationCodeRequest.new(server, grant, client).tap do |request|
request.instance_variable_set '@response', response
request.instance_variable... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/password_access_token_request_spec.rb | Ruby | mit | 200 | master | 1,211 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::OAuth::PasswordAccessTokenRequest do
if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.1')
subject { Doorkeeper::OAuth::PasswordAccessTokenRequest.new server, client, credentials, resource_owner, { nonce... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/id_token_token_request_spec.rb | Ruby | mit | 200 | master | 1,197 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OAuth::IdTokenTokenRequest do
subject do
described_class.new(pre_auth, owner)
end
let :application do
FactoryBot.create(:application, scopes: 'public')
end
let :pre_auth do
server = Doorkeeper.configuration
allow(ser... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/token_response_spec.rb | Ruby | mit | 200 | master | 1,415 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::OAuth::TokenResponse do
subject { Doorkeeper::OAuth::TokenResponse.new token }
let(:token) { create :access_token }
let(:client) { Doorkeeper::OAuth::Client.new create(:application) }
let(:pre_auth) { Doorkeeper::OAuth::... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/pre_authorization_spec.rb | Ruby | mit | 200 | master | 1,712 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::OAuth::PreAuthorization do
subject { Doorkeeper::OAuth::PreAuthorization.new server, attrs }
let(:server) { Doorkeeper.configuration }
let(:attrs) {}
describe '#initialize' do
context 'with nonce parameter' do
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | spec/lib/oauth/authorization/code_spec.rb | Ruby | mit | 200 | master | 1,906 | # frozen_string_literal: true
require 'rails_helper'
describe Doorkeeper::OpenidConnect::OAuth::Authorization::Code do
subject { Doorkeeper::OAuth::Authorization::Code.new pre_auth, resource_owner }
let(:resource_owner) { create :user }
let(:access_grant) { create :access_grant }
let(:pre_auth) { double }
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | app/controllers/doorkeeper/openid_connect/discovery_controller.rb | Ruby | mit | 200 | master | 4,508 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class DiscoveryController < ::Doorkeeper::ApplicationMetalController
include Doorkeeper::Helpers::Controller
include GrantTypesSupportedMixin
WEBFINGER_RELATION = 'http://openid.net/specs/connect/1.0/issuer'
def provid... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | app/controllers/doorkeeper/openid_connect/dynamic_client_registration_controller.rb | Ruby | mit | 200 | master | 1,574 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class DynamicClientRegistrationController < ::Doorkeeper::ApplicationMetalController
include GrantTypesSupportedMixin
def register
client = Doorkeeper::Application.create!(application_params)
render json: registrati... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | app/controllers/doorkeeper/openid_connect/userinfo_controller.rb | Ruby | mit | 200 | master | 337 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class UserinfoController < ::Doorkeeper::ApplicationMetalController
before_action -> { doorkeeper_authorize! :openid }
def show
render json: Doorkeeper::OpenidConnect::UserInfo.new(doorkeeper_token), status: :ok
end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | app/controllers/concerns/doorkeeper/openid_connect/grant_types_supported_mixin.rb | Ruby | mit | 200 | master | 355 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module GrantTypesSupportedMixin
def grant_types_supported(doorkeeper)
grant_types_supported = doorkeeper.grant_flows.dup
grant_types_supported << 'refresh_token' if doorkeeper.refresh_token_enabled?
grant_types_sup... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect.rb | Ruby | mit | 200 | master | 3,614 | # frozen_string_literal: true
require 'doorkeeper'
require 'active_model'
require 'jwt'
require 'doorkeeper/request'
require 'doorkeeper/request/id_token'
require 'doorkeeper/request/id_token_token'
require 'doorkeeper/oauth/id_token_request'
require 'doorkeeper/oauth/id_token_token_request'
require 'doorkeeper/oauth... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/oauth/id_token_token_response.rb | Ruby | mit | 200 | master | 328 | # frozen_string_literal: true
module Doorkeeper
module OAuth
class IdTokenTokenResponse < IdTokenResponse
def body
super.merge({
access_token: auth.token.token,
token_type: auth.token.token_type,
expires_in: auth.token.expires_in_seconds
})
end
end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/oauth/id_token_response.rb | Ruby | mit | 200 | master | 622 | # frozen_string_literal: true
module Doorkeeper
module OAuth
class IdTokenResponse < BaseResponse
include OAuth::Helpers
attr_accessor :pre_auth, :auth, :id_token
def initialize(pre_auth, auth, id_token)
@pre_auth = pre_auth
@auth = auth
@id_token = id_token
end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/oauth/id_token_request.rb | Ruby | mit | 200 | master | 820 | # frozen_string_literal: true
module Doorkeeper
module OAuth
class IdTokenRequest
attr_accessor :pre_auth, :auth, :resource_owner
def initialize(pre_auth, resource_owner)
@pre_auth = pre_auth
@resource_owner = resource_owner
end
def authorize
@auth = Author... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/oauth/id_token_token_request.rb | Ruby | mit | 200 | master | 336 | # frozen_string_literal: true
module Doorkeeper
module OAuth
class IdTokenTokenRequest < IdTokenRequest
private
def response
id_token_token = Doorkeeper::OpenidConnect::IdTokenToken.new(auth.token, pre_auth.nonce)
IdTokenTokenResponse.new(pre_auth, auth, id_token_token)
end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/request/id_token.rb | Ruby | mit | 200 | master | 383 | # frozen_string_literal: true
require 'doorkeeper/request/strategy'
module Doorkeeper
module Request
class IdToken < Strategy
delegate :current_resource_owner, to: :server
def pre_auth
server.context.send(:pre_auth)
end
def request
@request ||= OAuth::IdTokenRequest.new... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/request/id_token_token.rb | Ruby | mit | 200 | master | 393 | # frozen_string_literal: true
require 'doorkeeper/request/strategy'
module Doorkeeper
module Request
class IdTokenToken < Strategy
delegate :current_resource_owner, to: :server
def pre_auth
server.context.send(:pre_auth)
end
def request
@request ||= OAuth::IdTokenTokenR... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/version.rb | Ruby | mit | 200 | master | 222 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
MAJOR = 1
MINOR = 9
TINY = 0
PRE = nil
# Full version number
VERSION = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/id_token.rb | Ruby | mit | 200 | master | 2,121 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class IdToken
include ActiveModel::Validations
attr_reader :nonce
def initialize(access_token, nonce = nil, expires_in = Doorkeeper::OpenidConnect.configuration.expiration)
@access_token = access_token
@nonce... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/user_info.rb | Ruby | mit | 200 | master | 834 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class UserInfo
include ActiveModel::Validations
def initialize(access_token)
@access_token = access_token
end
def claims
{
sub: subject
}.merge ClaimsBuilder.generate(@access_token, :u... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/engine.rb | Ruby | mit | 200 | master | 391 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class Engine < ::Rails::Engine
initializer 'doorkeeper.openid_connect.routes' do
Doorkeeper::OpenidConnect::Rails::Routes.install!
end
config.to_prepare do
Doorkeeper::AuthorizationsController.prepend Doorkeep... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/config.rb | Ruby | mit | 200 | master | 3,286 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
def self.configure(&block)
if Doorkeeper.configuration.orm != :active_record
raise Errors::InvalidConfiguration, 'Doorkeeper OpenID Connect currently only supports the ActiveRecord ORM adapter'
end
@config = Config::B... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/id_token_token.rb | Ruby | mit | 200 | master | 1,552 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
class IdTokenToken < IdToken
def claims
super.merge(at_hash: at_hash)
end
private
# The at_hash is build according to the following standard:
#
# http://openid.net/specs/openid-connect-implicit-1_0.... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/claims_builder.rb | Ruby | mit | 200 | master | 1,055 | # frozen_string_literal: true
require 'ostruct'
module Doorkeeper
module OpenidConnect
class ClaimsBuilder
def self.generate(access_token, response)
resource_owner = Doorkeeper::OpenidConnect.configuration.resource_owner_from_access_token.call(access_token)
Doorkeeper::OpenidConnect.confi... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/errors.rb | Ruby | mit | 200 | master | 964 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module Errors
class OpenidConnectError < StandardError
def type
self.class.name.demodulize.underscore.to_sym
end
end
# internal errors
class InvalidConfiguration < OpenidConnectError; end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/orm/active_record.rb | Ruby | mit | 200 | master | 2,285 | # frozen_string_literal: true
require 'active_support/lazy_load_hooks'
module Doorkeeper
module OpenidConnect
autoload :AccessGrant, "doorkeeper/openid_connect/orm/active_record/access_grant"
autoload :Request, "doorkeeper/openid_connect/orm/active_record/request"
module Orm
module ActiveRecord
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/orm/active_record/request.rb | Ruby | mit | 200 | master | 263 | # frozen_string_literal: true
require 'doorkeeper/openid_connect/orm/active_record/mixins/openid_request'
module Doorkeeper
module OpenidConnect
class Request < ::ActiveRecord::Base
include Orm::ActiveRecord::Mixins::OpenidRequest
end
end
end |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/orm/active_record/access_grant.rb | Ruby | mit | 200 | master | 429 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module AccessGrant
def self.prepended(base)
base.class_eval do
has_one :openid_request,
class_name: Doorkeeper::OpenidConnect.configuration.open_id_request_class,
foreign_key: 'access_grant_id',
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/orm/active_record/mixins/openid_request.rb | Ruby | mit | 200 | master | 942 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module Orm
module ActiveRecord
module Mixins
module OpenidRequest
extend ::ActiveSupport::Concern
included do
self.table_name = "#{table_name_prefix}oauth_openid_requests#{table_nam... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/helpers/controller.rb | Ruby | mit | 200 | master | 6,015 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module Helpers
module Controller
private
# FIXME: remove after Doorkeeper will merge it
def current_resource_owner
return @current_resource_owner if defined?(@current_resource_owner)
super
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/oauth/token_response.rb | Ruby | mit | 200 | master | 574 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module OAuth
module TokenResponse
attr_accessor :id_token
def body
if token.includes_scope? 'openid'
id_token = self.id_token || Doorkeeper::OpenidConnect::IdToken.new(token)
super
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/oauth/password_access_token_request.rb | Ruby | mit | 200 | master | 896 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module OAuth
module PasswordAccessTokenRequest
attr_reader :nonce
if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.1')
def initialize(server, client, credentials, resource_owner, parameters ... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/oauth/pre_authorization.rb | Ruby | mit | 200 | master | 895 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module OAuth
module PreAuthorization
attr_reader :nonce
def initialize(server, attrs = {}, resource_owner = nil)
super
@nonce = attrs[:nonce]
end
# NOTE: Auto get default response_mode... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/oauth/authorization_code_request.rb | Ruby | mit | 200 | master | 613 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module OAuth
module AuthorizationCodeRequest
private
def after_successful_response
super
nonce =
if (openid_request = grant.openid_request)
openid_request.destroy!
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/oauth/authorization/code.rb | Ruby | mit | 200 | master | 1,114 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module OAuth
module Authorization
module Code
if Doorkeeper::OAuth::Authorization::Code.method_defined?(:issue_token!)
def issue_token!
super.tap do |access_grant|
create_openid_... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/claims/normal_claim.rb | Ruby | mit | 200 | master | 347 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module Claims
class NormalClaim < Claim
attr_reader :generator
def initialize(options = {})
super(options)
@generator = options[:generator]
end
def type
:normal
end
... |
github | doorkeeper-gem/doorkeeper-openid_connect | https://github.com/doorkeeper-gem/doorkeeper-openid_connect | lib/doorkeeper/openid_connect/claims/claim.rb | Ruby | mit | 200 | master | 1,168 | # frozen_string_literal: true
module Doorkeeper
module OpenidConnect
module Claims
class Claim
attr_accessor :name, :response, :scope
# http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
# http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
STA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.