No commit activity in last 3 years
No release in over 3 years
A mountable Rails Engine for receiving HTTPS Push Notifications from watched Google Calendar Resources and adding messages to AWS Queues for consumption by production, staging, development and test environments
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.2
 Project Readme

THIS GEM IS NOT COMPLETE

CalendarToQueue

Mountable endpoint for Calendar Push Notifications from Google Calenders that are placed into AWS Message Queues or a database for consumption.

Google Calendar Push notifications can only be sent to verified domains over HTTPS. Your HTTPS domain must have a valid certificate. Invalid certificates include:

  • Self-signed certificates.
  • Certificates signed by an untrusted source.
  • Certificates that have been revoked.
  • Certificates that have a subject that doesn't match the target hostname.

This mountable rails engine can be hosted on a valid SSL domain and distribute Google Calendar Push notifications for different Rails environments, which may not have SSL available, such as your local development environment.

Installation

General Installation

1 - Add to your Gemfile:

gem 'calendar-to-queue'

2 - Install the gem:

bundle install

3 - Install Migrations

$ rake calendar_to_queue:install:migrations
$ rake db:migrate

4 - Mount the engine

# config/routes.rb
Rails.application.routes.draw do
  mount CalendarToQueue::Engine, at: "/"
end

5 - Configure AWS Credentials and Region

# config/initializers/calendar_to_queue.rb
CalendarToQueue.configure do |config|
  config.aws_access_key_id     = ENV['AWS_ACCESS_KEY_ID']
  config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
  config.aws_region            = 'us-east-1'
end

Watching Calendar Resources

When a push notification is recieved from Google Calendars, the push will be processed based on parameters in the token provided when the calendar resource was watched. Two behaviors are implemented: persist the pushes to the database and send the push to AWS Simple Queue Service.

Persist

To persist a push, set the following in the token:

persist=true

Send to AWS SQS

To send a push to AWS SQS, set the following in the token:

queue=<aws-queue-name>

If the queue does not exist in the region specified, it will be created.

Resources

TODO

  • Examples of SQS message format
  • Link to sample application code
  • Remove authentication & authorization configuration
  • Examples of how to wire into after-save callbacks on persisted pushes for immediate processing
  • Document logging

Contributors

License

MIT License. Copyright 2016.