-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(bin) : refactor auth_jwt_secret function #5332
feat(bin) : refactor auth_jwt_secret function #5332
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.
I'm open to having the get_or_create logic in a separate method to make some things simpler
bin/reth/src/args/rpc_server_args.rs
Outdated
fn get_or_create_jwt_secret_from_path(path: &Path) -> Result<JwtSecret, JwtError> { | ||
if path.exists() { | ||
debug!(target: "reth::cli", ?path, "Reading JWT auth secret file"); | ||
JwtSecret::from_file(path) | ||
} else { | ||
info!(target: "reth::cli", ?path, "Creating JWT auth secret file"); | ||
JwtSecret::try_create(path) | ||
} | ||
} |
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 should just be a separate method, since it doesn't rely on the RpcServerArgs
at all
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 should just be a separate method, since it doesn't rely on the
RpcServerArgs
at all
Thank you for this. Can you please suggest me where i can write this function ?
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.
I guess we can put this in utils
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.
I guess we can put this in utils
Thank you. The function is now in utils !
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.
function looks good, but needs to be in CLI crate
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 contains a lot of unrelated changes,
perhaps it's easier to reopen this one with only the extracted function
based, ty lot boss! |
No description provided.