Mattermost/V4/API/Resource/SAML/Certificate.pm

filter: Statementstmt 22.7% 5 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 12.5% 1 / 8 Podpod 85.7% 6 / 7 totaltotal 32.4% 12 / 37 CC 1 SCAR 6.3
CC
1
Cov
23%
status
2.0
idp_upload
2.0
idp_remove
2.0
CRAP 1.9
« Mattermost/V4/API/Object/Config.pm ↑ Summary Mattermost/V4/API/Resource/File.pm »
1 package WebService::Mattermost::V4::API::Resource::SAML::Certificate;
2  
3 # ABSTRACT: Wrapped API methods for the SAML certificate API endpoints.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 extends 'WebService::Mattermost::V4::API::Resource';
8  
9 ################################################################################
10  
11 sub status {
12 0 ▶ my $self = shift;
Subroutine status: not called CC=1 SCAR=6.9
Pod undocumented
13  
14 0 return $self->_get({ endpoint => 'status' });
15 }
16  
17 sub idp_upload {
18 0 ▶ my $self = shift;
Subroutine idp_upload: not called CC=1 SCAR=6.9
Pod documented
19 0 my $filename = shift;
20  
21 # TODO: wrapping helper for filenames (here and Resource::Users)
22  
23 0 return $self->_post({
24 endpoint => 'idp',
25 override_data_type => 'form',
26 parameters => {
27 certificate => { file => $filename },
28 },
29 });
30 }
31  
32 sub idp_remove {
33 0 ▶ my $self = shift;
Subroutine idp_remove: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 return $self->_delete({ endpoint => 'idp' });
36 }
37  
38 sub public_upload {
39 0 ▶ my $self = shift;
Subroutine public_upload: not called CC=1 SCAR=6.9
Pod documented
40 0 my $filename = shift;
41  
42 # TODO: wrapping helper for filenames (here and Resource::Users)
43  
44 0 return $self->_post({
45 endpoint => 'public',
46 override_data_type => 'form',
47 parameters => {
48 certificate => { file => $filename },
49 },
50 });
51 }
52  
53 sub public_remove {
54 0 ▶ my $self = shift;
Subroutine public_remove: not called CC=1 SCAR=6.9
Pod documented
55  
56 0 return $self->_delete({ endpoint => 'public' });
57 }
58  
59 sub private_upload {
60 0 ▶ my $self = shift;
Subroutine private_upload: not called CC=1 SCAR=6.9
Pod documented
61 0 my $filename = shift;
62  
63 # TODO: wrapping helper for filenames (here and Resource::Users)
64  
65 0 return $self->_post({
66 endpoint => 'private',
67 override_data_type => 'form',
68 parameters => {
69 certificate => { file => $filename },
70 },
71 });
72 }
73  
74 sub private_remove {
75 0 ▶ my $self = shift;
Subroutine private_remove: not called CC=1 SCAR=6.9
Pod documented
76  
77 0 return $self->_delete({ endpoint => 'private' });
78 }
79  
80 ################################################################################
81  
82 12 1;
83  
84 __END__
85  
86 =pod
87  
88 =encoding UTF-8
89  
90 =head1 NAME
91  
92 WebService::Mattermost::V4::API::Resource::SAML::Certificate - Wrapped API methods for the SAML certificate API endpoints.
93  
94 =head1 VERSION
95  
96 version 0.28
97  
98 =head1 DESCRIPTION
99  
100 =head2 USAGE
101  
102 use WebService::Mattermost;
103  
104 my $mm = WebService::Mattermost->new({
105 authenticate => 1,
106 username => 'me@somewhere.com',
107 password => 'hunter2',
108 base_url => 'https://my.mattermost.server.com/api/v4/',
109 });
110  
111 my $resource = $mm->api->saml->certificate;
112  
113 =head2 METHODS
114  
115 =over 4
116  
117 =item C<idp_upload()>
118  
119 Upload an IDP key.
120  
121 $resource->idp_upload('/path/to/idp.key');
122  
123 =item C<idp_remove()>
124  
125 Remove your associated IDP key.
126  
127 $resource->idp_remove();
128  
129 =item C<public_upload()>
130  
131 Upload a public key.
132  
133 $resource->public_upload('/path/to/public.key');
134  
135 =item C<public_remove()>
136  
137 Remove your associated public key.
138  
139 $resource->public_remove();
140  
141 =item C<private_upload()>
142  
143 Upload a private key.
144  
145 $resource->private_upload('/path/to/private.key');
146  
147 =item C<private_remove()>
148  
149 Remove your associated private key.
150  
151 $resource->private_remove();
152  
153 =back
154  
155 =head1 SEE ALSO
156  
157 =over 4
158  
159 =item L<Official SAML documentation|https://api.mattermost.com/#tag/SAML>
160  
161 =back
162  
163 =head1 AUTHOR
164  
165 Mike Jones <mike@netsplit.org.uk>
166  
167 =head1 COPYRIGHT AND LICENSE
168  
169 This software is Copyright (c) 2020 by Mike Jones.
170  
171 This is free software, licensed under:
172  
173 The MIT (X11) License
174  
175 =cut
« Mattermost/V4/API/Object/Config.pm ↑ Summary Mattermost/V4/API/Resource/File.pm »