It is boundary testing, and he's so little you shouldn't worry about disciplining and you seem pretty calm about it all anyway. I only talked seriously to mine at that age when she was in danger of hurting herself.
Because you spend more time with him, he takes you for granted, that you will be there, that you love him. He has to try to win his dad over. DD is like this with her dad, she's funny with him, they tell jokes, she tells me to get out of the room. I like that, I like that they get on. He doesn't have to try with you. It's good that he feels like that, you should be very happy, you've been a good mother.
We agreed when I was still pregnant that I would be the discipline/authority. That was because I was having a girl and I just think that's a nice way of doing things, because men are a bit more genuinely scary than women. But with a boy, there may really be an element of them knowing which gender they are and seeing that as a special role model, and you may want your dh to have equal disciplinary rights, whatever, that's all fine, I think.
In terms of restoring authority to you AS WELL, this is what we did to do it just with me. DH always says 'Mummy says...' when telling DD what she should do, or warning her she's being bad. We do a bit of play acting where they're having a laugh and if it goes too far I come along and tell them and DH says 'Oh, we have to do what Mummy says.'
TBH, it sounds like you're both doing a brilliant job. 18mo's play up. Yours is just trying harder to be loved with his dad because he knows he has you.