feat(postgresql): support WITH INHERIT FALSE on role membership grants (PostgreSQL 16+)#1
Open
matthewgreenwaldagility wants to merge 19 commits into
Open
feat(postgresql): support WITH INHERIT FALSE on role membership grants (PostgreSQL 16+)#1matthewgreenwaldagility wants to merge 19 commits into
matthewgreenwaldagility wants to merge 19 commits into
Conversation
Signed-off-by: Matthew Greenwald <matthew.greenwald@agilityrobotics.com>
Signed-off-by: Matthew Greenwald <matthew.greenwald@agilityrobotics.com>
Signed-off-by: Matthew Greenwald <matthew.greenwald@agilityrobotics.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.2 to 6.0.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@671740a...57e3a13) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@b45d80f...4907a6d) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: 4.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…endabot/github_actions/docker/login-action-4.1.0 chore: bump docker/login-action from 4.0.0 to 4.1.0
…endabot/github_actions/codecov/codecov-action-6.0.0 chore: bump codecov/codecov-action from 5.5.2 to 6.0.0
…contrib#349) Bumps [github.com/antchfx/xpath](https://github.com/antchfx/xpath) from 1.2.0 to 1.3.6. - [Release notes](https://github.com/antchfx/xpath/releases) - [Commits](antchfx/xpath@v1.2.0...v1.3.6) --- updated-dependencies: - dependency-name: github.com/antchfx/xpath dependency-version: 1.3.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.3 to 5.0.5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@cdf6c1f...27d5ce7) --- updated-dependencies: - dependency-name: actions/cache dependency-version: 5.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ssplane-contrib#364) Bumps [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb) from 1.9.8 to 1.10.0. - [Release notes](https://github.com/microsoft/go-mssqldb/releases) - [Changelog](https://github.com/microsoft/go-mssqldb/blob/main/CHANGELOG.md) - [Commits](microsoft/go-mssqldb@v1.9.8...v1.10.0) --- updated-dependencies: - dependency-name: github.com/microsoft/go-mssqldb dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ontrib#368) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@bbbca2d...043fb46) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ntrib#369) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.1 to 4.35.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@c10b806...68bde55) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lane-contrib#356) Bumps distroless/static from `f512d81` to `e3f9456`. --- updated-dependencies: - dependency-name: distroless/static dependency-version: nonroot dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…e-contrib#360) Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.39.0 to 1.41.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go@v1.39.0...v1.41.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-version: 1.41.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ib#365) * chore: bump github.com/lib/pq from 1.11.2 to 1.12.3 Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.11.2 to 1.12.3. - [Release notes](https://github.com/lib/pq/releases) - [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md) - [Commits](lib/pq@v1.11.2...v1.12.3) --- updated-dependencies: - dependency-name: github.com/lib/pq dependency-version: 1.12.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: use pqerror package for pq 1.12, pq.ErrorCode type is deprecated Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carl Henrik Lunde <chlunde@ifi.uio.no>
… 2.2.1 (crossplane-contrib#366) * chore: bump github.com/crossplane/crossplane-runtime/v2 Bumps [github.com/crossplane/crossplane-runtime/v2](https://github.com/crossplane/crossplane-runtime) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/crossplane/crossplane-runtime/releases) - [Changelog](https://github.com/crossplane/crossplane-runtime/blob/main/RELEASE.md) - [Commits](crossplane/crossplane-runtime@v2.1.0...v2.2.1) --- updated-dependencies: - dependency-name: github.com/crossplane/crossplane-runtime/v2 dependency-version: 2.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: regenerate CRDs with controller-gen v0.20.0 Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no> * chore: golangci: two deprecated function we have to continue using Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carl Henrik Lunde <chlunde@ifi.uio.no>
…rossplane-contrib#343) * feat(postgres): Add support for setting STRATEGY during db creation Add PostgreSQL Database strategy support for template-based database creation and make its lifecycle explicit in the API. The new strategy field is treated as create-time-only, and validated so updates do not silently drift from the real database state. Fail fast when strategy is requested against PostgreSQL versions older than 15 instead of letting CREATE DATABASE fail with a less clear SQL error. closes crossplane-contrib#341 Signed-off-by: Alexandros Dorodoulis <aldor94@gmail.com> * fix: correct kubebuilder validation rules Signed-off-by: Alexandros Dorodoulis <aldor94@gmail.com> --------- Signed-off-by: Alexandros Dorodoulis <aldor94@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes crossplane-contrib#359
What this does
Adds a
withInheritboolean field tospec.forProvideron the PostgreSQLGrantresource, enablingWITH INHERIT FALSEon role membership grants — a feature introduced in PostgreSQL 16.When
withInheritis omitted, behaviour is unchanged. When combined withwithOption: ADMIN, the emitted SQL isWITH ADMIN OPTION, INHERIT FALSE.The field is only valid on
memberOfgrants — setting it on a privilege grant (privilegesfield) returns a validation error.Motivation
The primary use case is RDS PostgreSQL with IAM database authentication. Without this field, granting a master user membership in an
adminrole that holdsrds_iamcreates a transitive chain (master_user → admin → rds_iam), which causes RDS to route all connections for that user through PAM/IAM token verification, breaking password authentication.WITH INHERIT FALSEgrants membership (satisfyingALTER DEFAULT PRIVILEGES FOR ROLE admin) without inheritingrds_iam.Changes
apis/cluster/postgresql/v1alpha1/grant_types.goWithInherit *boolfield toGrantParametersapis/cluster/postgresql/v1alpha1/zz_generated.deepcopy.gopackage/crds/postgresql.sql.crossplane.io_grants.yamlpkg/controller/cluster/postgresql/grant/reconciler.gomembershipWithClauseshelper;selectGrantQueryfilterspg_auth_members.inherit_optionwhen set;createGrantQueriesuses new helper; validation rejectswithInheriton privilege grantspkg/controller/cluster/postgresql/grant/reconciler_test.goWithInheritnil/true/false for bothObserveandCreateexamples/cluster/postgresql/grant-with-inherit-false.yamlMakefileGOLANGCILINT_VERSIONfrom2.1.2→2.10.1to match CI and support Go 1.26README.mdSchemato PostgreSQL resource list, fix example pathsTesting
make reviewablepasses (generate + lint + all 26 test packages).The
inherit_optioncolumn onpg_auth_memberswas added in PostgreSQL 16. SettingwithInheriton an older cluster will result in a SQL error, which is the expected and documented behaviour.