"The key to success. Where is it?" by stoneysteiner is licensed under CC BY 2.0 .
🚀 The Background
A couple of months ago, I announced that prettygoodping.com had gone live. It’s a service which allows you to get an overview of all of your SSL certificates and their expiry dates.
Initially I offered only GitHub authentication, which makes the service available to a large group of people, but it excludes folks who don’t already have a GitHub account. I wanted to expand the reach of the site and for this reason OAuth2 authentication via GitLab and Google is now also available. This new setup allows you to add multiple identies to your account.
Once you are logged in, you can add additional identites on your profile page.
This means that you can have one account which allows you to log in via GitHub, Google and GitLab. That leaves some you options in case you lose access to one of your accounts etc.
If you’re signing in for the first time, start with the OAuth2 provider of your choice on the signup page:
The Technical Stuff
I implemented the authentication via https://metacpan.org/pod/Mojolicious::Plugin::OAuth2. I was previously using https://metacpan.org/pod/Mojolicious::Plugin::Web::Auth, which is quite handy in that it will fetch user info for you after completing authentication, but it has a bug in the Google implementation and the last release was in 2019.
Initially I thought about sending a pull request to
Mojolicious::Plugin::Web::Auth and asking the author for a new release, but
Mojolicious::Plugin::OAuth2 supports mocking, which is really handy in my testing flow. I can now do proper, mocked logins and account creation in both Perl tests and my Playwright tests. It ended up being a better fit for me. My test coverage went up as well.
Codecov tells me that my coverage is currently over 95%, so I’m able to deploy changes with a lot of confidence right now.
Give it a Try
If you already have a https://www.prettygoodping.com account, feel free to add more identities to it. If you don’t have one yet, please sign up for the Beta and let me know what you think at GitHub or via firstname.lastname@example.org.