-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add Google Sheets exporter with login #118
Conversation
// https://console.developers.google.com/apis/credentials | ||
GOOGLE_CLIENT_ID: JSON.stringify(process.env.GOOGLE_CLIENT_ID), | ||
GOOGLE_CLIENT_SECRET: JSON.stringify(process.env.GOOGLE_CLIENT_SECRET), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brafdlog Need to register these values in Google, put them as Repository Secrets, and write them to Env Vars in our Github Actions.
Of course, I created them myself, maybe I can give you access to my registered app in Google, or maybe you register it again yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still embed the secret in the built code. Which oauth flow did you use? The installed applications flow looks like that one we should use and in that flow the client secret is not considered a secret (See https://developers.google.com/identity/protocols/oauth2#installed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0fcf65c
to
2a5184f
Compare
I opened #120 to continue to work in the backend. I will comment on this PR later, but you can start to look. |
<div v-else> | ||
<v-btn | ||
color="primary" | ||
@click="login()" | ||
> | ||
Login to Google | ||
</v-btn> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user is not logged in, this button will display.
Both this button and the dropdown are under the vForm
since the two are changing the config
. The login button produces the credentials
and saves them in the config
, then the dropdown uses the credentials
to get a list of spreadsheets from the user account.
Later, with Vue 3 we can use Suspance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I changed it to be statefull by enum
, the commit is on the queue.
@@ -52,8 +48,7 @@ export interface JsonConfig extends OutputVendorConfigBase { | |||
|
|||
export interface GoogleSheetsConfig extends OutputVendorConfigBase { | |||
options: { | |||
credentialsFilePath: string; | |||
sheetName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it for now and use a const value
// https://console.developers.google.com/apis/credentials | ||
GOOGLE_CLIENT_ID: JSON.stringify(process.env.GOOGLE_CLIENT_ID), | ||
GOOGLE_CLIENT_SECRET: JSON.stringify(process.env.GOOGLE_CLIENT_SECRET), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still embed the secret in the built code. Which oauth flow did you use? The installed applications flow looks like that one we should use and in that flow the client secret is not considered a secret (See https://developers.google.com/identity/protocols/oauth2#installed)
src/originalBudgetTrackingApp/export/outputVendors/googleSheets/googleSheets.ts
Outdated
Show resolved
Hide resolved
…s/googleSheets.ts Oh no, I'm still falling for it ... In my company, I wrote all `budge` for embedded `badge`... Co-authored-by: Jonathan <brafdlog@gmail.com>
close #84