-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to set null secret value for Applications if it's public #1727
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, also, fwiw, I would've been happy to work on a PR, but was a bit stumped by the test failures. With the gemfile change I'll see if I can get the tests running locally with this branch.
0e88e2c
to
2ba429c
Compare
The only thing which makes me worry is legacy apps which already had NOT NULL constraint. If they will add a public app DB will throw an error for NULL secret. I have to think how to make these changes backward compatible. |
Maybe it can be done via: def self.null_secret_allowed?
return @null_secret_allowed if defined?(@null_secret_allowed)
@null_secret_allowed = model_class.columns.detect { |column| column.name == "secret" }&.null
end UPD: yeah we already have almost similar check for PKCE - |
Perhaps we could modify the migration / generator for enabling public clients to check that secret is nullable? |
You mean add a custom constraint into database migration? I already added a check on a model level, but custom constraints are DB-dependant so I;m not sure if we wanna to support all possible variants. |
020bcd2
to
5ccff1d
Compare
I mean, create a migration that can be applied (like adding PKCE) that drops the not-null constrain on client_secret, since it's currently marked as not-null, and we can say that that's how you enable public clients. |
@@ -23,7 +23,7 @@ gem "rubocop-rspec", require: false | |||
gem "bcrypt", "~> 3.1", require: false | |||
|
|||
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby | |||
gem "sqlite3", "~> 2.0", platform: %i[ruby mswin mingw x64_mingw] | |||
gem "sqlite3", "~> 1.4", platform: [:ruby, :mswin, :mingw, :x64_mingw] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tried this locally on main
and still can't get the tests passing, per #1721
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me and GitHub CI 🤔
Sorry I don't use dev-containers / docker / other local setups, not sure what can happen there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't either!
3d74d83
to
f282c25
Compare
Aims to fix #1724