teleren/devto huggingface dataset:
Authentication between microservices - Part I
Tags: authentication, microservices, jwt, springboot
Published: 2020-06-03 12:04:37

How to establish your **own custom authentication** between microservices?

![](https://dev-to-uploads.s3.amazonaws.com/i/vgosjwkyh1wh02ekzp03.png)

**What and Why?** :thinking:

Let's assume the interaction between 3 microservices.

* **User Service** - Handles user's registration/login and other user data.
* **Product Service** - Handles the product list present in the system.
* **Order Service**- Handles Order, invokes product service to validate the order and invokes user service to attach required user-details to the order.

**Why Authentication is needed?**

Let's say you want to keep control over which service is calling another service.

*Example here* -  User service shouldn't be calling order service or product service. And similarly, product service shouldn't be calling order service.

*Explanation* - Sometimes, a service ends up invoking an API of other services, which it should not (*because that is not the service responsibility or may be to implement a new feature, etc*). 
 Say, `user-service` starts invoking `orders` API of `order-service` to know if a user has placed order and wants to send an email to that user. And similarly, any other service can call this API of `order-service`.
 But say, if we want to know, what all services call this order API, we won't be able to tell. To do this kind of tracing or to 
restrict this type of API calls, `order-service` service should know from which service the call is originating.

* But how will one service know, that it shouldn't allow any other service to use it's APIs except a few?

* If you are using container orchestration like k8s, this could be achieved by using namespace restriction.

**But how to do it independent of k8s?**

Let's make one more assumption here:

* Service A - Caller service
* Service B - Called service *i.e interaction happening from service A->B*

For B to know if A is authorized to invoke its APIs, we can deploy one of the logics which is used for user authorization *i.e sharing an authorization token while calling each API*.

![](https://github.com/s2agrahari/img-dump/blob/master/microservice_auth_internal_sequence_diagram.png?raw=true)


**Now, who will own the generation of the authorization token?**

* Each caller service(*service A*) will generate a token (*using a secret key*) and pass to the called service (*service B*).

*Note - Secret key that caller service (service A) uses to generate the token will also be present with called service (service B) for validation.*

**How the called service will validate the token it receives?**

* The called service(*service B*) will validate by decoding the token it received and comparing the secret key in the token with the stored secret key list.

*How to implement it?* [Authentication between micro-services - Part II](https://dev.to/s2agrahari/authentication-between-microservices-part-ii-30l4)

If you enjoyed this story, please click the ❤️ button and share it to help others find it! Feel free to leave a comment below.
Daily Developer Jokes - Wednesday, Jun 3, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-06-03 12:00:24

---
title: "Daily Developer Jokes - Wednesday, Jun 3, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Jun%203%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258e3bbae5.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why don't bachelors like Git?

___A:___ Because they are afraid to commit.
 -->
CLI tool to add badges and labels to your iOS/tvOS icons
Tags: ios, swift, devops
Published: 2020-06-03 11:51:04

> I'm a lazy engineer.

At my full time job we do initiate many projects constantly, and for every project we usually have variants of the same application running against different backend environments.

Usually, these variants differ in: 1) Name, 2) Identifier, 3) Base URL they connect to and 4) Icon (for user friendliness).

This easily result in at least 5 variants of the same app, that even sharing the same codebase has to contain different assets. And if I use multiple targets, well... that goes on.

Also because I'm lazy, I try to automate anything that makes sense. From here comes [Badgy](https://github.com/arthurpalves/badgy), this simple CLI tool does only thing, it add badge overlays to your app icon, on the go.

I'm able to run it on a CI pipeline, right before deploying my app, which won't create a new asset but replace the original.

