| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Async::Zitadel; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Async Perl client for Zitadel identity management (IO::Async + Future) |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
538943
|
use Moo; |
|
|
1
|
|
|
|
|
11358
|
|
|
|
1
|
|
|
|
|
7
|
|
|
6
|
1
|
|
|
1
|
|
3127
|
use Net::Async::HTTP; |
|
|
1
|
|
|
|
|
195678
|
|
|
|
1
|
|
|
|
|
65
|
|
|
7
|
1
|
|
|
1
|
|
887
|
use Net::Async::Zitadel::OIDC; |
|
|
1
|
|
|
|
|
8
|
|
|
|
1
|
|
|
|
|
54
|
|
|
8
|
1
|
|
|
1
|
|
928
|
use Net::Async::Zitadel::Management; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
51
|
|
|
9
|
1
|
|
|
1
|
|
8
|
use Net::Async::Zitadel::Error; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
25
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use namespace::clean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
6
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'IO::Async::Notifier'; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has issuer => ( |
|
17
|
|
|
|
|
|
|
is => 'ro', |
|
18
|
|
|
|
|
|
|
required => 1, |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub BUILD { |
|
22
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
23
|
0
|
0
|
|
|
|
|
die Net::Async::Zitadel::Error::Validation->new( |
|
24
|
|
|
|
|
|
|
message => 'issuer must not be empty', |
|
25
|
|
|
|
|
|
|
) unless length $self->issuer; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has token => ( |
|
29
|
|
|
|
|
|
|
is => 'ro', |
|
30
|
|
|
|
|
|
|
doc => 'Personal Access Token for Management API', |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has http => ( |
|
34
|
|
|
|
|
|
|
is => 'lazy', |
|
35
|
|
|
|
|
|
|
builder => sub { |
|
36
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
37
|
0
|
|
0
|
|
|
|
my $http = Net::Async::HTTP->new( |
|
38
|
|
|
|
|
|
|
user_agent => 'Net-Async-Zitadel/' . ($self->VERSION // '0'), |
|
39
|
|
|
|
|
|
|
); |
|
40
|
0
|
|
|
|
|
|
$self->add_child($http); |
|
41
|
0
|
|
|
|
|
|
return $http; |
|
42
|
|
|
|
|
|
|
}, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has oidc => ( |
|
46
|
|
|
|
|
|
|
is => 'lazy', |
|
47
|
|
|
|
|
|
|
builder => sub { |
|
48
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
49
|
0
|
|
|
|
|
|
Net::Async::Zitadel::OIDC->new( |
|
50
|
|
|
|
|
|
|
issuer => $self->issuer, |
|
51
|
|
|
|
|
|
|
http => $self->http, |
|
52
|
|
|
|
|
|
|
); |
|
53
|
|
|
|
|
|
|
}, |
|
54
|
|
|
|
|
|
|
); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has management => ( |
|
57
|
|
|
|
|
|
|
is => 'lazy', |
|
58
|
|
|
|
|
|
|
builder => sub { |
|
59
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
60
|
0
|
0
|
|
|
|
|
die Net::Async::Zitadel::Error::Validation->new( |
|
61
|
|
|
|
|
|
|
message => 'Management API requires a token', |
|
62
|
|
|
|
|
|
|
) unless $self->token; |
|
63
|
0
|
|
|
|
|
|
Net::Async::Zitadel::Management->new( |
|
64
|
|
|
|
|
|
|
base_url => $self->issuer, |
|
65
|
|
|
|
|
|
|
token => $self->token, |
|
66
|
|
|
|
|
|
|
http => $self->http, |
|
67
|
|
|
|
|
|
|
); |
|
68
|
|
|
|
|
|
|
}, |
|
69
|
|
|
|
|
|
|
); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |