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

Cron support #31

Closed
JustinBeckwith opened this issue Aug 15, 2019 · 5 comments
Closed

Cron support #31

JustinBeckwith opened this issue Aug 15, 2019 · 5 comments
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@JustinBeckwith
Copy link
Contributor

We're quickly realizing that we like cron an awful lot. Would be awesome to have a cron ability with the existing bot framework tied into cloud scheduler.

@JustinBeckwith JustinBeckwith added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Aug 15, 2019
@orthros orthros self-assigned this Aug 15, 2019
@bcoe
Copy link
Contributor

bcoe commented Aug 19, 2019

I believe this would unblock #25?

@JustinBeckwith
Copy link
Contributor Author

Correct :)

@orthros
Copy link
Contributor

orthros commented Aug 20, 2019

I've done some thinking on this and here is a rough draft; any feedback is appreciated.

Security

As these bots are all Cloud Functions exposed to the internet, we need to be sure that the request invoking the function came from a trusted source. To secure this, each cron for a given function will use a KMS key to sign a blob of data. Then the cron makes an http POST request to the function's endpoint, with the blob of data as the body and the header X-RAB: <SIGNATURE>. The bootstrapper in gcf-utils will register an endpoints (/cron?) which verifies that the signature was signed by the "Cron" key in KMS before forwarding the request to the AppFn.

Limitations

The cron.yaml format does not (as far as I can tell) support custom headers or body payloads. This means each bot will need in it a file (.cron?) which contains the frequency in unix cron format. Then during the cloudbuild process, there is a step which, creates or updates the cron for each bot using gcloud.

@JustinBeckwith
Copy link
Contributor Author

@orthros this is done, right?

@JustinBeckwith
Copy link
Contributor Author

This is done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants