-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: replace netrc with json #146
base: next
Are you sure you want to change the base?
Conversation
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.
adding an empty file here?
} | ||
} | ||
|
||
export async function isAuthorized() { |
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 and removeAllNetrcEntries
are imported and used in src/commands/logout/index.ts
|
||
await initializeSession() | ||
|
||
console.log(state) |
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.
do we need this log here?
const machines = await getNetrcCredentials() | ||
const creds = getCredentialsForMachine(machines, machineName) | ||
// If no environment variables, fall back to .storyblok/credentials.json | ||
const machines = await getCredentials() |
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.
in a clean environment, launching a login
will fail because getCredentials()
if it doesn't find the credentials.json
throws a filesystem error (handleFileSystemError
) that should be catch and handled here
This PR replaces the previous approach to save login credentials on
~/.netrc
file to a more comfortable~/.storyblok/credentials.json
simplifying the code required and avoiding compatibility issues with other python librariesWarning
This PR doesn't include multi-region sessions. This will be done in a separate PR.
Closes #137
How to test this PR
Login credentials now should be saved at
~/.storyblok/credentials.json
with no disruption on the login/logout functionality