-
Notifications
You must be signed in to change notification settings - Fork 451
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
Implement default jwt-secret paths #5979
base: master
Are you sure you want to change the base?
Implement default jwt-secret paths #5979
Conversation
@MarekM25, any feedback? |
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.
Would be good to add some tests
src/Nethermind/Nethermind.Core/Authentication/JwtAuthentication.cs
Outdated
Show resolved
Hide resolved
string? homeDir = Environment.GetEnvironmentVariable("HOME"); | ||
|
||
if (string.IsNullOrEmpty(homeDir)) | ||
throw new Exception("HOME environment variable is not set"); |
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.
We also need to find better exception type 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.
Create a new custom Exception? Maybe one of these?
- NotFoundException
- NotSetException
- EnviormentVariableNotSet
- EnviormentVariableNotFound
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.
My candidates would be either InvalidOperationException
or System.Configuration.ConfigurationException
src/Nethermind/Nethermind.Core/Authentication/JwtAuthentication.cs
Outdated
Show resolved
Hide resolved
…t-secret_paths' into feature/5948_implement_default_jwt-secret_paths
Added some test, and broke out the the OS filePaths to a |
Marking as draft for now until the spec finalizes. I'll back to this shortly. @Zexuz Thanks for contributing. |
Ping |
Resolves #5948
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Testing this is hard since it's all IO methods, but since it's now a more complex logic flow, maybe its worth it?
Documentation
Requires documentation update
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
If yes, fill in the details here. Remove if not applicable.
Remarks
Should we update the docs and/or the release notes with the new files paths?