blib/lib/OIDC/Lite/Server/DataHandler.pm

filter: Statementstmt 100% 46 / 46 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 21 / 21 Podpod 88.8% 16 / 18 totaltotal 97.6% 83 / 85 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/OIDC/Lite/Server/Endpoint/Token.pm ↑ Summary blib/lib/OIDC/Lite.pm »
1 package OIDC::Lite::Server::DataHandler;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use parent 'OAuth::Lite2::Server::DataHandler';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub validate_client_for_authorization {
7 1 ▶ my ($self, $client_id, $response_type) = @_;
Subroutine validate_client_for_authorization: called CC=1 SCAR=0.0
Pod documented
8 1 die "abstract method";
9 }
10  
11 sub validate_redirect_uri {
12 1 ▶ my ($self, $client_id, $redirect_uri) = @_;
Subroutine validate_redirect_uri: called CC=1 SCAR=0.0
Pod documented
13 1 die "abstract method";
14 }
15  
16 sub validate_scope {
17 1 ▶ my ($self, $client_id, $scope) = @_;
Subroutine validate_scope: called CC=1 SCAR=0.0
Pod documented
18 1 die "abstract method";
19 }
20  
21 sub validate_display {
22 1 ▶ my ($self, $display) = @_;
Subroutine validate_display: called CC=1 SCAR=0.0
Pod documented
23 1 die "abstract method";
24 }
25  
26 sub validate_prompt {
27 1 ▶ my ($self, $prompt) = @_;
Subroutine validate_prompt: called CC=1 SCAR=0.0
Pod documented
28 1 die "abstract method";
29 }
30  
31 sub validate_max_age {
32 1 ▶ my ($self, $param) = @_;
Subroutine validate_max_age: called CC=1 SCAR=0.0
Pod documented
33 1 die "abstract method";
34 }
35  
36 sub validate_ui_locales {
37 1 ▶ my ($self, $ui_locales) = @_;
Subroutine validate_ui_locales: called CC=1 SCAR=0.0
Pod undocumented
38 1 die "abstract method";
39 }
40  
41 sub validate_claims_locales {
42 1 ▶ my ($self, $claims_locales) = @_;
Subroutine validate_claims_locales: called CC=1 SCAR=0.0
Pod undocumented
43 1 die "abstract method";
44 }
45  
46 sub validate_id_token_hint {
47 1 ▶ my ($self, $param) = @_;
Subroutine validate_id_token_hint: called CC=1 SCAR=0.0
Pod documented
48 1 die "abstract method";
49 }
50  
51 sub validate_login_hint {
52 1 ▶ my ($self, $param) = @_;
Subroutine validate_login_hint: called CC=1 SCAR=0.0
Pod documented
53 1 die "abstract method";
54 }
55  
56 sub validate_acr_values {
57 1 ▶ my ($self, $param) = @_;
Subroutine validate_acr_values: called CC=1 SCAR=0.0
Pod documented
58 1 die "abstract method";
59 }
60  
61 sub validate_request {
62 1 ▶ my ($self, $param) = @_;
Subroutine validate_request: called CC=1 SCAR=0.0
Pod documented
63 1 die "abstract method";
64 }
65  
66 sub validate_request_uri {
67 1 ▶ my ($self, $param) = @_;
Subroutine validate_request_uri: called CC=1 SCAR=0.0
Pod documented
68 1 die "abstract method";
69 }
70  
71 sub get_user_id_for_authorization {
72 1 ▶ my ($self) = @_;
Subroutine get_user_id_for_authorization: called CC=1 SCAR=0.0
Pod documented
73 1 die "abstract method";
74 }
75  
76 sub create_id_token {
77 1 ▶ my ($self) = @_;
Subroutine create_id_token: called CC=1 SCAR=0.0
Pod documented
78 1 die "abstract method";
79 # need another param?
80 }
81  
82 sub create_or_update_auth_info {
83 1 ▶ my ($self, %args) = @_;
Subroutine create_or_update_auth_info: called CC=1 SCAR=0.0
Pod documented
84 1 die "abstract method";
85 }
86  
87 # Because it is a method added later and optional, this must not die
88 sub validate_server_state {
89 1 ▶ my ($self, $server_state, $client_id) = @_;
Subroutine validate_server_state: called CC=1 SCAR=0.0
Pod documented
90 1 return 0;
91 }
92  
93 sub require_server_state {
94 1 ▶ my ($self, $scope) = @_;
Subroutine require_server_state: called CC=1 SCAR=0.0
Pod documented
95 1 return 0;
96 }
97  
98 =head1 NAME
99  
100 OIDC::Lite::Server::DataHandler - Base class that specifies interface for data handler for your service.
101  
102 =head1 DESCRIPTION
103  
104 This specifies interface to handle data stored on your application.
105 You have to inherit this, and implements subroutines according to the interface contract.
106 This is proxy or adapter that connects OIDC::Lite library to your service.
107  
108 =head1 SYNOPSIS
109  
110 package YourDataHandler;
111
112 use strict;
113 use warnings;
114  
115 use parent 'OIDC::Lite::Server::DataHandler';
116  
117 sub validate_scope {
118 my ($self, $client_id, $scope) = @_;
119 # your logic
120 return 1;
121 }
122  
123 =head1 METHODS
124  
125 =head2 init
126  
127 If your subclass need some initiation, implement in this method.
128  
129 =head1 INTERFACES
130  
131 =head2 request
132  
133 Returns <Plack::Request> object.
134  
135 =head2 validate_client_for_authorization( $client_id, $response_type )
136  
137 Validation of client and allowed response_type.
138 If it's OK, return 1. Return 0 if not.
139  
140 =head2 validate_redirect_uri( $client_id, $redirect_uri )
141  
142 Validation of redirect_uri param.
143 If it's OK, return 1. Return 0 if not.
144  
145 =head2 validate_scope( $client_id, $scope )
146  
147 Validation of scope param.
148 If it's OK, return 1. Return 0 if not.
149  
150 =head2 validate_display( $display )
151  
152 Validation of display param.
153 If it's OK, return 1. Return 0 if not.
154  
155 =head2 validate_prompt( $prompt )
156  
157 Validation of prompt param.
158 If it's OK, return 1. Return 0 if not.
159  
160 =head2 validate_max_age( $aram )
161  
162 Validation of max_age param.
163 If it's OK, return 1. Return 0 if not.
164  
165 =head2 validate_ui_locales_( $ui_locales )
166  
167 Validation of ui_locales param.
168 If it's OK, return 1. Return 0 if not.
169  
170 =head2 validate_claims_locales_( $claims_locales )
171  
172 Validation of claims_locales param.
173 If it's OK, return 1. Return 0 if not.
174  
175 =head2 validate_id_token_hint( $param )
176  
177 Validation of id_token_hint param.
178 If it's OK, return 1. Return 0 if not.
179  
180 =head2 validate_login_hint( $param )
181  
182 Validation of login_hint param.
183 If it's OK, return 1. Return 0 if not.
184  
185 =head2 validate_acr_values( $param )
186  
187 Validation of acr_values param.
188 If it's OK, return 1. Return 0 if not.
189  
190 =head2 validate_request( $param )
191  
192 Validation of request param.
193 If it's OK, return 1. Return 0 if not.
194  
195 =head2 validate_request_uri( $param )
196  
197 Validation of request_uri param.
198 If it's OK, return 1. Return 0 if not.
199  
200 =head2 get_user_id_for_authorization()
201  
202 Return current user_id string.
203  
204 =head2 create_id_token()
205  
206 Return OIDC::Lite::Model::IDToken object.
207  
208 =head2 create_or_update_auth_info(%args)
209  
210 Return OIDC::Lite::Model::AuthInfo object.
211  
212 =head2 validate_server_state($server_state, $client_id)
213  
214 Return whether server_state is valid or not
215  
216 =head2 require_server_state($scope)
217  
218 Return whether scope requires server_state
219  
220 =head1 AUTHOR
221  
222 Ryo Ito, E<lt>ritou.06@gmail.comE<gt>
223  
224 =head1 COPYRIGHT AND LICENSE
225  
226 Copyright (C) 2012 by Ryo Ito
227  
228 This library is free software; you can redistribute it and/or modify
229 it under the same terms as Perl itself, either Perl version 5.8.8 or,
230 at your option, any later version of Perl 5 you may have available.
231  
232 =cut
233  
234 5 1;
« blib/lib/OIDC/Lite/Server/Endpoint/Token.pm ↑ Summary blib/lib/OIDC/Lite.pm »