Mojolic...h2::Mock(3)
π NAME π
Mojolicious::Plugin::OAuth2::Mock β bestie, it's a whole mock Oauth2 and/or OpenID Connect provider π like it literally pretends to be the auth server so you don't have to π
β¨ SYNOPSIS β¨
ok so here's the vibe, copy-paste core:
use Mojolicious::Plugin::OAuth2::Mock;
use Mojolicious;
my $app = Mojolicious->new;
Mojolicious::Plugin::OAuth2::Mock->apply_to($app);
that's it. that's the whole flex. π
π¦ DESCRIPTION π¦
so Mojolicious::Plugin::OAuth2::Mock is an EXPERIMENTAL module (yes bestie, EXPERIMENTAL, we said what we said π) and its entire main character energy is making it easier to test your Mojolicious::Plugin::OAuth2 based code. like it wakes up, mocks the provider, slays, goes home. π«Ά
πΈ METHODS πΈ
π apply_to
Mojolicious::Plugin::OAuth2::Mock->apply_to($app, \%provider_args);
$mock->apply_to($app, \%provider_args);
this is the method that does the thing β¨ It adds mocked routes to a Mojolicious application, and it figures out which routes based on all the keys in %provider_args that end with "_url" β yep, every single one that ends in _url, no cap. π
example time, look at these beauties:
authorize_url=>/mocked/oauth/authorizeauthorization_endpoint_url=>/mocked/oauth2/authorizeend_session_endpoint_url=>/mocked/oauth2/logoutissuer_url=>/mocked/oauth2/v2.0jwks_url=>/mocked/oauth2/keystoken_url=>/mocked/oauth/tokentoken_endpoint_url=>/mocked/oauth2/token
see how each key is a _url key and each value is the mocked path it gets? that's the pattern, iykyk π
β SEE ALSO β
Mojolicious::Plugin::OAuth2β go read that one too bestie, it's the whole reason this mock exists π§
and that's the page! brought to you by perl v5.42.0, dated 2022-02-09, straight from the User Contributed Perl Documentation section of the manual, mwah ππΈ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious-Plugin-OAuth2 2.02-bp160.1.11 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms