refactor: Use PublicKey
and Signature
as parameters #33
No reviewers
Labels
No labels
Good First Issue
Help wanted
Kind/Breaking
Kind/Bug
Kind/Bug Fix
Kind/CI-CD
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Question
Kind/Security
Kind/Testing
Reviewed
Accepted
Reviewed
Confirmed
Reviewed
Declined
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Approved
Status
Blocked
Status
Inactive
Status
Need More Info
Status
Waiting On Author
Status
Waiting On Review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: OxideTalis/oxidetalis#33
Loading…
Reference in a new issue
No description provided.
Delete branch "awiteb/public-key_and_siganture_as_parameters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix #21
Changes
salvo_oapi::Extractible
andsalvo_oapi::EndpointArgRegister
forPublicKey
salvo_oapi::ToParameters
forSignature
Notes
I did not implement
salvo_oapi::ToParameters
forPublicKey
because it willnot be used as an OpenAPI parameter. Instead, Salvo will register it using the
EndpointArgRegister
trait.Similarly, I did not implement
salvo_oapi::EndpointArgRegister
forSignature
because it will not be used as an argument in the endpoint. Instead, the
signature will be verified by the signature middleware, and we will only use it
as a parameter.
Although there is an existing
salvo_oapi::Extractible
implementation forSignature
, it is currently unreachable. Thesalvo_oapi::ToParameters
requires it unnecessarily. If
salvo_oapi::ToParameters
no longer requires itin the future, I will remove it. I did not add a FIXME because its removal is
uncertain, and there is an open issue regarding this matter here,
which has not yet received a response.
serde_json
to be shared dependencie 9f3fd659d2serde_json
&salvo_core
tocore
dependencies 6fc14d380bpublic_key_check
2b282cbec6PublicKey
andSignature
1d0268c501Signature
as a openAPI parameter 531e27ab2cPublicKey
as an argument and openapi docyou can fix the link to the salvo issue in the PR description
...regarding this matter [here][issue1]
.Beside that, this is okay. though I notice that in
signature_check
middleware, we still useutils::extract_signature
andutils::extract_public_key
. can't we use these directly in the parameter? maybe we would need to implement the extraction correctly forSignature
Sorry, here it's https://github.com/salvo-rs/salvo/issues/838
No, because it is an
oxidetalis
utility, so we can't use it in the coreOh, I get it. Yes we can use
extract
function. I'll fix thatc103a4fef1
toc137129488
This is good, but my idea was also removing all of these calls and instead just using it in the arguments.
Middlewares cannot return a response; they can only modify it. As you can see, the response is mutable.
Nice, Salvo actually modifies the response if there is an error when extracting an argument.
not about the return, just taking
Signature
andPublicKey
as arguments, and it works.I thought Salvo returning an extraction error, but it's modifying the response.