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

Put client credentials somewhere #29

Closed
flavorjones opened this issue Oct 25, 2018 · 1 comment
Closed

Put client credentials somewhere #29

flavorjones opened this issue Oct 25, 2018 · 1 comment
Assignees
Projects

Comments

@flavorjones
Copy link
Owner

flavorjones commented Oct 25, 2018

Client credentials are hardcoded to be in a file named credentials.json in the local directory. Need to put these somewhere else, maybe ~/.calendar-assistant.client_creds.json or something.

I want to keep these creds separate from the user tokens because, if and when we erect a web UI on top of this, the client creds are global, and the user tokens are user-specific.

We should also make sure that this file is chmodded properly to prevent other users from seeing it (similar to ssh keys, should be 600 or similar).

@flavorjones flavorjones added this to In progress in Backlog Oct 25, 2018
@flavorjones flavorjones changed the title package up as a Gem Put client credentials somewhere Oct 25, 2018
@flavorjones flavorjones self-assigned this Oct 29, 2018
@flavorjones
Copy link
Owner Author

flavorjones commented Oct 30, 2018

Proposal:

$ calendar-assistant help setup

Description:
  Link your local calendar-assistant installation to a Google API Client.
  
  This command will walk you through setting up a Google Cloud Project,
  enabling the Google Calendar API, and saving the credentials necessary
  to access the API on behalf of users.

  If you already have downloaded client credentials, you don't need to run
  this command. Instead, rename the downloaded JSON file to:
  
  > ~/.client_credentials.client

so:

$ calendar-assistant setup

[launches https://developers.google.com/calendar/quickstart/ruby]

Please click on "ENABLE THE GOOGLE CALENDAR API" and either create a new project
or select an existing project. If you create a new project, name it something
like "yourname-calendar-assistant" so you remember why it exists.

Ready to continue? (Y/n) >

Now click "DOWNLOAD CLIENT CONFIGURATION" to download the credentials to local disk.

Ready to continue? (Y/n) >

Paste the contents of the downloaded file here (it should be a complete JSON object):

> {"installed":{"client_id":...}}

[performs some sanity checks, then saves this info to `~/.calendar-assistant.client`.

OK! Your next step is to run `calendar-assistant authorize`.

Other activities that should be done as part of this story

  • update the authorize command help to be less pedantic and simply point to this command.
  • update the exception string when credentials aren't found.
  • on access, ensure that the file is chmodded to 600

flavorjones added a commit that referenced this issue Oct 30, 2018
Backlog automation moved this from In progress to Done Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Backlog
  
Done
Development

No branches or pull requests

1 participant