Bug 20402: Add missing POD
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 17 Apr 2018 19:23:56 +0000 (16:23 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 May 2018 18:55:43 +0000 (15:55 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/OAuth.pm
Koha/OAuthAccessToken.pm
Koha/OAuthAccessTokens.pm

index 6966570..e322206 100644 (file)
@@ -1,8 +1,39 @@
 package Koha::OAuth;
 
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
 use Modern::Perl;
+
 use Koha::OAuthAccessTokens;
-use Koha::OAuthAccessToken;
+
+=head1 NAME
+
+Koha::OAuth - Koha library for OAuth2 callbacks
+
+=head1 API
+
+=head2 Class methods
+
+=head3 config
+
+    my $config = Koha::OAuth->config;
+
+Returns a hashref containing the callbacks Net::OAuth2::AuthorizationServer requires
+
+=cut
 
 sub config {
     return {
@@ -12,6 +43,13 @@ sub config {
     };
 }
 
+=head3 _verify_client_db
+
+A callback to verify if the client asking for authorization is known to the authorization server
+and allowed to get authorization.
+
+=cut
+
 sub _verify_client_cb {
     my (%args) = @_;
 
@@ -30,6 +68,12 @@ sub _verify_client_cb {
     return (1, undef, []);
 }
 
+=head3 _store_access_token_cb
+
+A callback to store the generated access tokens.
+
+=cut
+
 sub _store_access_token_cb {
     my ( %args ) = @_;
 
@@ -46,6 +90,12 @@ sub _store_access_token_cb {
     return;
 }
 
+=head3 _verify_access_token_cb
+
+A callback to verify the access token.
+
+=cut
+
 sub _verify_access_token_cb {
     my (%args) = @_;
 
index c322ea6..0cb15e3 100644 (file)
@@ -1,9 +1,36 @@
 package Koha::OAuthAccessToken;
 
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
 use Modern::Perl;
 
 use base qw(Koha::Object);
 
+=head1 NAME
+
+Koha::OauthAccessToken - Koha OAuth2 access token object class
+
+=head1 API
+
+=head2 Internal methods
+
+=head3 _type
+
+=cut
+
 sub _type {
     return 'OauthAccessToken';
 }
index 12dbf4a..0487627 100644 (file)
@@ -1,15 +1,48 @@
 package Koha::OAuthAccessTokens;
 
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
 use Modern::Perl;
 
 use base qw(Koha::Objects);
 
-sub object_class {
-    return 'Koha::OAuthAccessToken';
-}
+use Koha::OAuthAccessToken;
+
+=head1 NAME
+
+Koha::OauthAccessTokens - Koha OAuth2 access token objects class
+
+=head1 API
+
+=head2 Internal methods
+
+=head3 _type
+
+=cut
 
 sub _type {
     return 'OauthAccessToken';
 }
 
+=head3 object_class
+
+=cut
+
+sub object_class {
+    return 'Koha::OAuthAccessToken';
+}
+
 1;