JS.weekly() => #29
Here are the top three articles we found interesting this week:
Authentication and Authorization in NodeJS GraphQL API
“There are a few ways you could add access rights to your GraphQL APIs:
- If your requirements are simple, you can just allow all access to logged in users and decline it to the general public. This could be easily done in a context factory (we’ll go through that later on).
- You could check access rights in your resolvers and fine grain it based on requested data, current session and returned objects.
- Move security code into your domain logic and fail there if access should not be granted.
- Add directives to your schema and make security declarative.
- Leave all security to other services if your GraphQL is only a facade to other systems.”
An Introduction To WebBluetooth
With Progressive Web Apps, you can now use the web to build full-blown apps. Thanks to an enormous amount of new specifications and features, we can do things with the web that you used to need to write native apps for. However, talking to hardware devices was still a bridge too far up till now. Thanks to WebBluetooth, we can now build PWAs that can control your lights, drive a car or even control a drone.
Overcoming RESTlessness
“Key Takeaways:
- For the last couple of years, there has been a growing anti-REST sentiment in the software development community. However, alternative technologies often arose within a particular context, which presents strengths and weaknesses in relation to specific use cases.
- The rise of REST was itself fuelled by a false dichotomy, with SOAP playing the role of bogeyman. Whereas SOAP attempted to provide a method of tunneling through the protocols of the web, the REST approach embraced them.
- Instead of seeking to replace REST, the software engineering industry should seek to evolve by building on the maturity of the REST ecosystem while exploiting the technological strengths of the new protocols.”
There is always something interesting on Twitter:
We are adding new libraries to JavaScripting.com every week. Here is one worth checking out:
Pdfkit
PDFKit is a PDF document generation library for Node and the browser that makes creating complex, multi-page, printable documents easy. The API embraces chainability, and includes both low level functions as well as abstractions for higher level functionality. The PDFKit API is designed to be simple, so generating complex documents is often as simple as a few function calls.
JS.weekly() is a weekly digest of the best JavaScript articles, hand-picked by our experts in the JavaScripting community, sponsored by Salsita Software. Don’t forget to follow us on Twitter.