Ariel Shaqed (Scolnicov)
09/09/2021, 7:36 AMfs:AttachRepositoryNamespace
on *
for any policy that allows fs:CreateRepository
". Three possibilities that I can see:
• Golang all the way! Pros: probably more readable, easier to get right. uses a good programming language. Cons: (very) poor ops experience: not part of the migration library that we use (or, indeed, any reasonable migration library).
• PostgreSQL jsonb
SQL whackiness. Write 100% safe pure-SQL code that updates the table. Pros: Perfect ops experience. Cons: The function itself will be tricky to write - it needs to handle IAM-style wildcards (*
, ?
) entirely correctly.
• PostgreSQL jsonb
SQL whackiness but less whacky. Write SQL code that works on every reasonable IAM policy, but fails if the policy uses special (unused!) characters in action names. Fail migration if such a policy is found (unlikely; such a policy includes an action that is unused!). Specifically, fail for actions that include SQL-style wildcards (_
. %
); there are no such actions in lakeFS (or anywhere in IAM, really).
Unless I hear strenuous objections -- hopefully accompanied by suggestions how to do it better -- I am going with the third option.
(Also posting to the PR, of course.)Itai Admi
09/09/2021, 7:42 AMAriel Shaqed (Scolnicov)
09/09/2021, 8:18 AM_
or
?` in the action string. There is no constraint on auth_polciies
that enforces only legal action strings, so it is possible for a user to generate such a policy.