{"id":13788065,"url":"https://github.com/anderseknert/opa-google-calendar","last_synced_at":"2025-03-20T02:32:22.630Z","repository":{"id":109367162,"uuid":"407086393","full_name":"anderseknert/opa-google-calendar","owner":"anderseknert","description":"Example integration of OPA using Google Calendar as a datasource","archived":false,"fork":false,"pushed_at":"2021-11-09T13:30:37.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T20:50:41.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Open Policy Agent","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anderseknert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-16T08:33:09.000Z","updated_at":"2022-12-29T15:31:47.000Z","dependencies_parsed_at":"2023-03-13T14:14:16.283Z","dependency_job_id":null,"html_url":"https://github.com/anderseknert/opa-google-calendar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-google-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-google-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-google-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-google-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anderseknert","download_url":"https://codeload.github.com/anderseknert/opa-google-calendar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538577,"owners_count":20468740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T21:00:35.853Z","updated_at":"2025-03-20T02:32:22.588Z","avatar_url":"https://github.com/anderseknert.png","language":"Open Policy Agent","funding_links":[],"categories":["Datasource Integrations"],"sub_categories":["Blogs and Articles"],"readme":"# OPA Google Calendar Integration\n\nCompanion code for the [Styra blog](https://blog.styra.com/blog/the-power-of-data-calendar-based-policy-enforcement) on integrating OPA with the Google Calendar API as a datasource.\n\n## Extract events from Google Calendar\n\n* Create a GCP service account. You do not need to change any defaults.\n* In your service account settings, click \"Keys\" and \"New key\". Download the credentials file.\n* Export the service account email as an env variable: `export SERVICE_ACCOUNT=opa-calendar@opa-lab.iam.gserviceaccount.com`\n* Export the private key as an env variable: `export SIGNING_KEY=$(cat credentials.json | jq -r .private_key)`\n* In Google Calendar, click the calendar you want to use and choose \"Settings and sharing\".\n* From the menu to the left, click \"Share with specific people\". Add the service account e-mail address.\n* From the menu to the left, click \"Integrate calendar\". Copy the Calendar ID value.\n* Export the calendar ID: `export CALENDAR_ID=\u003ccalendar ID\u003e`\n* Extract events and save to file: `opa eval --format raw --data events.rego data.google.calendar \u003e calendar.json`\n\n## Resources\n\n* [Google Calendar v3 API reference](https://developers.google.com/calendar/api/v3/reference)\n* [Event Resource Description](https://developers.google.com/calendar/api/v3/reference/events)\n* [Temporal OPA](https://github.com/mhausenblas/temporal-opa)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderseknert%2Fopa-google-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanderseknert%2Fopa-google-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderseknert%2Fopa-google-calendar/lists"}