0:00:23
what is going on guys welcome back to
0:00:27
another session of buildbreaking fix
0:00:30
brought to you by the rule coders and
0:00:33
today you have zayn with me and then a
0:00:37
super rural which is finesse
0:00:40
i wouldn't today finish
0:00:42
hey zen uh yeah really good
0:00:45
um hey everyone thanks for joining again
0:00:49
good to good to be back
0:00:52
fantastic it's always
0:00:55
great to have everyone on the show who
0:00:58
ever manages to get in
0:01:01
which is brilliant um so first things
0:01:05
let's do the acknowledgement for the
0:01:08
country and pay the respect to our elves
0:01:14
i begin today by acknowledging the
0:01:16
traditional custodians of the land on
0:01:18
which we gather today and pay my
0:01:20
respects to the elders past present and
0:01:22
future i extend their respect to
0:01:25
aboriginal and torres strait islander
0:01:30
all right that was smooth
0:01:34
and pretty straightforward
0:01:39
uh how's your day been
0:01:42
good good day no yeah
0:01:45
um pretty long but yeah it was good yeah
0:01:50
yeah that's kind of uh typical work okay
0:01:56
yeah yeah absolutely but hey guess what
0:01:59
it's happy friday now
0:02:01
that's true that's true
0:02:04
yeah what's your day
0:02:07
mine was pretty full on as well as in
0:02:11
um yeah go uh got a lot done
0:02:17
still just a few few more things
0:02:22
to go uh on the stream and then few
0:02:25
build personal stuff as well so
0:02:27
yeah let's get cracking and back in
0:02:36
whoever's wondering um that
0:02:39
what we're going to be doing today as
0:02:42
the title of the video says that we're
0:02:46
uh hashing our password using a node
0:02:49
library called be crypts
0:02:52
and that's always fun hashing passwords
0:02:56
i have never done that in the past so
0:03:02
hopefully you yours as well finished
0:03:04
first time yeah yep simply
0:03:13
stumble back and forth and eventually
0:03:20
all right cool so do you wanna play some
0:03:23
music oh it's my turn isn't it yeah
0:03:30
all right i'll just
0:03:35
i don't know which one into the space
0:03:42
yeah yeah that's not bad
0:03:51
that's what we played last time right
0:03:55
that's right but it's still it sounds
0:03:58
i think we did actually
0:04:00
let's change it then
0:04:04
how about we do this
0:04:08
in just two seconds choose a letter okay
0:04:12
in three two one go
0:04:17
aquestic okay we only
0:04:25
there we go yeah interesting that's
0:04:33
cool all right cool so
0:04:37
let's get cracking
0:04:40
um i'll share my screen
0:04:44
actually i'm gonna
0:04:48
um my zoom room cause
0:04:51
yeah it's not a good look
0:04:59
okay cool so we will go to
0:05:05
open up the terminal
0:05:24
maybe maybe a little bit
0:05:31
all right um i'll zoom in there we go
0:05:35
maybe you're just sleepy probably
0:05:39
yeah it has been as in
0:05:42
back since 5 a.m so
0:05:46
fair enough probably that must be the
0:05:49
reason it's not the music
0:05:57
here we go and now
0:06:12
okay cool so where were we
0:06:19
so probably the last time i guess was
0:06:34
which is basically by default
0:06:37
and then what we did was we went down to
0:06:41
creating the board
0:06:59
gave the passcode here this is this one
0:07:05
this is what actually
0:07:06
encrypts the password
0:07:12
so here whatever would come as
0:07:22
actually i'm gonna create another
0:07:32
i'm just gonna get the documentation out
0:07:39
actually i'm gonna
0:07:42
can you turn the volume a little bit
0:07:44
down please because i'm having a hard
0:07:46
time to focus here
0:07:48
um i'm not actually logged into give me
0:07:50
a second oh okay cool
0:07:52
uh i'll do it in that case
0:08:14
we are hashing your hair
0:08:16
this is the pasta so what we want to do
0:08:29
you might be worth going back to the
0:08:31
documentation because i'm pretty sure
0:08:36
kind of does something with the hash
0:08:40
it says here so your bcrypt.hash my
0:08:44
passcode sold runs function
0:08:48
in the documentation they have that as
0:08:54
store hash in your password db so that's
0:08:57
where we would add our
0:09:07
because i don't really want to do two
0:09:09
trips on dynamodb to be honest
0:09:13
i was hoping that if we can just
0:09:24
yeah i was hoping that if you can just
0:09:28
hash the password here
0:09:33
yeah yeah yeah just pass your hair
0:09:38
uh perhaps we can i mean this is what it
0:09:41
says but perhaps if like we
0:09:44
save it to that variable that you added
0:10:08
i guess what this means that we are
0:10:16
or is it the other way around
0:10:32
one thinking that here we have actually
0:10:38
so here we are actually hashing this
0:10:42
and then as the documents
0:10:45
says that we want to do something in
0:10:47
this function with the hashed value
0:10:51
so my understanding would be there
0:10:54
this is being hashed
0:10:57
so we are assigning the hashed value to
0:11:00
this hash passcode
0:11:06
i'm not so sure that the actual
0:11:09
meaning to be honest
0:11:11
past code variable is being changed let
0:11:14
me let me see if i can find an example
0:11:27
where's the problem
0:11:29
what is the problem
0:11:37
instead we should do it as
0:11:42
in there should you should do hash
0:11:45
pascal equals to hash
0:11:48
because that's what it's returning yeah
0:12:05
why is this squiggly lines though
0:12:07
oh it just yes lens being funny and
0:12:11
really strict with me at the moment okay
0:12:16
prefix here with an underscore
0:12:27
quick fix wow too many quick pictures
0:12:35
face displays people
0:12:52
so this one is there
0:12:57
has got an unexpected function
0:13:09
there's two ways right that they've
0:13:11
listed on the documentation
0:13:15
so i think you're following technique
0:13:17
one right is that correct
0:13:19
which is generate assault and hash on
0:13:22
separate function calls
0:13:24
probably yeah yeah
0:13:27
how about if we do
0:13:29
technique 2 which is
0:13:32
autogen assault and hash so
0:13:35
basically we remove the
0:13:42
then we would just have 255
0:13:45
up to 257 essentially in two five six we
0:13:51
a two uh two five seven we removed sorry
0:14:04
no okay indentation
0:14:11
fix prefer arrow called that function
0:14:19
okay so that means that what we're doing
0:14:24
we pass uh if it's the error then is
0:14:28
this one but if it's successful then
0:14:30
we're just hashing
0:14:37
and then basically
0:14:41
value of this i think
0:14:50
and if we do that one has passcode
0:15:37
all right so that's being built up at
0:15:45
to be honest i think i am feeling really
0:15:51
come on uh i'll be right back i need to
0:15:55
juice up the mac all right yep
0:16:39
deploy this bad boy
0:17:06
next we have to do the checking i guess
0:17:13
um so check when user enters a passcode
0:17:19
whether it matches the one in dynamodb
0:17:33
and if it doesn't then chooses in
0:17:52
yeah toys apparently feeling a bit under
0:18:00
really hope they get well soon
0:18:04
did he say what he's having or
0:18:12
play might call him up to this
0:18:16
just to see how his
0:18:17
housing going traveling and everything
0:18:31
i don't need you here
0:18:36
actually that one should be the same
0:18:39
isn't it yeah it should be the same
0:18:58
internal server did you check the link
0:19:01
say the api endpoint link
0:19:06
yeah i'm pretty sure it's the same three
0:19:08
seven you n zero five
0:19:11
three seven are us zero five
0:19:16
it must be something else no
0:19:21
yeah must be something else
0:19:23
let's have a look where did i mess up
0:19:31
yeah i think i know
0:19:35
oh no what were you gonna say i was
0:19:37
gonna say the same thing
0:19:54
no it didn't mess up
0:19:58
declared in the upper episcope
0:20:16
hash passcode yeah
0:20:22
and this must be the reason why it
0:20:32
why don't you remove it from the top one
0:20:36
wouldn't that be better
0:20:37
why wouldn't you remove it from the top
0:20:39
one isn't that okay
0:20:43
the reason why i didn't do it is because
0:20:46
we need this on two places
0:20:52
credit board and in the gap board so
0:20:55
instead of creating two variables again
0:20:59
um we can just use that one
0:21:06
make sense okay yeah yeah
0:21:12
okay so let's try now and see what this
0:21:14
bad boy complains about
0:21:18
hopefully won't complain about anything
0:21:26
because we satisfied him
0:21:31
what's the squiggly line there see
0:21:37
being really fussy
0:21:44
squiggly line scary
0:21:48
i always say in that way that although
0:21:50
red is my favorite color but in these
0:22:18
okay yeah after this is done we can
0:22:21
implement the um get functionality um
0:22:28
um the pot as in entering the passcode
0:22:31
and see if that matches that one in the
0:22:36
which is basically
0:22:39
you can have a go at that
0:22:45
what my basically idea would be that
0:22:54
on load we basically
0:23:01
load up all the board names
0:23:06
board details as in
0:23:10
board names and the you uh the passcode
0:23:23
when the page loads on the client side
0:23:26
yeah yeah that makes sense
0:23:43
it's definitely not there we'll have to
0:23:48
the land check what's happening there
0:24:02
pop up let's take off
0:24:23
oh well where's my mobile
0:24:28
hang on now i'll be back i need to get
0:25:34
resources which one was it
0:25:41
wasn't default was it no
0:25:44
i think it was hello
0:25:50
um i'm talking about the
0:25:58
apparently isn't it
0:26:04
we need to change the
0:26:06
name of what this is about
0:26:19
we have just coded our first land of our
0:26:34
25 yet that is the one
0:26:37
okay cool so what does it say
0:26:52
so it's saying um i'll be crypt is
0:26:58
error deal open failed
0:27:02
so it didn't open the dll
0:27:26
i'm going to google this really quickly
0:27:30
and see what it says
0:27:54
okay invalid left header yeah there's
0:27:58
rebuild big clips solution
0:28:09
so we need to run this
0:28:24
rebuild dependency successfully all
0:29:02
oh i'm looking it up as well as in
0:29:04
people are saying that
0:29:08
because it's not the same
0:29:19
you have to like ignore it on and get
0:29:22
ignore something like that and then
0:29:29
again on the linux side
0:29:40
so basically uninstall it and then
0:29:50
it's saying set up your kit ignore
0:29:52
properly to exclude known modules
0:29:54
ignoring known modules and get it no
0:29:58
would not have any effects on other
0:30:22
when when the lambda is being run is it
0:30:27
like how is it how does it work um in
0:30:29
terms of deployment on aws is it
0:30:37
if you're talking about the architecture
0:30:42
lambda so what happens is that
0:30:45
we do anything with the api
0:30:50
uh api gateways is triggered and then
0:30:53
which in turn triggers the lambda
0:30:58
it makes sense okay
0:31:02
see how to solve this for that
0:31:06
let me check if you if it does
0:31:15
i don't think you will
0:31:32
unknown application error interesting
0:31:58
okay interesting basically they're
0:32:01
saying you need to deploy using linux
0:32:06
from windows machine this or mac os this
0:32:09
error occurs so basically if we
0:32:12
deploy this code on a from a linux
0:32:17
ah say it's not compatible with mac then
0:32:22
uh huh so we can forget about
0:32:25
bcrypt then i guess
0:32:35
what if we just like
0:32:37
probably more effort but what if we
0:32:41
just like use a vm or something like
0:32:43
that to to deploy it but the thing is we
0:32:46
can't test so often
0:32:48
it's more effort that's true
0:32:51
and it will cost us even more
0:32:58
as in the ec2 and all that
0:33:02
it will cost us more
0:33:04
but only turn it on when we want to use
0:33:09
yes we can do that but um
0:33:12
even when we turn it on and then
0:33:16
i don't trust my my memory because i
0:33:19
will forget to turn it off
0:33:22
okay fair enough yeah
0:33:28
we can just look for as in
0:33:50
ah he's used bigfoot to 12.
0:33:57
uh apparently this uh
0:34:00
we can use be crypt.js instead
0:34:03
so not not js but just j yes
0:34:22
well ultimate general is your dependency
0:34:25
is compatible to support so bakery body
0:34:29
working on browser
0:34:31
can you work on the max well
0:34:59
actually do you know what
0:35:16
it looks like very similar to
0:35:18
b crypt node.js anyway so it seems like
0:35:21
our efforts are not wasted yeah
0:35:26
so let's try this thing and i'm gonna
0:35:28
uninstall the other one
0:35:32
things that i'm not using pressing in
0:35:36
i'm just going to correct
0:35:53
we're gonna add password reset as well
0:35:56
that's a good question okay def um okay
0:36:00
we're gonna add password reset as well
0:36:06
not for the mvp but yes
0:36:15
since the encryption is one way
0:36:20
yeah that's a good point
0:36:26
since the encryption is one way
0:36:29
because we're not actually decrypting
0:36:30
right we're just gonna compare
0:36:37
yeah i guess yeah perhaps reset in the
0:36:44
listed in project dependencies
0:37:01
can't find anybody
0:37:14
and is they used in a similar way
0:37:21
pretty much isn't it
0:37:22
yeah it looks similar if you're going to
0:37:27
we're probably using async here
0:37:30
to hash a password
0:37:32
to check up our so so we we can even
0:37:36
check a password here
0:37:38
yeah be interesting
0:37:40
i said this is using the old way
0:37:46
could we do it um like you see there
0:37:48
yeah that one there yeah
0:37:53
oh so it's very similar isn't it
0:38:00
as we've already done here
0:38:04
yeah it looks very very similar to be
0:38:09
yeah it seems like we can just use a lot
0:38:24
it's coming from there yeah eight
0:38:36
let's try this and see if this doctor
0:38:43
there you go our first
0:38:45
ever lambda in our lifetime hello world
0:38:57
what was your first thing that you
0:38:59
couldn't finish as in first everything
0:39:02
that really kind of
0:39:05
told you that okay i'm gonna become a
0:39:11
probably high school like um it was a
0:39:14
visual basic universal base
0:39:17
um just made like a school portal
0:39:22
and yeah that was really fun man like it
0:39:25
basically it was like a lot of drag and
0:39:27
drop and then you call
0:39:30
on the buttons like
0:39:32
you double click to code to code it um
0:39:35
but yeah it was good fun like the whole
0:39:36
process was like you know
0:39:38
yeah that's when i knew i really really
0:39:45
that's always really
0:39:50
as in just pressing few buttons on the
0:39:54
as in some magic happens on the screen
0:39:57
isn't it that's true yeah and
0:40:00
you get the feeling that oh i just did
0:40:02
that i made that happen
0:40:15
about yourself say
0:40:18
for me so that was my
0:40:22
as in reason when i was just pressing
0:40:25
some random things on the keyboard and
0:40:28
the screen just changed
0:40:31
the actual reason was that
0:40:36
problem solving and i love tech
0:40:41
they both combined and when i actually
0:40:44
just pretending to
0:40:49
screen started to change every wall
0:41:01
yeah so that was how
0:41:04
was there a particular moment for you or
0:41:08
that you can remember
0:41:12
yeah so there was one moment uh i was in
0:41:20
given a really simple task of hello
0:41:32
obviously good googling stuff and
0:41:36
everything but i just couldn't really
0:41:39
one thing i would just be missing one
0:41:52
he said go figure it out yourself and
0:41:54
that really pissed me off
0:41:56
and i took that as a challenge
0:41:59
and as soon as i pressed a
0:42:05
semicolon and everything
0:42:08
just worked i was like whoa
0:42:11
magic and i was like that kind of a mad
0:42:20
that's how it all started
0:42:24
i also went back to my
0:42:26
to my professor that like
0:42:29
why couldn't you just tell me that it
0:42:36
he he just said that
0:42:39
if i would have told you you wouldn't
0:42:41
have had the pain you
0:42:43
wouldn't research and then you wouldn't
0:42:48
you won't ever forget
0:42:50
to put a semi colon when you're doing c
0:42:53
plus plus at least
0:43:02
come on we'll cover up
0:43:10
that was fun times
0:43:14
let's check if this works
0:43:16
you probably wouldn't have felt that
0:43:20
like yeah after after you forget it out
0:43:24
exactly yeah and i think he did that
0:43:28
approach for a reason
0:43:30
as in he wanted me to
0:43:32
feel what that i've actually earned it
0:43:39
okay so this is still not doing what's
0:43:42
supposed to do let's go back to the
0:43:57
what problems did you solve today zayn
0:44:04
so at the moment we are solving um
0:44:10
not get the b crips error on mac but if
0:44:14
you're talking at work
0:44:21
so my colleague was
0:44:24
facing a problem was
0:44:33
in terms of of the environment setup
0:44:42
um i think turns out that
0:44:45
the project that as in the visual studio
0:44:48
solution to be used was supposed to be
0:44:54
that's one thing i kind of researched on
0:44:58
conflict as an internal confluence and
0:45:03
find out that so you should yeah just um
0:45:08
changing the solution name
0:45:12
and it all worked and then i was working
0:45:16
missing dependency issue
0:45:24
there first of all uh but the fix that
0:45:27
uh i applied and looking at that that
0:45:32
i'm thinking they might be in my local
0:45:37
so we might do kind of a release and see
0:45:43
magically works on the actual server
0:45:48
so that's happening at the moment see
0:45:51
how i go but yeah that them
0:45:54
that missing dependency block has taken
0:45:58
way way too long honestly
0:46:01
i wasn't expecting that
0:46:06
but yeah um going back to
0:46:13
and that's what i'm looking at now
0:46:17
when you want oh no this is
0:46:20
not enough today right
0:46:23
we need to go back
0:46:27
and checked out today one probably
0:46:36
okay this is up to that one
0:46:56
i haven't spent it wrong
0:47:12
can't find the module
0:47:20
should be listed independence
0:47:30
project dependencies
0:47:32
there's no ways package
0:47:36
it you go no it's not there that's not
0:47:40
there no wonder okay
0:48:06
should already mess here
0:48:25
three five pages are looking for so it
0:48:30
is not adding it here
0:48:34
is really interesting
0:48:41
even on the right folder
0:48:55
that was the issue
0:49:05
your crib don't need you so you can
0:49:15
all right let's see if this does the
0:49:27
what happens if you
0:49:38
hopefully we can get this working before
0:49:47
geckdev asks have you ever used notepad
0:49:54
yes at work i use in notepad plus plus
0:49:58
as mine as my notepad
0:50:07
how come you don't just use the normal
0:50:13
because um notepad plus first has gold
0:50:17
oh okay fair enough yep
0:50:21
syntax feature as well
0:50:44
do you prefer notepad or no pepper plus
0:50:48
um if it's just for like my notes then i
0:50:52
normal notepad like you know i'm doing
0:50:55
like a to-do list or something but yeah
0:51:00
yeah i mean if it's like a shell script
0:51:07
that would make sense but i'm for that
0:51:09
to do this have you tried choosing
0:51:15
actually no i haven't that's a good
0:51:22
um i used to in my previous previous job
0:51:30
so basically the whole motivation beyond
0:51:34
that is to whenever i get
0:51:36
my personal toss as in i'm in the middle
0:51:39
of say 10 different things
0:51:42
so i use the to keep
0:51:47
everything so i don't forget anything at
0:51:52
i used to uh so i used to use trello in
0:51:56
my previous job but now i'm using um
0:52:14
i'm using that at the moment
0:52:19
really helpful for that because
0:52:22
in that way i don't forget anything what
0:52:25
anyone asked me to do
0:52:27
nice okay i'll have a look
0:52:30
it's good idea really good
0:52:32
okay let's check this bad boy out and
0:52:36
hopefully it's working now
0:52:44
all right brilliant
0:52:47
oh so let's go to our dynamo db and
0:52:52
password is actually hashed
0:52:57
yeah prep socket no we don't need that
0:53:07
take a guess finish
0:53:10
what do you what i think so yeah yeah i
0:53:16
um so which one was it
0:53:25
so attribute was what was attributes
0:53:40
um it took the password away as well
0:53:43
now hold on then click the click on the
0:53:48
like on the actual port id
0:53:52
yeah oh yeah that that one yeah
0:54:02
because i'm another one the one that you
0:54:04
did yes uh wednesday sorry like yeah
0:54:08
if you click on the board id then it
0:54:13
like it like in the attributes but okay
0:54:16
it shows up in that produce but not this
0:54:20
right let's say cool all right that
0:54:22
might we will figure out what happened
0:54:27
let's go back to the cloud watch and see
0:54:30
what actually happened
0:54:36
troubleshoot oh okay
0:54:46
so you didn't even
0:54:49
try new boards and maybe i don't know i
0:54:52
don't think it'll make a difference but
0:55:27
okay so this isn't doing it
0:55:31
uh what if we checked it
0:55:46
so we can actually check if it does come
0:55:51
do you want to clog the hash as well see
0:56:39
okay fine be happy
0:56:43
you know i have a feeling but i'm not
0:56:47
this might be something to do with is
0:56:56
what i think is like yeah i could i
0:56:59
don't know like i don't know how to fix
0:57:04
you know like hash passcode is probably
0:57:06
like empty so it's probably not
0:57:09
it's not actually getting passed to the
0:57:15
so i i have a feeling it's something to
0:57:16
do with anything but i don't know what
0:57:22
right yeah i might have something to do
0:57:24
with async but what my question then
0:57:31
that they haven't used any kind of
0:57:33
special async over here
0:57:53
thought sufficiently sharing
0:57:55
computational resources
0:58:03
okay this is just bang a promise in
0:58:26
can we go back to that
0:58:51
and it feels suspicious
0:58:57
yeah i'm not really certain at the
0:58:58
moment i just see i just have a feeling
0:59:00
maybe that's the case but
0:59:04
what's the squiggly line by the way yes
0:59:12
he's our best friend he never wants to
0:59:22
string concatenation
0:59:24
yeah i don't care i need that
0:59:38
let's just try this
0:59:43
and then we can call it a day
1:00:22
come on come on boy come on you can do
1:00:25
this we believe in you
1:00:45
to cloudwatch and see what's
1:00:48
what's he saying to us what's he saying
1:00:52
what are you saying boy
1:00:59
uh-huh it didn't even come in there
1:01:11
it didn't come in there
1:01:19
good progress though like as in we're
1:01:21
all already learning a lot and
1:01:24
this is both of our first time
1:01:31
yeah something i didn't know actually
1:01:32
was the like i didn't know
1:01:36
it would have an effect like uh if you
1:01:39
did it on mac or linux or
1:01:42
windows so that's pretty interesting
1:01:49
what i love about as in programming as
1:01:55
it always surprises you
1:02:04
is my first ever time in um
1:02:10
javascript how did i go
1:02:14
i didn't mess it up too much i know a
1:02:17
little bit which is always the case with
1:02:19
zayn according to jack def
1:02:27
do you want to do the honest finish
1:02:31
uh thanks for joining us for another
1:02:33
episode of uh bill break and fix
1:02:37
in today's episode we
1:02:41
continued on with hashing the passwords
1:02:43
um we were initially using bcrypt
1:02:50
actually doesn't work because we're
1:02:55
if we want to deploy it on lambda then
1:02:58
we need to do it from linux so
1:03:00
we switched over to uh bcrip js which
1:03:08
yeah we've got the implementation there
1:03:10
but um yeah it's not quite showing
1:03:14
uh in dynamodb just yet so
1:03:16
uh but yeah getting really close so if
1:03:19
you're keen to see us uh work on that
1:03:23
and upcoming streams then
1:03:39
all right guys have a great night and
1:03:42
we'll see you then