simonw / iam-definitions-datasette

IAM definitions published using Datasette
https://iam-definitions.vercel.app/
3 stars 0 forks source link

Also show history, using git-history #1

Open simonw opened 2 years ago

simonw commented 2 years ago

This seems like a fun opportunity to use git-history against https://github.com/salesforce/policy_sentry/commits/master/policy_sentry/shared/data/iam-definition.json

simonw commented 2 years ago

I couldn't get this to work, and I have a hunch it may be because that repository uses branches and doesn't have a linear history:

git-history file iam.db \
  policy_sentry/shared/data/iam-definition.json \
  --id service --id privilege \
  --convert '
data = json.loads(content)
for service, stuff in data.items():
    for _, privilege in stuff["privileges"].items():
        privilege["service"] = service
        yield privilege
' --branch master