Closed nbulaj closed 2 months ago
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 - pkce_supported?
Perhaps we could modify the migration / generator for enabling public clients to check that secret is nullable?
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.
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.
Aims to fix #1724