| 1 | package Concierge::Auth::Base v0.5.2; | ||
| 2 | 7 | ▶ | use v5.36; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | # ABSTRACT: Base class / contract for Concierge::Auth backends | ||
| 5 | |||
| 6 | 7 | ▶ | use Concierge::Auth::Generators (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | # Define interface methods that must be implemented by subclasses: | ||
| 9 | # Concierge::Auth::MyBackend->new(%args); | ||
| 10 | 1 | ▶ | sub new { die "Subclass must implement new" } |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | |||
| 12 | # $backend->authenticate($user_id, $credential); | ||
| 13 | 1 | ▶ | sub authenticate { die "Subclass must implement authenticate" } |
|
Subroutine
authenticate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | |||
| 15 | # $backend->is_id_known($user_id); | ||
| 16 | 1 | ▶ | sub is_id_known { die "Subclass must implement is_id_known" } |
|
Subroutine
is_id_known: called CC=1 SCAR=0.0
Pod
documented
| |||
| 17 | |||
| 18 | # $backend->enroll($user_id, $credential, \%opts); | ||
| 19 | 1 | ▶ | sub enroll { die "Subclass must implement enroll" } |
|
Subroutine
enroll: called CC=1 SCAR=0.0
Pod
documented
| |||
| 20 | |||
| 21 | # $backend->change_credentials($user_id, $new_credential); | ||
| 22 | 1 | ▶ | sub change_credentials { die "Subclass must implement change_credentials" } |
|
Subroutine
change_credentials: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | |||
| 24 | # $backend->revoke($user_id); | ||
| 25 | 1 | ▶ | sub revoke { die "Subclass must implement revoke" } |
|
Subroutine
revoke: called CC=1 SCAR=0.0
Pod
documented
| |||
| 26 | |||
| 27 | # Generator methods -- default implementations delegate to the plain | ||
| 28 | # functions in Concierge::Auth::Generators, preserving its wantarray | ||
| 29 | # (value)/(value, message) dual-return convention. Unlike the five | ||
| 30 | # methods above, these are NOT required overrides: a backend that has | ||
| 31 | # no reason to customize ID/token generation gets a working | ||
| 32 | # implementation for free. Any backend may still override one or more | ||
| 33 | # of these with its own logic (e.g. an LDAP backend deferring ID | ||
| 34 | # generation to the directory). | ||
| 35 | 1 | ▶ | sub gen_uuid { my $self = shift; return Concierge::Auth::Generators::gen_uuid(@_); } |
|
Subroutine
gen_uuid: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | 2 | ▶ | sub gen_random_id { my $self = shift; return Concierge::Auth::Generators::gen_random_id(@_); } |
|
Subroutine
gen_random_id: called CC=1 SCAR=0.0
Pod
documented
| |||
| 37 | 1 | ▶ | sub gen_random_token { my $self = shift; return Concierge::Auth::Generators::gen_random_token(@_); } |
|
Subroutine
gen_random_token: called CC=1 SCAR=0.0
Pod
documented
| |||
| 38 | 1 | ▶ | sub gen_random_string { my $self = shift; return Concierge::Auth::Generators::gen_random_string(@_); } |
|
Subroutine
gen_random_string: called CC=1 SCAR=0.0
Pod
documented
| |||
| 39 | 2 | ▶ | sub gen_word_phrase { my $self = shift; return Concierge::Auth::Generators::gen_word_phrase(@_); } |
|
Subroutine
gen_word_phrase: called CC=1 SCAR=0.0
Pod
documented
| |||
| 40 | # Does NOT call the original deprecated methods; calls their replacements | ||
| 41 | # But these are still considered deprecated method names | ||
| 42 | 1 | ▶ | sub gen_token { my $self = shift; return Concierge::Auth::Generators::gen_random_token(@_); } |
|
Subroutine
gen_token: called CC=1 SCAR=0.0
Pod
documented
| |||
| 43 | 1 | ▶ | sub gen_crypt_token { my $self = shift; return Concierge::Auth::Generators::gen_random_token(@_); } |
|
Subroutine
gen_crypt_token: called CC=1 SCAR=0.0
Pod
documented
| |||
| 44 | |||
| 45 | 7 | 1; | |
| 46 | |||
| 47 | __END__ | ||