Closed jofftiquez closed 2 years ago
Is it already implemented or not? @jofftiquez?
@WarenGonzaga no, not yet.
@WarenGonzaga no, not yet.
Do you have detailed implementation of this so other contributor can work on it.
Any updates on this @jofftiquez? Can you drop some details on how to achieve this? A reference is a great way to start. I might work on it. I just need to understand. 😅
You can start by searching "Optional chaining in JavaScript". I didn't know this was assigned to me explicitly. Please let me know in the future to avoid confusion. Thanks.
Awesome, thanks for the response! I'll take a look into it. Perhaps I guess @princejoogie can work on it?
Awesome, thanks for the response! I'll take a look into it. Perhaps I guess @princejoogie can work on it?
@WarenGonzaga with the conversion of this wrapper from js to typescript, I believe the issue "Use optional chaining for trailing objects for more secure checking" is solved already with interfaces
and additional logic to check each request parameters
check out createSpace.ts
as an example.
https://github.com/WarenGonzaga/gathertown.js/blob/df032e14dfaefdd444a79cd9aa6e4797c54d95c4/src/api/createSpace.ts#L5-L11
the properties map
, reason
, and sourceSpace
are optional so I added additional checking to see if those attributes are present:
https://github.com/WarenGonzaga/gathertown.js/blob/df032e14dfaefdd444a79cd9aa6e4797c54d95c4/src/api/createSpace.ts#L20-L33
if we want a super secure way to check the given parameters, we can use validator libraries like yup or joi
i use yup
in my projects. example:
https://github.com/princejoogie/expressts-typeorm-bp/blob/12f2ad72c2dfd8952335c9a56c600d4bec090798/src/middleware/validators/schema/auth.schema.ts#L14-L21
Thanks for the detailed explanation @princejoogie! What is more secure between yup and joi? Which is easier to implement?
Thanks for the detailed explanation @princejoogie!
What is more secure between yup and joi? Which is easier to implement?
im more familiar with yup so i would choose yup
Thanks for the detailed explanation @princejoogie! What is more secure between yup and joi? Which is easier to implement?
im more familiar with yup so i would choose yup
Let's do it! 🤗
@princejoogie update on this?
@princejoogie update on this?
ill push a PR next weekend
Awesome, thanks for the update @princejoogie looking forward!
@princejoogie soft follow up on this? thanks!
any update on this @princejoogie?
Thanks @jofftiquez and @princejoogie for the update! Closing this issue now! ⚡
Use optional chaining for trailing objects for more secure checking