![Badgy](https://dev-to-uploads.s3.amazonaws.com/i/l7mn492aijdy0h7gat6t.png)

[Badgy](https://github.com/arthurpalves/badgy) is tiny but can do a lot for you:

* ✅ Small (square) and long (rectangular) labels
* ✅ Position it on `top, left, bottom, right, topLeft, topRight, bottomLeft, bottomRight, center`
* ✅ Supports rotation (long badge only)
* ✅ Converts your icon to different sizes already
* ✅ 🚀 Ability to automatically replace your `.appiconasset`, mainting the same name and sizes
Building A Data Lake For The Database Administrator At Upsolver - Episode 135
Published: 2020-06-03 11:50:06

<p>Data lakes offer a great deal of flexibility and the potential for reduced cost for your analytics, but they also introduce a great deal of complexity. What used to be entirely managed by the database engine is now a composition of multiple systems that need to be properly configured to work in concert. In order to bring the DBA into the new era of data management the team at Upsolver added a SQL interface to their data lake platform. In this episode Upsolver CEO Ori Rafael and CTO Yoni Iny describe how they have grown their platform deliberately to allow for layering SQL on top of a robust foundation for creating and operating a data lake, how to bring more people on board to work with the data being collected, and the unique benefits that a data lake provides. This was an interesting look at the impact that the interface to your data can have on who is empowered to work with it.</p><p><a href='https://www.dataengineeringpodcast.com/upsolver-data-lake-database-administrator-episode-135/'>Listen Now!</a></p>
Extending The Life Of Python 2 Projects With Tauthon
Published: 2020-06-03 11:49:36

<p>The divide between Python 2 and 3 lasted a long time, and in recent years all of the new features were added to version 3. To help bridge the gap and extend the viability of version 2 Naftali Harris created Tauthon, a fork of Python 2 that backports features from Python 3. In this episode he explains his motivation for creating it, the process of maintaining it and backporting features, and the ways that it is being used by developers who are unable to make the leap. This was an interesting look at how things might have been if the elusive Python 2.8 had been created as a more gentle transition.</p><p><a href='https://www.pythonpodcast.com/tauthon-python-2-fork-episode-265/'>Listen Now!</a></p>
Dev.to new edit format feedback and other suggestions
Tags: discuss, healthydebate
Published: 2020-06-03 11:31:07

Was wondering what others thought about the new article edit layout?

Here's my thoughts...

- Shouldn't all buttons be at bottom?
[Edit] [Preview] [Save Draft] [Manage] [Publish] [Revert New Changes]
Don't have to scroll, as the cursor is always at new line of edit.

- Also, the new preview uses a white background, which makes the javascript harder to read.  Wouldn't a dark gray background be better?

- The Tagging input could be a checkbox dropdown with filtering as we type. This way we can see all tagging options.

- Also if we hover over our name icon now we see a drop down of things to do, could we add a [View Drafts] option?

- One other cool thing, when we go to dashboard and view our posts, if a search bar was in that screen, it would make it easier to search just our posts.  No a big deal....

- A direct way to message a member of Dev.To, just go to their icon, then a menu option "Send Message" allows us to communicate directly.  Would be nice to have message history (as in RSS feeds when we text messages to phone numbers)
Wednesday Links - Edition 2020-06-03
Tags: java, kotlin, docker, database
Published: 2020-06-03 11:28:57

Gradle 6.5 Released ( 4 min read ) 🎆
https://docs.gradle.org/6.5/release-notes.html

Sharing Dependencies and Gradle Plugins between Kotlin/Spring Boot Services ( 4 min read ) 📤
https://www.stackhawk.com/blog/sharing-dependencies-and-gradle-plugins-between-kotlin-springboot-services/

What's new in Spring Data (Klara Dan von) Neumann? ( 6 min read ) 🆕
https://spring.io/blog/2020/05/18/what-s-new-in-spring-data-klara-dan-von-neumann

Reactive Spring Boot with Kotlin Coroutines ( 7 min read ) 🍅
https://todd.ginsberg.com/post/springboot-reactive-kotlin-coroutines/

Kotlin tip - map with default ( 20 sec read ) 🗺️
https://twitter.com/kotlin/status/1267750314024808450

kotlinpoet 1.6.0 Released ( 2 min read ) 📜
https://github.com/square/kotlinpoet/blob/master/CHANGELOG.md

sqlancer - Detecting Logic Bugs in DBMS ( 3 min read ) 🔍
https://github.com/sqlancer/sqlancer

Conventional Commits ( 6 min read ) 📏
https://www.conventionalcommits.org/en/v1.0.0-beta.4

Inside the Java Platform Group ( 2 min read ) 👀
https://inside.java/

Java & Files ( 13 min read ) 📁
https://www.marcobehler.com/guides/java-files

The Java lowercase conversion surprise in Turkey ( 3 min read ) 🇹🇷
https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/

The anatomy of Connection Pooling ( 4 min read ) 🎱
https://vladmihalcea.com/the-anatomy-of-connection-pooling/

Why Does My Docker Container Take 10+ Seconds to Stop? ( 6 min read ) 🚢
https://blog.true-kubernetes.com/why-does-my-docker-container-take-10-seconds-to-stop/

Github uncovers malicious ‘Octopus Scanner’ targeting developers ( 3 min read ) 🐙
https://nakedsecurity.sophos.com/2020/06/01/github-uncovers-malicious-scanner-targeting-developers/

GraalVM 20.1 ( 5 min read ) 🏆
https://medium.com/graalvm/graalvm-20-1-7ce7e89f066b

Static Compilation of Java Applications at Alibaba at Scale ( 8 min read ) 👳
https://medium.com/graalvm/static-compilation-of-java-applications-at-alibaba-at-scale-2944163c92e

Running Spring Boot GraalVM Native Images with Docker & Heroku ( 9 min read ) 🏃
https://blog.codecentric.de/en/2020/06/spring-boot-graalvm-docker-heroku/
Hello everyone, I apologize for being totally off for a while now.
Tags: tutorials, showdev, webdev, watercooler
Published: 2020-06-03 11:26:45

---
title: Hello everyone, I apologize for being totally off for a while now.
published: true
description: 
tags: tutorials, showdev, webdev, watercooler
//cover_image: https://direct_url_to_image.jpg
---

***However, I am back and I would like to announce my upcoming series viz: Mastering React.js Inside out.***

*In my new series, I would be explaining React.js to the last detail, in hope of helping you to master the awesome library.* :sparkling_heart:

*Stay connected* :sparkles:
Where do I start to become a MERN or Full stack Developer?
Tags: beginners, react, help, question
Published: 2020-06-03 11:20:58

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cyl6turua2huugmnqwap.png)

I saw this <a href="https://www.youtube.com/watch?v=JnEH9tYLxLk">video</a> a few weeks ago and really got motivate to become a full stack developer. Thank you so much @CodingTrain and @CodingGardenCJ for this. 

It just took me 4 hours(many issues) to watch and implement as shown in the video in React. Later I added a Map that marks the location of the users who visited my site. 😁

But now I am stuck. I searched for more simple full stack projects to improve, but all seem complicated and time consuming and not as simple as the video.

Please comment or DM me some links where I can start learning with similar projects and this might help others too.

Thank you😍
My last hackathon project
Tags: octograd2020
Published: 2020-05-20 17:40:40

## Preface

In early February, two of my friends and I drove for four hours during an intense snowstorm to attend [uOttahack 3](https://2020.uottahack.ca/). Although it was an incredibly reckless decision to travel during that time, attending the event was totally worth it! Over the weekend, we had lots of fun building the SmartBox Delivery System (more on that later). Our hack won us the top prize for one of the three main "tracks", and also netted us a sponsor challenge win.

## What is SmartBox Delivery and how does it work?

We created SmartBox Delivery to be an end-to-end system allowing for independent couriers to easily and securely deliver parcels. Here's a typical usage scenario:

At the sorting facility, a delivery agent scans a customer’s package through the mobile app. This action automatically reserves an available SmartBox nearest to the customer's location. At delivery, the package is placed inside the reserved box, after which it will automatically close and lock once the delivery person confirms the delivery. The system also sends out a delivery notification to the customer (in our demo, we triggered notifications via Alexa).

When the customer is ready to pickup their parcel, they simply scan the designated SmartBox for it to automatically unlock and open.

## Tech stack?

The mobile application (for both the delivery agents and customers) was built with React. We originally wanted to use React Native, but settled on a web app due to many setbacks. The backend was written in node using the hapi.js framework.

Due to the nature of our system (which in reality would include a lot more than a single SmartBox), we needed a way to easily trigger state changes on the SmartBox. So, we built our system with an even-driven architecture in mind. Each action completed by a delivery agent or customer triggers an event for a SmartBox to react to. To support this, we used a cloud broker called [Solace](https://solace.com/).

## A flashy, motorized cardboard box

The centerpiece of our hack was the SmartBox hardware (built from the most resilient and durable material, cardboard). Inside the box was an Arduino Uno, connected to a computer using a serial communication channel. Commands were sent to the Uno upon reception of events published in our system.

Two micro servos connected to a pivot system on the box flaps served to open and close it on demand. Another micro servo was used to raise a flag attached to the box; this one being activated when an object broke an IR beam installed inside.

![the box](https://challengepost-s3-challengepost.netdna-ssl.com/photos/production/software_photos/000/933/830/datas/original.jpg)

Finally, a digital RBG LED strip attached to the front of the box was used to display the state of the system to the user. For example, we had it glow green to indicate that the box was availabel for reservation.

## Code

Check it out [here](https://github.com/DYu24/smart-box)!

## TL;DR

My friends and I drove for 4 hours during a crazy snowstorm to attend a hackathon and build a flashy, motorized cardboard box.
Using neovim's official LSP plugin
Tags: vim, neovim, editor, firstpost
Published: 2020-06-03 10:55:06

We all wan't [LSP](https://microsoft.github.io/language-server-protocol/) support when we write code even in dynamic typing language like Ruby. It's 2020 😉

The next neovim will support LSP out of the box, so I thought about giving it a try since the old plugin I was using wasn't supporting LSP's `completionItem/resolve` just like below

*Before* - autozimu/LanguageClient-neovim

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7giw4ylcb04wx4pw65nd.png)
no function documents.... :(

*After* - neovim/nvim-lsp(official LSP temporary plugin)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mehdbn35w4r4up9ae27e.png)
documents yay!


## Steps

### Updating Neovim

First you'll need to install the unreleased latest neovim(aka Nightly)
[Here's](https://github.com/neovim/neovim/releases/tag/nightly) the link for it, but if you're using Mac & homebrew, you can do it as below.

```
$ brew unlink neovim
$ brew install neovim --HEAD
$ nvim --version
NVIM v0.5.0-60c581b
```

### Installing official LSP plugin

The official LSP support will be included inside the next 0.5 neovim release version, but it's a plugin ATM so you'll have to install after you install Nightly neovim

I use [dein.vim](https://github.com/Shougo/dein.vim) for plugin management so it'll be as below

```
  call dein#add('neovim/nvim-lsp')
```

I use [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) for autocomplete, so below is necessary in this case

```
  call dein#add('Shougo/deoplete.nvim')
  call dein#add('Shougo/deoplete-lsp')
```

Please note that neovim's default autocomplete supports nvim-lsp, so deoplete isn't required

### Setting up nvim-lsp

This is the hard part for most plugins, but nvim-lsp configuration is really simple

All you have to do is add the following to you init.vim:

```
:lua << END
  require'nvim_lsp'.tsserver.setup{}
END
```

This is when you want to write typescript, if you want to write Ruby too, add the corresponding language server as below:

```
:lua << END
  require'nvim_lsp'.tsserver.setup{}
  require'nvim_lsp'.solargraph.setup{}
END
```

Don't forget to install the language server itself if you haven't

* https://github.com/neovim/nvim-lsp#tsserver
* https://github.com/neovim/nvim-lsp#solargraph

That's all! 😆

P.S.

You also might want to set belows keybinds as well 😉

```
nnoremap <silent>gd    <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent><c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent>K     <cmd>lua vim.lsp.buf.hover()<CR>
```
Using CSS Modules by simply using HTML. What do you think?
Tags: webdev, showdev, javascript, css
Published: 2020-06-03 10:53:11

Hey guys! 

Here is another small interactive [demo](http://gluecodes-demo.s3-website.eu-west-2.amazonaws.com/ide-slotStyling.html?appId=1&edit=page&id=index). I left a TodoMVC app at visually broken state and you can fix it by following comments in the code :wink:.

In our proof of concept, we've made styling (I personally believe) super simple. They are not only scoped per UI section, but they are applied by CSS classes in HTML. So, you write HTML normally without thinking of naming collisions and under the hood you get code styled by CSS modules. 

Do you think it's something you'd enjoy using? Should we introduce CSS processors?

![CSS Modules](https://dev-to-uploads.s3.amazonaws.com/i/8dcde1fxzc9dkiak6wy5.png)

More links:

[Our website](https://www.glue.codes)
[Repo](https://github.com/gluecodes/gluecodes-framework)
[Kickstarter campaign](https://www.kickstarter.com/projects/gluecodes/gluecodes-platform)

Here is the [previous post](https://dev.to/chrisczopp/reusing-ui-within-an-app-with-less-hassle-judge-my-demo-1lf3)

*We need contributors, backers and being noticed so stars on Github are very appreciated.*
What is automation testing in QA?
Tags: automationtesting, automationintesting
Published: 2020-06-03 10:47:26

Automation testing is a Software testing method to test and contrast the genuine result and the normal result. This can be accomplished by composing test contents or utilizing any computerization testing apparatus. Test computerization is utilized to mechanize dreary undertakings and other testing errands which are hard to perform physically. 

Automation – A Cost-powerful Method for Regression Testing 

Automation costs are extremely higher at first. It incorporates the expense of the device, at that point the expense of the <a href="https://www.testingxperts.com/blog/test-automation-guide">automation testing</a> tool , and his/her preparation. 

In any case, when the contents are prepared, they can be executed many occasions more than once with a similar exactness and rather rapidly. This will spare numerous long stretches of manual testing. So the expense slowly diminishes, and eventually it turns into a practical strategy for Regression testing.

When to Automate? 

This is a time of agile methodology in SDLC, where the turn of events and testing will go nearly in equal and it is extremely hard to choose when to mechanize. 

Think about the accompanying circumstances before venturing into automation

1. The item might be in its crude stages, when the item doesn't have a UI, at these stages we should have an unmistakable idea on what we need to computerize. The accompanying focuses ought to be recalled. 

2. Tests should not be obsolete.

3. As the item advances it ought to be anything but difficult to single out the contents and extra to it. 

4. It is critical to not become overly enthusiastic and guarantee that the contents are anything but difficult to investigate. 

5. Try not to endeavor UI automation at the underlying stages as UI is exposed to visit changes, along these lines will prompt contents coming up short. Beyond what many would consider possible pick API level/Non UI level automation until the item balances out. Programming interface automation is anything but difficult to fix and troubleshoot.
Facebook new update: You don't have to use 3rd party CRM to manage leads. Check how
Published: 2020-06-03 10:21:01

Facebook Lead Generation - Now manage your leads for Free | No need to be configure 3rd Party CRM.

Watch Video: https://www.youtube.com/watch?v=kRJf5kchTkg

Facebook recently launch a new features for advertiser how had to invest in CRM and Lead bridge because they cost a lot. This feature helps you to manage you leads and you can easily manage lead with the update.

Watch the whole video and you all know about the Facebook lead management tool

Visit our official website: https://digitalmise.com

#facebookmarketing #facebookmarketingtool #facebookads #facebookleadgeneration #facebookandcrm #facebookupdates
git diff> & apply vs stash 
Tags: discuss, git, productivity
Published: 2020-06-03 10:20:25

I never use `git stash` and prefer to use `git diff HEAD > ../diffs/whatever.diff` and later `git apply ../diffs/whatever.diff -3` (`-3` for 3-way merge enabled).

I know a lot of people use `git stash`, but I'm not sure it's because they prefer it over `git diff`, but rather because they haven't considered it.

It could be just me, but I prefer to have my code snippets and changes to be as "tangible" as possible. Ability to back them up, add to git, reuse and all that is much more reliable and convenient with diff > apply.

What are your thoughts?