Skip to content

Max values for settings #82

Open
Open
@steve-chavez

Description

@steve-chavez

Problem

Found an user doing the following for an API role:

alter role service_role set statement_timeout = '15min';

Which makes no sense because the API roles should are bounded by HTTP timeouts. Cloudflare for example enforces a 100 second timeout.

Proposal 1

Enforce max values for role settings. For this case we could do:

supautils.role_max_settings = '{"service_role": { "statement_timeout": { "max": "100s"}}}'

If the user surpasses the setting then we'd fail and show an error message.

Proposal 2

Not sure if minimum values would make sense. But if so maybe we could use a pg range to keep the config shorter:

supautils.role_settings_bounds = '{"statement_timeout": { "service_role": "[5,100)", "anon": "[5,30)" }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions