You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A couple of comments:
a) this is going to be a breaking change, as existing passwords stored with the current hashing function won't work anymore. How should we handle this? Should we include a migration tool from sha to argon?
b) the spacing around = is inconsistent. The standard we adopted in Genie is to favour whitespace for readability, so we use x = z, with spaces around =. Can you update please?
c) how is verify_password designed to be used as part of the public API?
function verify_password(stored::AbstractString, password::AbstractString)
if startswith(stored, "\$argon2id\$")
status = Sodium.crypto_pwhash_str_verify(
Vector{UInt8}(stored), password, UInt64(sizeof(password))
)
return status == 0
else
return stored == sha256(password)
end
end
b)
The whitespace was lost after applying the default Julia formatter in VS Code. It adds spaces around assignments but not around keyword arguments. I’ll see if I can change this, assuming it's reasonable to deviate from Julia’s standard style. But this is intentionally wanted, right?
a) yes, I think it makes sense. This should be an edge case really, like creating a new app but using an existing users table
b) yes, it's intentional. The Genie style is years older than Julia's "official" one. And given this, there's nothing worse than mixing different styles into a codebase (which basically amounts to no style guide at all). So for now we keep the style, unless there is an effort to migrate everything to a new style.
The issues being:
spacing around assignments (frankly I don't like the official guidelines here, this kind of thing is bad spacing: password=params(:password) |> hash_password),
explicit returns at end of functions - Genie's codebase doesn't use them (this makes things like returning html(...) nice and clean),
we use 2 spaces for indentation
I can edit these manually, it's not a lot. It would be great though to have a Genie linter/style guide, it's true!
@andreeco Merged! Thanks so much for the contribution and your patience!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.