crossplane-contrib / provider-sql

An SQL provider for @crossplane
https://crossplane.io
Apache License 2.0
100 stars 57 forks source link

postgres: Expand grant privileges where required #144

Closed iainlane closed 11 months ago

iainlane commented 11 months ago

Inside postgresql, some privileges are altered when issuing a GRANT, for example ALL is expanded to CREATE, TEMPORARY, CONNECT.

When we observe the grant, we query privileges on the database to see if the ones in the grant exist. Given that they are expanded, we can't simply query for what the user gave us. Expand the privileges which need expanding before we make the query.

Closes: #92

How has this code been tested

Duologic commented 11 months ago

The unit test seems to fail, mind having a look @iainlane ?

iainlane commented 11 months ago

Hmm, it works here 🤔

image

I'll take a look later and see if CI does something different to me.

iainlane commented 11 months ago

@Duologic I found the cause, nondeterministic map iteration order, should be fixed in e761eaa, could you take a look please?