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

#7746 jwtfile path correction #7765

Open
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

ssonthal
Copy link
Contributor

@ssonthal ssonthal commented Nov 18, 2024

Fixes #7746

Changes

  • List the changes

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@ssonthal ssonthal marked this pull request as ready for review November 18, 2024 13:45
@ssonthal ssonthal mentioned this pull request Nov 18, 2024
16 tasks
@ssonthal
Copy link
Contributor Author

@rubo / @LukaszRozmej this PR includes the previously suggested changes. Can continue the thread here.

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

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

I think this change might break setups in one case: if someone used dataDir + jwtSecret, it won’t read the old JWT anymore.

There was a more interesting approach in this pull request: #5979.

This approach will have to be discussed with other teams.

@obasekiosa
Copy link
Contributor

obasekiosa commented Nov 19, 2024

I think this change might break setups in one case: if someone used dataDir + jwtSecret, it won’t read the old JWT anymore.

There was a more interesting approach in this pull request: #5979.

This approach will have to be discussed with other teams.

@ssonthal

True it would break setups, (same as changing the JwtSecretFile config would break setups unless you move the secrete to the new location and tell the consensus client about it).

Note:
if (x) implies that the result of line x is true the proceed otherwise do not.

So A way around that

  1. if jwt-secret file path isn't specified then
  2. if (1) check if jwt-secret file already exists in previous default directory (which was hard coded so should be a straightforward check).
  3. if (2) then log a warning with the specified expected change and the continue with the old secret (or maybe move it to expected dir, and log that too!, moving makes sense because its a file managed by the client not the user.)
  4. if (2) is not true then continue with the auto generation in the data directory path if it doesn't already exist.
  5. if (1) is not true then continue as expected in (4).

Also, note there a bit of other things being generated in this directory, even after the change, you might want to change them too in another pr after a bit of discussion on what they are.

@ssonthal
Copy link
Contributor Author

I think this change might break setups in one case: if someone used dataDir + jwtSecret, it won’t read the old JWT anymore.
There was a more interesting approach in this pull request: #5979.
This approach will have to be discussed with other teams.

@ssonthal

True it would break setups, (same as changing the JwtSecretFile config would break setups unless you move the secrete to the new location).

Note: if (x) implies that the result of line x is true the proceed otherwise do not.

So A way around that

  1. if jwt-secret file path isn't specified then
  2. if (1) check if jwt-secret file already exists in previous default directory (which was hard coded so should be a straightforward check).
  3. if (2) then log a warning with the specified expected change and the continue with the old secret (or maybe move it to expected dir, and log that too!, moving makes sense because its a file managed by the client not the user.)
  4. if (2) is not true then continue with the auto generation in the data directory path if it doesn't already exist.
  5. if (1) is not true then continue as expected in (4).

Also, note there a bit of other things being generated in this directory, even after the change, you might want to change them too in another pr after a bit of discussion on what they are.

I will start working in this direction, then.

@ssonthal
Copy link
Contributor Author

@obasekiosa can you check once now?

@obasekiosa
Copy link
Contributor

@ssonthal
still making changes?

@ssonthal
Copy link
Contributor Author

Nope. You can review now.

@obasekiosa
Copy link
Contributor

Nope. You can review now.

@ssonthal

there are still requested but pending changes.
let me know if you can't see any on your end.

@ssonthal
Copy link
Contributor Author

@obasekiosa no I can't see any request changes on my end.

@obasekiosa
Copy link
Contributor

@obasekiosa no I can't see any request changes on my end.

apologies, seems they've been on pending on my end.

you should see them now.

@ssonthal
Copy link
Contributor Author

@obasekiosa can you check now?

Copy link
Contributor

@obasekiosa obasekiosa left a comment

Choose a reason for hiding this comment

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

lgtm

@obasekiosa
Copy link
Contributor

@ssonthal

might want to pull master
pull this branch also

merge master into this branch and push.

ssonthal and others added 26 commits November 28, 2024 00:49
@ssonthal
Copy link
Contributor Author

ssonthal commented Nov 28, 2024

@ssonthal

might want to pull master pull this branch also

merge master into this branch and push.

@obasekiosa Done. Good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants