Currently a user can register a hook function regardless of whether the necessary parameters are enabled. For instance, a user can register a clientauth function without setting pgtle.enable_clientauth or pgtle.clientauth_db_name, both of which are needed to enable the clientauth feature. This can be confusing for users who are not familiar with the feature.
Describe the proposal
Emit a WARNING when registering a hook function if the parameters aren't enabled.
Passcheck: warn if pgtle.enable_password_check is OFF or if pgtle.passcheck_db_name is not the current database
Clientauth: warn if pgtle.enable_clientauth is OFF or if pgtle.clientauth_db_name is not the current database
These warnings will help to preempt configuration errors.
Describe the problem
Currently a user can register a hook function regardless of whether the necessary parameters are enabled. For instance, a user can register a clientauth function without setting
pgtle.enable_clientauth
orpgtle.clientauth_db_name
, both of which are needed to enable the clientauth feature. This can be confusing for users who are not familiar with the feature.Describe the proposal
Emit a WARNING when registering a hook function if the parameters aren't enabled.
pgtle.enable_password_check
is OFF or ifpgtle.passcheck_db_name
is not the current databasepgtle.enable_clientauth
is OFF or ifpgtle.clientauth_db_name
is not the current databaseThese warnings will help to preempt configuration errors.
Relevant code: https://github.com/aws/pg_tle/blob/main/pg_tle--1.1.1.sql#L601-L630
Describe alternatives
Currently a user can read the documentation https://github.com/aws/pg_tle/blob/main/docs/04_hooks.md to debug their configuration. However we should still try to make the user experience smoother with some helpful hints.