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

Update ~/.enso/credentials file #9287

Merged
merged 8 commits into from
Mar 12, 2024

Conversation

MrFlashAccount
Copy link
Contributor

@MrFlashAccount MrFlashAccount commented Mar 5, 2024

Pull Request Description

This PR updates the content of ~/.enso/credentials file, where we store jwt token.
Now the content would look like this:

{
  "client_id": <id>, <- this is cognito app integration client id
  "access_token": <token>, <- jwt generated for current session
  "refresh_token": <token2>, <- refresh token taken from initAuth flow
  "refresh_uri": <token> <- "https://cognito-idp.eu-west-1.amazonaws.com/"
  "expire_at": <iso datetime> <- datetime when the access token will go expire
}

Closes: enso-org/cloud-v2#934

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@MrFlashAccount MrFlashAccount self-assigned this Mar 5, 2024
@MrFlashAccount MrFlashAccount added CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard labels Mar 5, 2024
@MrFlashAccount MrFlashAccount force-pushed the wip/sergeigarin/update-enso-credentials-file branch from 5feea79 to c2f6dcf Compare March 5, 2024 15:29
@MrFlashAccount
Copy link
Contributor Author

We had a conversation with @radeusgd, this PR will be merger after @radeusgd adapts the parser for the new format.

Copy link
Contributor

@somebody1234 somebody1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly nits


const expireAt = (() => {
const date = new Date(0)
date.setUTCSeconds(expirationTimestamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between this and new Date(expirationTimestamp * 1_000) btw?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result is the same, just used to write that way. Not sure which solution is better though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably subjective, the main differences would be the added line and the function call statement (as opposed to a function call expression)

Copy link
Contributor

@somebody1234 somebody1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA ✅

  • ~/.enso/credentials exists and contains the correct keys
  • ~/.enso/credentials is deleted when signing out

I'm assuming testing isn't strictly necessary on other OSes as this is just modifying existing functionality - but of course it doesn't hurt to test on other platforms

@MrFlashAccount MrFlashAccount force-pushed the wip/sergeigarin/update-enso-credentials-file branch from 4594e3e to 16e76fa Compare March 8, 2024 16:48
@MrFlashAccount MrFlashAccount force-pushed the wip/sergeigarin/update-enso-credentials-file branch from 16e76fa to 63622f7 Compare March 8, 2024 16:48
@MrFlashAccount MrFlashAccount merged commit 6bf37b3 into develop Mar 12, 2024
33 of 35 checks passed
@MrFlashAccount MrFlashAccount deleted the wip/sergeigarin/update-enso-credentials-file branch March 12, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants