Skip to content

Example integration of OPA using Google Calendar as a datasource

License

Notifications You must be signed in to change notification settings

anderseknert/opa-google-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPA Google Calendar Integration

Companion code for the Styra blog on integrating OPA with the Google Calendar API as a datasource.

Extract events from Google Calendar

  • Create a GCP service account. You do not need to change any defaults.
  • In your service account settings, click "Keys" and "New key". Download the credentials file.
  • Export the service account email as an env variable: export [email protected]
  • Export the private key as an env variable: export SIGNING_KEY=$(cat credentials.json | jq -r .private_key)
  • In Google Calendar, click the calendar you want to use and choose "Settings and sharing".
  • From the menu to the left, click "Share with specific people". Add the service account e-mail address.
  • From the menu to the left, click "Integrate calendar". Copy the Calendar ID value.
  • Export the calendar ID: export CALENDAR_ID=<calendar ID>
  • Extract events and save to file: opa eval --format raw --data events.rego data.google.calendar > calendar.json

Resources

About

Example integration of OPA using Google Calendar as a datasource

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published