GithubHelp home page GithubHelp logo

doorkeeper-sequel's Introduction

Hey / Привет 👋

My name is Nikita, and I'm a senior developer at @azati.

I'm currently working on:

  • OAuth 2 provider as a Rails engine - @doorkeeper and related ecosystem.
  • Proxy lists fetcher and validator - @proxy_fetcher.
  • ... and other OSS.

📫 Reach me out at [email protected]

My GitHub stats

doorkeeper-sequel's People

Contributors

gencer avatar nbulaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doorkeeper-sequel's Issues

Rails 6 Support

Hello,

I am wondering if this gem will officially support Rails 6? I see support for rails 5.0, 5.1, and 5.2 and am hoping to use this gem in a new Rails 6 project I am setting up.

Thanks so much for your time!

Sequel5 support

Is it possible to bring Sequel v5.x support to this gem?

I manually changed gem version to 5.0 but I get an error like:
No database associated with Sequel::Model: have you called Sequel.connect or Sequel::Model.db= ? (Sequel::Error)
when generating migrations.

Just making gem to set v5 will be enough. Previous error was a mistakenly my bad :)

supports_confidentiality? and :confidential? is not defined for doorkeper-sequel

When I try to use doorkeeper with doorkeeper-sequel, http://localhost:5000/oauth/applications/new endpoint errors out saying;

NoMethodError - undefined method `supports_confidentiality?' for Doorkeeper::Application:Class:.

I checked the doorkeeper-4.3.3/lib/doorkeeper/orm/active_record/application.rb file and it implements those two functions however doorkeeper-sequel-1.4.0/lib/doorkeeper/orm/sequel/application.rb does not implement those functions.

I also added two dummy functions to doorkeeper-sequel-1.4.0/lib/doorkeeper/orm/sequel/application.rb and it seems to be working.

FYI, @nbulaj

RedirectUriValidator (ActiveModel or Sequel)

For now Doorkeeper specs contains tests for ActiveModelversion of RedirectUriValidator. So it must be decided:

  • leave and use original validation class as is (if possible),
  • or use Sequel validation model and rewrite specs.

uninitialized constant DoorkeeperSequel::ConfidentialApplicationsGenerator

Either I am missing something or there is an error in this gem. Because, I cannot generate pkce and confidental_applications migrations. Tested on Windows and linux.

Result:

$ rake doorkeeper_sequel:generate:confidential_applications --trace
/d/Ruby25-x64/bin/rake: line 4: {#: command not found
I, [2018-10-28T12:18:48.278405 #16532]  INFO -- sentry: ** [Raven] Raven 2.7.4 ready to catch errors
** Invoke doorkeeper_sequel:generate:confidential_applications (first_time)
** Execute doorkeeper_sequel:generate:confidential_applications
I, [2018-10-28T12:18:48.689970 #16532]  INFO -- sentry: ** [Raven] Sending event 26e04e795503450dbe144ceeed00e19f to Sentry
E, [2018-10-28T12:18:49.478449 #16532] ERROR -- sentry: ** [Raven] Unable to record event with remote Sentry server (Raven::Error - the server responded with status 429 Error in headers is: Creation of this event was denied due to rate limiting):
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/transports/http.rb:34:in `rescue in send_event'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/transports/http.rb:16:in `send_event'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/client.rb:37:in `send_event'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/instance.rb:81:in `send_event'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/instance.rb:126:in `capture_type'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sentry-raven-2.7.4/lib/raven/integrations/rake.rb:9:in `display_error_message'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:195:in `rescue in standard_exception_handling'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:185:in `standard_exception_handling'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
D:/Ruby25-x64/bin/rake:31:in `load'
E, [2018-10-28T12:18:49.479361 #16532] ERROR -- sentry: ** [Raven] Failed to submit event: NameError: uninitialized constant DoorkeeperSequel::ConfidentialApplicationsGenerator
rake aborted!
NameError: uninitialized constant DoorkeeperSequel::ConfidentialApplicationsGenerator
D:/Ruby25-x64/lib/ruby/gems/2.5.0/bundler/gems/doorkeeper-sequel-945dc72250c8/lib/doorkeeper-sequel/tasks/doorkeeper-sequel.rake:25:in `block (3 levels) in <top (required)>'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
D:/Ruby25-x64/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
D:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
D:/Ruby25-x64/bin/rake:31:in `load'
D:/Ruby25-x64/bin/rake:31:in `<main>'
Tasks: TOP => doorkeeper_sequel:generate:confidential_applications

The weird thing is, I can see these tasks in rake --tasks.

What could be the reason?

Note: Against v2.0 and master tested.

:code_challenge does not inserted to DB

I don't know actually if this is related to this gem or directly to the core (doorkeeper-gem) but here is what happens:

  1. Client creates a request and fills client_id, client_secret, code_challenge and code_challenge_type.
  2. Server asks user to approve this request/login. If accepts, gem creates a new row in the DB without code_challenge and type. So they are NULL variables.
  3. Server returns authorization code and client asks for token with code_verifier parameter.
  4. Request fails because verification is incorrect. Database says no code challenge but request send a verifier.

Now, I remove code challenge (pkce) in first request and auth as plain. It just works. Now let me try another path:

  1. Client creates a request and fills client_id, client_secret.
  2. Server asks user to approve this request/login. If accepts, gem creates a new row in the DB without code_challenge and type. So they are NULL variables. Because we did not say we are going to use any challenge.
  3. Server returns successfully. Now we have tokens.
  4. Create second request from client and this time add challenge.
  5. Server accepts this token auth and insert challenge and type to DB.

As you can see, in the first place, doorkeeper does not insert code challenge and type to database.

I am using Sequel and this may be related to sequel support, however, im not sure.

Thanks,
Gencer.

Doorkeeper trying to look for table that doesn't exists yet.

I installed gem, install the doorkeeper and changed orm to sequel. Everything is fine until here. Now, whenever I try to generate migration like you pointed in your installation doc, I get an error that says:

Sequel::DatabaseError: PG::UndefinedTable: ERROR:  relation "oauth_access_grants" does not exist
LINE 1: SELECT * FROM "oauth_access_grants" LIMIT 1
                      ^

Basically, Doorkeeper trying to query oauth_access_grants before I migrate them. Now, problem is, When I deploy this app to production server, doorkeeper initialization file will be there and when it comes to migrate, it will fail.

How can we solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.