Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update permission groups in profiles #145

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

simpsora
Copy link

A lot of new permission groups have been added since the last time the profiles in cf-vault were created.

This PR contains 3 changes:

  • Updated permission groups in add.go
  • A script to generate the changes above based on an API call
  • A small improvement to an error message

Ideally the permission groups could be externalized to their own files for easy updating in the future (but my Golang isn't strong enough for that).

I have confirmed that this works on my local, the new permission groups are used once the profiles have been re-added.

Cheers!

This script enumerates permission policies from Cloudflare's API and then writes them to a format that can be copy & pasted into `add.go` in this project.

It's a bit ugly, it has a bunch of duplication and could be done better, but it gets the job done.

In future, it might be nice for the policies to be externalized into their own files (toml or whatever) that can easily be updated, rather than having to copy/paste sections into a file.
@jacobbednarz jacobbednarz merged commit 46191e7 into jacobbednarz:master Jun 27, 2023
6 checks passed
@jacobbednarz
Copy link
Owner

i'll have a look in future at pulling out the permissions automatically instead of this manual mapping since it is error prone and tough to keep in sync.

@simpsora simpsora deleted the new-permissions branch June 27, 2023 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants