-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: load token from shared config dir #51
Conversation
credentials/auth.go
Outdated
if err != nil { | ||
return err | ||
} | ||
|
||
args := append([]string{home}, validAuthPaths[0]...) | ||
f, err := os.OpenFile(filepath.Join(args...), os.O_CREATE|os.O_RDWR, 0644) | ||
f, err := os.OpenFile(filepath.Join(validAuthPaths[0]...), os.O_CREATE|os.O_RDWR, 0644) |
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.
Question - should we make sure to create the nested directory path if the file doesn't exist?
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.
another #lazyweb but what xdg.ConfigHome
looks like usually? (or APPDATA
)
I feel like at least the netlify
(and Config
for windows) directory needs to be created regardless?
how are we doing in CLI side?
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.
Commented on the structure in #51 (comment)
The CLI uses configstore to access the file so it handles directory creation https://github.com/yeoman/configstore/blob/ab81102b4917fda25d2e2ec616a00ea9e9227a36/index.js#L59
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.
Added another commit for this 1497e36
A follow up question - should we change the permissions for the file/directories to 0600
or 0640
to prevent others reading the file?
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.
looks like directories are 700 and file is 600 with CLI (aka configstore)?
https://github.com/yeoman/configstore/blob/ab81102b4917fda25d2e2ec616a00ea9e9227a36/index.js#L13-L14
I'd vote for being as consistent as possible with CLI here.
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.
Done in 2978889
9073e99
to
6ad3bb2
Compare
6ad3bb2
to
9b1c841
Compare
thanks for the PR!! overall looking good, left some questions so that I understand better |
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.
looks very good!!! thanks for this update 🎉 did you test locally for this? I happen to have a new laptop that hasn't installed anything, so I'm happy to try it out the whole flow if you want
I built the helper locally and was able to upload files with the dev version: For some reason I can't see them under the large media tab in the UI though. I'll look into it |
OK, so the files show up when I use the CMS. Our UI uses I'm confused, but it seems the credential helper works. |
Ok hope you don't mind my terrible sketch: Likely the reason that you're not seeing the images in "Netlify UI LM page" (left bottom in diagram) is that you don't have any reference to the pointer file with built site (step 6 didn't happen).
This is a documentation bug, this assets endpoint is sadly completely unrelated to the large media. Hope this explains! |
This is awesome! Thank you so much for explaining it to me 🚀 |
Please forgive my lack of
go
knowledge.This is pending #50 so I can test this on Windows.Kind of required for netlify/cli#1489.
In netlify/cli#1725 we changed the location of
config.json
without realizing it is referenced in this client and in https://github.com/netlify/netlify-lm-plugin.netlify/cli#1489 handles the plugin part, this PR is intended to handle the
go
client part.