xs/plugin.xs

filter: Statementstmt 0.0% 0 / 7 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 15 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« include/ptotp/ptotp_plugin.h ↑ Summary include/ptotp/ptotp_otp.h »
1 MODULE = Punk::TOTP PACKAGE = Punk::Plugin::TOTP
2  
3 PROTOTYPES: DISABLE
4  
5 # plugin 'TOTP' => \%opts, via Punk: validates the options, freezes the
6 # configuration under the application class, and installs the helpers,
7 # the challenge routes, the rate limit and the totp_guard keyword
8 # (ptotp_plugin.h).
9 void
10 register(class, app, opts = &PL_sv_undef)
11 SV *class
12 SV *app
13 SV *opts
14 CODE:
15 PERL_UNUSED_VAR(class);
16 0 pp_register(aTHX_ app, opts);
17  
18 # The configuration for an application class - the test and introspection
19 # seam. The hash is live: a value changed here is what the next request
20 # reads.
21 SV *
22 state_for(...)
23 CODE:
24 {
25 0 SV **e = NULL;
26 0 ▶ if (items > 0 && PP_STATE) {
Branch: 2 branches
BranchTrueFalseTotal
if (items > 0 && PP_STATE) { 0 0 0
if (items > 0 && PP_STATE) { 0 0 0
27 STRLEN kl;
28 0 const char *k = SvPV_const(ST(items - 1), kl);
29 0 e = hv_fetch(PP_STATE, k, (I32)kl, 0);
30 }
31 0 ▶ RETVAL = (e && *e) ? newSVsv(*e) : newSV(0);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = (e && *e) ? newSVsv(*e) : newSV(0); 0 0 0
RETVAL = (e && *e) ? newSVsv(*e) : newSV(0); 0 0 0
32 }
33 OUTPUT:
34 RETVAL
35  
36 # The recovery digest: case folded, grouping stripped, lowercase sha256
37 # hex - pwd_token_digest's wire form.
38 SV *
39 _recovery_digest(code)
40 SV *code
41 CODE:
42 0 RETVAL = pp_recovery_digest(aTHX_ code);
43 OUTPUT:
44 RETVAL
« include/ptotp/ptotp_plugin.h ↑ Summary include/ptotp/ptotp_otp.h »