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

Investigate ways to communicate with Google Calendar API #11

Closed
nandanmen opened this issue Oct 18, 2020 · 10 comments
Closed

Investigate ways to communicate with Google Calendar API #11

nandanmen opened this issue Oct 18, 2020 · 10 comments
Assignees
Labels

Comments

@nandanmen
Copy link
Collaborator

Ideally we would want to synchronize the data in the user's Google Calendar with Firebase, so that the availabilities will live update when events are added/removed.

@jamesmengo
Copy link
Contributor

https://developers.google.com/calendar/quickstart/go

@kx-chen @jackyzha0 @gokcedilek

I've created a branch following this article, but I'm still quite unfamiliar with golang best practices so:

  1. How you guys would like to structure this (create a subfolder for clients?)
  2. Are there any packages that are unnecessary that have been added?

We can either discuss here or I can open an empty PR for a Request for Comments

@jamesmengo
Copy link
Contributor

jamesmengo commented Oct 21, 2020

#15

Note that credentials.json has been stored in Google Drive

How to use

  1. run: go run clients/quickstart.go from the directory
  2. Follow the link in the console which opens up the oAuth flow
  3. Click accept until you're redirected to Google. (This was just used as a test redirect URL). The token should be part of the URL (we can work on improving this of course, there's stuff before and after the token that you don't want to include)
  4. Enter the token into terminal
  5. Token.json will be saved

@jackyzha0
Copy link
Contributor

folders in Go create submodules, so if we do go down this route, the folder could be renamed to gcal and it would ideally be a module we can reuse in the main logic of our backend

@jackyzha0
Copy link
Contributor

Go cleans up unused deps so you shouldn't need to worry about it!

@jamesmengo
Copy link
Contributor

folders in Go create submodules, so if we do go down this route, the folder could be renamed to gcal and it would ideally be a module we can reuse in the main logic of our backend

What are the other options here?

@bobheadxi
Copy link
Member

bobheadxi commented Oct 21, 2020

Note that credentials.json has been stored in Google Drive

I would recommend putting this somewhere not in the Projects drive (which has very liberal access), and also you should immediately invalidate and regenerate your key, since it is still available in Git history: c0e7c4c

Why we don't put secrets in Drive: https://docs.ubclaunchpad.com/handbook/tools/drive

@jackyzha0
Copy link
Contributor

folders in Go create submodules, so if we do go down this route, the folder could be renamed to gcal and it would ideally be a module we can reuse in the main logic of our backend

What are the other options here?

Honestly this is probably the most idiomatic way to do it in Go and probably cleanest way to go about it

If we kept GCal logic spread throughout our code, that's a lot of coupling

@nandanmen
Copy link
Collaborator Author

@bobheadxi Any recommendations where we should put these vulnerable files?

@nandanmen
Copy link
Collaborator Author

#15

Note that credentials.json has been stored in Google Drive

How to use

1. run: `go run clients/quickstart.go` from the directory

2. Follow the link in the console which opens up the oAuth flow

3. Click accept until you're redirected to Google. (This was just used as a test redirect URL). The token should be part of the URL (we can work on improving this of course, there's stuff before and after the token that you don't want to include)

4. Enter the token into terminal

5. Token.json will be saved

Can you add this to the PR description? Would be easier to access for reviewers.

@bobheadxi
Copy link
Member

Any recommendations where we should put these vulnerable files?

Unfortunately not at the moment 😞 ubclaunchpad/rocket2#557 (@SarahBornais) is an idea, but that won't be available for a while. I would recommend that this file not be shared at all:

  • For development, each person should have their own integration set up (to avoid messing up each others' setups)
  • For deployment, only one person needs to manage the integration

If you really want to share it, I would keep it on someone's personal drive and just share the specific file only

@nandanmen nandanmen linked a pull request Oct 21, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants